Subject: Re: Cloning /dev/wd0
To: None <collver1@attbi.com>
From: Herb Peyerl <hpeyerl@beer.org>
List: netbsd-help
Date: 12/10/2002 08:26:58
collver1@attbi.com  wrote:
 > Someone told me it is possible that one disk will have a bad sector and
 > cause dd to fail, giving another reason not to clone with dd.  What would

in theory, an IDE disk should remap it's bad sectors so you shouldn't
find out about it. But I'm just speculating. I could be wrong.

 > 	* use fdisk to read the partition table and write one
 > 	* use installboot to make the new disk bootable
 > 		(but how do you find the original boot configuration?)
 > 	* use disklabel to read the disklabel, save to file
 > 	* edit the disklabel file
 > 	* use disklabel to write the new disklabel to the new disk
 > 	* for each bsd filesystem in the disklabel
 > 		* use dumpfs to read fs parameters
 > 		* use newfs to create the fs on the new disk
 > 		* use dump|restore to copy the filesystem


If you're going to do that, you want to do the installboot last since
your dump of the root fs will copy /boot to the new root fs. 

You can try to use rsync to keep the filesystems sync'd up but
I've never had rsync work reliably; it's horribly broken.