Subject: corrupt disk label
To: 'port-sparc64@netbsd.org' <port-sparc64@netbsd.org>
From: Jenkins, Michael <Michael.Jenkins@disney.com>
List: port-sparc64
Date: 10/15/2001 17:20:09
In the install guide:

  # dd if=miniroot.fs of=/dev/rdsk/c0t0d0s1 bs=4k conv=sync 

That is disasterous on a Solaris box because the swap partition
often starts in cylinder 0 and this will write over the label.
The label is so hosed that the "Recovering a Corrupted Disk Label"
procedure in the admin guide (docs.sun.com) won't recover it.

Here's what I did to recover my disk label:
. copy the label (block 0) from another system with the exact disk
  dd if=/dev/rdsk/c0t0d0s2 of=/dev/fd0c bs=512 count=1
. boot from cdrom
  boot cdrom -s
. restore the label
  dd if=/dev/rdiskette0 of=/dev/rdsk/c0t0d0s2 bs=512 count=1
. run format and follow "Recovering a Corrupted Disk Label"
  format
  format> verify
  format> backup

My system is an Ultra 10 with a 20GB ST320420A IDE disk running
Solaris 2.6 (again!) and (maybe) NetBSD 1.5.2 soon.

Mike