Tuesday, February 5, 2008

I Threw My MBR Off The Deck

When installing FreeBSD, it gives you the option to install the FreeBSD boot manager or a standard MBR. Since I only have one operating system on my hard drive, a standard MBR will boot right into FreeBSD.

Well, instead of doing the right thing, I did the wrong thing and installed the FreeBSD boot manager, also known as boot0. Luckily, UNIX is amazing and gives you the option to fix things. A quick look at boot0cfg(8) (which means type 'man 8 boot0cfg'), and you can see that the fix is:
  • fdisk -B ad0

The -B option to fdisk means, "Reinitialize the boot code contained in sector 0 of the disk." In FreeBSD, your devices are referred to by the kernel module/driver they use. "ad" is the "generic ATA/ATAPI disk controller driver" and 0 is the number of the first ATA/ATAPI disk (zero-indexed, of course). You might have a different disk. Adjust that last argument as necessary.

No comments:

Post a Comment