Date: Mon, 22 Feb 2010 09:56:18 -0500 From: Jerry McAllister <jerrymc@msu.edu> To: Aiza <aiza21@comclark.com> Cc: freebsd-questions <questions@freebsd.org> Subject: Re: Dump/restore to clone disk Message-ID: <20100222145618.GD43687@gizmo.acns.msu.edu> In-Reply-To: <4B82416B.7050001@comclark.com> References: <4B82416B.7050001@comclark.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 22, 2010 at 04:33:47PM +0800, Aiza wrote: > 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. Some of these questions sound like you have not been studying the documentation as you should. People on this list will quickly lose patience if you do not do your own homework before asking questions. There is nothing so futile as trying to trying to explain something to someone who has not done their homework. > > What happened to swap? The fstab will be showing it as > the first file system on the hard drive slice. > Is something missing here? Swap is never backed up. It makes no sense to back up swap. It is just scratch space used by the OS and completely irrelevant to any other system. Try looking in to the documentation. > > What about the file system sizes. > Will the restored hard drive have the same > file system sizes as the source file system? Read the documentation. They will have the same size as what you make them. Dump/restore do no create filesystems. They just back up and restore data withing filesystems. You create the partitions yourself. A filesystem is an identifiable - most likely a partition, could be a whole disk, that has had newfs run on it to create a filesystem structure and then mounted to some mount point you have created with mkdir. > Is there some way to allocate larger file systems > on the target without using sysinstall to prepare > the target beforehand? Yes, you use fdisk and bsdlabel and finally newfs. But, you cannot do this willy-nilly on a disk that is already in use. This is well documented. > > Is there some command to display > the file system allocation size? > Oh come on. This is all over the documentation. Try: df -k There are lots of other ways you can look up too. ////jerry > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100222145618.GD43687>