# Disk backup



## TheNewUser (May 23, 2014)

Hello, I just downloaded FreeBSD 10 on DVD, but before I install, I want to back up my hard disk in case anything goes wrong under the installation. I am running Windows and I have three partitions: two with NTFS, one with FAT32 and also unpartitioned space where I later will be installing FreeBSD.

Instead of downloading special backup software, I will be using dd from the FreeBSD DVD and copy the disk as one big file to an USB hard disk drive, unless that is a very bad idea. I have shrunk the partition on my USB HDD in Windows, so I can make a new partition with FreeBSD and copy my whole HDD there. But what file system should I use? And what block size should I use for the dd command, the same as the sector size?


----------



## wblock@ (May 23, 2014)

dd(1) is generally a poor method of backup.  It will copy every block, whether that block is used or not.  For Windows systems, try Clonezilla.  It only copies the used blocks.

If you want to use dd(1), give it at least a 64K buffer or it will take forever.


----------



## TheNewUser (May 23, 2014)

No problem, I have more than enough space on my USB HDD. 

I have created a UFS partition with enough space and mounted it on /mnt. So would this be ok, you think? 
`dd if=/dev/ada0 of=/mnt/image.img bs=262144`

Should I use notrunc? I want to compare the files with cmp after.


----------



## wblock@ (May 24, 2014)

notrunc is not needed.  bs takes human-readable units, so you can just do `dd if=/dev/ada0 of=/mnt/image.img bs=256k`.  On standard hard disks, using a buffer much larger than 128K probably will not increase the speed.


----------



## TheNewUser (May 24, 2014)

Ok, thank you. It looked like it worked, but about halfway through I got some error messages:

```
(First the date and time) sendmail[1410]: NOQUEUE: SYSERR(root): can not chdir(/var/spool/clientmqueue): No such file or directory
```
The message appeared twice, both in the same minute according to the time in the error messages, the only difference was that the second message said 
	
	



```
sendmail[1412]
```
Does anyone know what this could be?
Edit: dd (apparently) finished, but I haven't had time to use cmp on the file yet.


----------



## Beastie (May 24, 2014)

This is probably unrelated to the thread's topic.

Just make sure that the /var partition is accessible, that /var/spool/clientmqueue exists, that it's owned by *smmsp:smmsp* and that it's permissions are set to *770* (*drwxrwx---*).


----------



## wblock@ (May 24, 2014)

Hopefully it's unrelated.  With dd(1), it is really easy to mix up the parameters and overwrite the wrong thing.


----------



## TheNewUser (May 25, 2014)

I can see a /dev/spool/mqueue, but not clientmqueue, is it supposed to be there when running the live DVD? I checked both the ISO file after downloading, and the DVD after burning, everything seemed OK. However the DVD does seems to use a long time when I try to open man pages. Sometimes I get error read error messages before the pages appear, one time it wouldn't stop trying to read a man page, and I had to reboot. I can't remember ever having any problems with my DVD/CD-ROM drive before.

Edit: cmp said the HDD and the image were identical, should I trust it?


----------



## TheNewUser (May 31, 2014)

Bump, in case people didn't see my edit. I don't really care about the instability, i hope that will go away once FreeBSD is properly installed.
Edit: well, I decided to install FreeBSD anyway, since I did a backup of all important files before I used dd.


----------

