Subject: Re: corrupt disk label
To: Jenkins, Michael <Michael.Jenkins@disney.com>
From: David Brownlee <abs@netbsd.org>
List: port-sparc64
Date: 10/18/2001 11:23:53
	Is there a safe way to write the miniroot - maybe with two dd
	commands?
	Either: dd label from the disk into miniroot, then write miniroot
	Or: dd the boot block to disk, then a second dd for the section
	after the label?

-- 
		David/absolute		-- www.netbsd.org: No hype required --


On Mon, 15 Oct 2001, Jenkins, Michael wrote:

> 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
>