Fun with 'fdisk -B -b /boot/boot0 ad0'

Andrew Lankford arlankfo at
Wed Jul 23 23:06:30 PDT 2003

>I was hoping that someone might have an idea, as 
>I've exhausted all of mine for the time being.

Boot0 is just a boot menu whose contents are in sector0 of your
hard disk.  Another boot block (most likely the contents of 
boot1) should located at or near the beginning of 
your freebsd slice.  This is done with the -B option of bsdlabel
(formerly disklabel).  For all I know something to the effect of
typing "bsdlabel -e -B ad0s2_or_whateveryourfbsdsliceis" and
then exiting without making any changes to the displayed table
 of fbsd partitions may do the trick.  Hopefully some experts
 will chime in with better suggestions if I'm dead wrong.

 Certainly, the bsdlabel man page is your friend. In any case,
 I once botched gentoo linux on a neighboring slice and corrupted my freebsd -CURRENT disklabel so that I couldn't even
boot by way of a floppy, but with the disklabel (bsdlabel) 
command on a 5.x install cd, I successfully created an 
identical new one right over the old corrupted one and I didn't
 lose any data.  "Your mileage may vary."

Another (possibly easier, safer) option is set up and use the 
windows boot manager to choose between w2000 or freebsd.  You 
need to copy /boot/boot1 over to your windows partition (give
 it a unique name like "myfbsdboot.bin") and then add a few
 lines to C:\BOOT.INI to the effect of:

C:\myfbsdboot.bin="FreeBSD5.x_CURRENT Partition"

Put it after the line that mentions the windows boot block, which ought to look similar to this:

[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Media Center Edition" /fastdetect /noserialmice /sos

There is some sort of wizard/menu in windows that can
walk you through all this so that you don't have to pull up
C:\boot.ini directly (or create one from scratch perhaps).

Hope this helps.

Andrew Lankford 


More information about the freebsd-current mailing list