Subject: Re: Now I've really done it: I have no more mbr
To: Hisashi T Fujinaka <>
From: walt <>
List: current-users
Date: 08/19/2003 07:05:31
Hisashi T Fujinaka wrote:
> OK, so is there some way of mounting the entire disk and searching for
> /var/backup to regenerate my mbr or am I totally hosed this time?

For future reference, I just did exactly the same thing and IIRC this
was the move that did it:

I was trying to install the secondary boot block so I could use the
native NBSD "/boot" loader instead of loading the kernel directly with
GRUB.  To do this I used installboot with a device of /dev/rwd1c, but
this gave me a 'device not configured' error.

The confusing part is that the 'c' partition started at sector 63 and
I thought I remembered from several years ago that the 'c' parition is
supposed to include the entire disk.

I did have a 'd' partition also, which did start at sector 0 and include
the whole disk.  I did not create either the 'c' or 'd' partitions, BTW,
the disklabel editor did that.

So, I trying using the /dev/rwd1d device with installboot, and of course
it overwrote the partition table in sector 0.  What else would you
expect?  ;-)

Now comes the only helpful suggestion I have:  I was back up and running
in less than 30 minutes after that 'disaster'.  How did I do it?  Simple!

I've done this sort of thing so many times that I expect disaster, so I
WRITE DOWN the partition table and the disklabel on a piece of paper and
tape it to the side of the machine so I can't lose it.  Every time I
change the disklabel or the partition table I religiously update the
piece of paper at the same time -- I NEVER put it off til later.

I recreated both the partition table and the disklabel using the linux
fdisk I had on the first hard disk, which I actually find much easier
to use than any of the BSD utilities.  But I could just as well have
used a rescue boot floppy to do the same task and taken a little longer
to get the job done done.

BTW, I'm back to booting the NetBSD kernel directly with GRUB.  It
works just fine.