Dump/restore to clone disk

Aiza aiza21 at comclark.com
Mon Feb 22 08:33:55 UTC 2010


I have seen this posted in the questions archives to be
used to clone a active system hard drive to a
USB cabled hard drive.



Prepare the target
#dd if=/dev/zero of=/dev/da0 count=2
# fdisk -BI /dev/da0
# bsdlabel -B -w da0s1
# newfs –U /dev/da0s1a               # /
# newfs -U /dev/da0s1d               # /var
# newfs -U /dev/da0s1e               # /tmp
# newfs -U /dev/da0s1f               # /usr

Mount target file system ‘a’
# mount /dev/da0s1a /mnt
# cd /mnt
# dump -0Lauf - /dev/ad1s1a  | restore -rf -
# cd /
# umount /mnt

Mount target file system ‘d’
# mount /dev/da0s1d /mnt
# cd /mnt
# dump -0Lauf - /dev/ad1s1d  | restore -rf -
# cd /
# umount /mnt

Mount target file system ‘e’
# mount /dev/da0s1e /mnt
# cd /mnt
# dump -0Lauf - /dev/ad1s1e  | restore -rf -
# cd /
# umount /mnt

Mount target file system ‘f’
# mount /dev/da0s1f /mnt
# cd /mnt
# dump -0Lauf - /dev/ad1s1f  | restore -rf -
# cd /
# umount /mnt


I have questions about this method.

What happened to swap? The fstab will be showing it as
the first file system on the hard drive slice.
Is something missing here?

What about the file system sizes.
Will the restored hard drive have the same
file system sizes as the source file system?

Is there some way to allocate larger file systems
on the target without using sysinstall to prepare
the target beforehand?

Is there some command to display
the file system allocation size?




More information about the freebsd-questions mailing list