Subject: Re: tool to recomputer/reconstruct a trashed disklabel?
To: Lubomir Sedlacik <>
From: David Laight <>
List: netbsd-users
Date: 04/27/2003 20:15:54
> > Well, I just learned that installing FreeBSD 5.0 on the 2nd half of a
> > disk that has NetBSD on the 1st half isn't very safe. (Possibly it
> > happened because the disk was at wd2, not sure). Not only did the
> > FreeBSD install fail to complete, it ended up trashing the NetBSD
> > disklabel so that it said it was corrupt, and only shows partitions d,
> > e, and f (and shows e starting at offset 63 and going to the end of
> > the disk, which wasn't the case before).

You have the disklabel the kernel generates from the mbr table
(as written by fdisk).

> last time something similar happened to me (trashed disklabel when
> splitting laptop drive and booting off swap partition) i booted from old
> 1.5 cd i had around and searched the drive for disklabel backup in
> /var/backups with `less /dev/rwd0d` and seeking for keywords from
> disklabel.

The root filesystem should start in sector 63 (if the disk was bootable),
so you should be able to mount it (eg: mount /dev/wd2e /mnt) and
find the backup in /mnt/var/backups/work/disklabel.wd2

(Assuming the system had been left up overnight when the relevant
script runs.)


David Laight: