Subject: Re: reinstalling bootblocks / boot selector
To: <>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 07/15/2002 11:57:57
On Mon, Jul 15, 2002 at 11:03:21AM +0100, Rasputin wrote:
>
> I've been toying with using mbrlabel to make my (unused)
> win98 partitions readable.
Not sure what you mean by that....
If you want netbsd to be able to use the space just edit the
netbsd disklabel (with disklabel).
> STr last time I did this I got an unbootable drive, and someone
> mentioned I should reinstall the boot blocks after running fdisk?
>
> If I wanted to do this, I'd run
>
> /usr/mdec/installboot /usr/mdec/biosboot.sym /dev/rwd0a
>
> correct?
fdisk doesn't go anywhere near anywhere that /usr/mdec/installboot
will write to.
>
> Now, since this is writing to the root filesystem (I think),
> how would I go about rewriting the boot selector
> (which looks like it's in the MBR someowhere).
fdisk -c and/or fdisk -B
>
> mbr(8) seems to confirm this, but doesn't explain how to reinstall it.
i386 has more layers of bootstrap than I've cooked hot dinners :-)
The 'mbr' code in sector 0 of the disk is loaded by the BIOS.
The fdisk program modifies sector 0.
The mbr will load the 'pbr' code from first sector of a partition
and execute it.
The 'pbr' code re-reads itself (because it is larger than one sector, and
the mbr code only reads the first sector) then loads in the 'boot' program
from a list of sector numbers.
The boot program does the 5 second countdown.... and loads /netbsd.
/usr/mdec/installboot writes the pbr code, puts the boot program
into /boot and writes the sector numbers of the boot code into the
pbr code.
Clear as mud yet?
David
--
David Laight: david@l8s.co.uk