Installing FreeBSD 4.x / 5.x and Windows XP Together
Here are some notes I decided to jot down after one-too-many blown
installations of Windows XP Pro and FreeBSD on the same physical
drive. Unless you get the sequence just right, you can be left with
an invalid partition map (an unbootable drive with no access to either
operating system), lost time and data.
(I also figured out how to do this with Linux.)
I wanted both operating systems on the drive, selectable via the
standard Windows XP boot menu. I scanned the web and found a lot of
stuff for various permutations of FreeBSD, Linux, and Windows, third
party boot loaders, etc. But no clear step-by-step guide for just
plain old XP and FreeBSD. Further, what hints there were had you
using dd to extract FreeBSD boot record files, using attrib to modify
flags on the Windows boot.ini, etc. It was all quite
unnecessary.
After my exploration, I came up with the following simplified recipe.
It works for FreeBSD 4.x and FreeBSD 5.x. No special software is needed other than the setup CDs for the
operating systems. Follow this order, as enumerated below. I hope it
saves you some grief.
Partition the drive and install Windows
* Note: These steps are needed only for preparing a new drive
for both operating systems. If you already have Windows XP installed,
you can skip this, but be sure you have an unused extended partition
ready for FreeBSD. I found that I had to create and delete one
within Windows (steps 6, 7, and 8 below) for the
partition map to be prepared correctly.
- Boot the Windows XP Pro installation CD
- Create a primary partition for Windows (C:)
- Create a second partition for FreeBSD (D:)
- Format and install XP on the primary partition (C:)
- Boot into Windows XP
- Open the Computer Management administrative tool
- Click Disk Management
- Delete the secondary partition (D:)
Install FreeBSD
- Boot the FreeBSD installation CD
- Do a Custom install and set the Options as appropriate
- Choose the FDISK option
- Select the first partition (aka C:)
- S)et bootable
(which causes the Windows boot selector to work)
- Select the second, unused partition (aka D:) on which FreeBSD will go
- Set the T)ype to 165 (FreeBSD)
- Q)uit and choose N)one to leave the Windows boot record intact
- Finish the disk labeling, distributions, and other installation steps
Set up the Windows boot menu
- Boot into Windows XP if you're not already there
- Locate the /boot/boot1 FreeBSD master boot record file
Note: The standard 512-byte FreeBSD MBR file is /boot/boot1 on every installation, including the FreeBSD CD which is readable from Windows.
- Place the MBR file in C:\ and name it boot1.bsd
- Open the System Properties window
- Click the Advanced tab
- Under Startup and Recovery, click Settings
- Click Edit to open the boot.ini file in Notepad
- Add this line to the end of the file and save:
C:\BOOT1.BSD="FreeBSD"
- Close the Startup and Recovery settings, open it again, and FreeBSD should now appear in the Default operating system drop-down menu.
- If your FreeBSD boot device is not on the first IDE controller (e.g., it's on ad4s2 instead of ad0s2, typical with PCI IDE, RAID, or onboard SATA interfaces), create a C:\loader.conf file and enter these lines, adjusted for your drive's location:
boot_disk_unit="4"
currdev="disk4s2a"
rootdev="disk4s2a"
(Thanks to Gary Cuppett for this hint.)
- Reboot and test it out
After rebooting, it should bring up the Windows XP boot menu with your
new operating system options.
|