Subject: Re: VAXbaby rides again! Now she needs some cloning.....
To: None <nbsdbob@weedcon1.cropsci.ncsu.edu>
From: maximum entropy <entropy@tardis.bernstein.com>
List: port-vax
Date: 10/30/1999 14:47:37
>From: NetBSD Bob <nbsdbob@weedcon1.cropsci.ncsu.edu>
>Date: Sat, 30 Oct 1999 14:16:47 -0400 (EDT)
>
>Now that VAXbaby is happily running 1.4L kernel, I need to clone her
>from a tiny RZ24 onto an RZ25 or RZ26.
>
>What are the disktab entries for the RZ drives?  I did not see them
>in /etc/disktab, and will need to do something to start the label on
>the larger drive.
>
>I did clone a spare RZ24, and found that a dd of the first 1000 records
>of the original drive onto the second, followed by disklabel -i -r
>worked to set the disklabel.  Then the magick dump 0f's to clone the
>root/usr file systems made for a clean cloning onto the second RZ24.
>Now, I need to take that up to the RZ25 or RZ26 level.  Thus the need
>for suggested disktab entries for those drives.
>
>What is the proper way to write the boot blocks on the new drive
>in NetBSD, other than my dd'ing the records across?

You don't need to dd anything.  Your best bet is to just start from
scratch.  If you have already dd'ed an improper disklabel onto it,
wipe it out by dd'ing from /dev/zero onto the disk, and reboot.

When NetBSD sees an unlabeled disk, it will create an in-core fake
disk label with a ``c'' partition covering the whole disk.  What you
want to do is read that label, and write it back to the disk as a real
disklabel:

# cd /tmp
# disklabel sdN > sdN.label
# disklabel -R -r sdN sdN.disklabel

Now create the a, b, and e partitions (or whatever partitions you
like) by editing the on-disk label.  (Remember to set the fstype to
BSD4.2 for any partitions that will contain filesystems):

# disklabel -e sdN

If it will be a boot disk, write out the boot blocks to the drive
(make sure you have the latest boot block files from
ftp://ftp.netbsd.org/pub/NetBSD/arch/vax/kernels installed in
/usr/mdec.  You need the files boot.991023 and xxboot.991023):

# newfs /dev/rsdNa
# mount /dev/sdNa /mnt
# cd /usr/mdec
# cp boot.991023 /mnt/boot
# disklabel -B -b xxboot.991023 sdN

Now copy over the files from the existing partitions:

# cd /mnt
# dump -0f - /oldpartition | restore -xf -

One final note, be careful if copying an old root partition, you may
need to recopy the good boot file if you overwrote it with an old bad
one during the restore:

# cd /usr/mdec
# cp boot.991023 /mnt/boot

Good luck...

--
entropy