Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Feb 2010 16:33:47 +0800
From:      Aiza <aiza21@comclark.com>
To:        freebsd-questions <questions@freebsd.org>
Subject:   Dump/restore to clone disk
Message-ID:  <4B82416B.7050001@comclark.com>

next in thread | raw e-mail | index | archive | help
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?





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B82416B.7050001>