Dan Strick strick at
Fri Feb 6 15:05:15 PST 2004

> Hi... i have the FreeBSD and Windows XP in my computer.... my the 
> windows had removed my FreeBSD boot ...
> Anyone know how to boot in freebsd and restore the boot sector? No MBR!!!

I assume you mean that you first installed FreeBSD in one disk slice
(i.e. MBR partition) and then installed WinXP in another slice and after
installing WinXP you discovered that your system always boots WinXP and
doesn't offer you the option of booting FreeBSD instead.  This is because
the WinXP installation replaced the FreeBSD bootstrap program in the MBR
sector of the disk drive.

There is a messy way of configuring XP to give you the option of booting
FreeBSD but it is easier to just reinstall the standard FreeBSD master
bootstrap program.  If you have (or can make) the live file system CD
for a recent release of FreeBSD (from the file ...-i386-disc2.iso), boot
the installation floppy or CD for that release, go into fixit mode using
the live file system CD, and issue the command

	boot0cfg -B ad0

where "ad0" is the disk on which you installed both FreeBSD and WinXP.

If you don't have the live file system CD, instead of going into fixit
mode you can select the "custom installation" menu option and then select
the menu option for allocating disk space for FreeBSD (i.e. the option
for editing MBR partition tables).  Select the disk drive on which you
previously installed FreeBSD and WinXP.  Verify that the MBR partition
table that it fetches from the disk drive is correct and issue the
undocumented "W" command.  Then exit the installation procedure without
doing an installation and reboot.

Dan Strick
strick at

More information about the freebsd-stable mailing list