Subject: Re: Best way to copy a NetBSD drive to a new drive
To: Gerry Simmons <gerry_simmons@phase2.com>
From: Wojciech Puchar <wojtek@tensor.3miasto.net>
List: netbsd-users
Date: 06/04/2003 19:45:19
> To: netbsd-users@netbsd.org
> Subject: Best way to copy a NetBSD drive to a new drive
>
> I have a 4GB drive that is going bad. Fortunately, if I cool down the drive
> in a refridgerator, it will behave itself for awhile.
>
> I tried to disklabel the new drive exactly as the old, thinking that I could
> boot from the Install Floppy, and dd the information
> from one partition to another. However, "dd -if /dev/rwd0a -of /dev/rwd1a"
> complaind that /dev/rwd1a was a Read-Only Filesystem.

yes it will if wd1a begins from 0

assuming wd0a begins at 0 too try

dd if=/dev/rwd0a of=/dev/rwd0d bs=64k

then

dd if=/dev/zero of=/dev/rwd1d bs=2k count=1

then disklabel -I -i wd1

and make disklabel so first partition will begin at 0 and will have same
number of sectors.


other method:

make all needed partition on new disk possibly larger, use newfs on them
all, then turn off, boot from your refrigerated drive, mount new
partition at /mnt and

cd /mnt
tar clf - /|tar xpvf -


(if more than 1 partition do similar operation on others)