Packetwatch.net

Multi-Boot Windows XP, OpenBSD, FreeBSD,

and Fedora with the NT Boot Loader



Last modified: May 16, 2006

Contents
1 - Summary
2 - Windows XP Partitioning
3 - OpenBSD Partitioning
4 - FreeBSD Partitioning
5 - Fedora Partitioning
6 - Fedora Boot Configuration
7 - OpenBSD Boot Sector
8 - FreeBSD Boot Sector
9 - Fedora Boot Sector
10 - NT Boot Loader Configuration
11 - Fedora Boot Loader Configuration
12 - Windows XP Master Boot Record


1 - Summary

This little guide will show you how to multi-boot Windows XP Professional,
OpenBSD 3.6, FreeBSD 5.3, and Fedora Core 3 while using the NT Boot Loader. It
also shows how to have one partition shared between all four operating
systems. In this guide we will be using a single 40 GB hard drive.


2 - Windows XP Partitioning

First, boot from a Windows 98 Boot Disk, and run fdisk. Delete all the
partitions on the hard drive. Start by installing Windows XP Professional.
Windows XP is installed first because it must be the first operating system on
the hard drive. When you get to the partition screen type C to create a
partition. Make the partition size 6144 MB (6 GB). Set up Windows XP on the
newly created partition. Format the partition using NTFS.


3 - OpenBSD Partitioning

Install OpenBSD 3.6. OpenBSD is installed next because the OpenBSD root
partition must be completely contained within the first 8 GB of the hard drive.
When you get to the fdisk partition editor, look at the disk geometry of wd0.
It should have something like this: x/255/63. For me it says: 4864/255/63. Also
look at the ending cylinder for MBR partition 0, in my case 782. The starting
cylinder will be 783. The ending cylinder can be found by calculating the
following for the 3 GB partition.

  40 GB = 40960 MB   ->   40960                3072                   782
                          ----- = 8.421   ->   ----- = 364.8   ->     365
                          4864                 8.421                + ---
                                                                     1147

Now create the 3 GB partition. To do this start by typing "e 1".

  Partition id: A6
  Edit in CHS mode? y
  BIOS Starting cylinder: 783
  BIOS Starting head: 1
  BIOS Starting sector: 1
  BIOS Ending cylinder: 1147
  BIOS Ending head: 254
  BIOS Ending sector: 63

Now type "print" to double-check your work. Set the OpenBSD MBR partition to be
active (bootable) by typing: flag 1. Type "quit" to leave fdisk and write the
changes to the MBR. Type "p m" to print the partitions. The i partition is the
Windows XP NTFS partition. Delete the a partition created by fdisk by
typing "d a". Now, create your /, swap, /tmp, /var, /usr, and /home partitions
like normal. Then type "w", then "q" to quit and finish the installation.


4 - FreeBSD Partitioning

Install FreeBSD 5.3. When you get to the fdisk partition editor, create a
16 GB partition of type 165 (native FreeBSD slice). The slice should be ad2s3.
Select the FreeBSD slice, and type "S" to make it bootable. For the boot
manager select None to leave the master boot record untouched. Now, create
your FreeBSD partitions as normal.


5 - Fedora Partitioning

Install Fedora Core 3. When you get to the fdisk partitioning screen select
Manually partition with Disk Druid. Create the following partitions.

  /dev/hdc5     /          ext3     6144            - Fixed size
  /dev/hdc6                swap      512            - Fixed size
  /dev/hdc7     /share     vfat     5907 (leftover) - Fill to max allowable size

You should now notice that the Linux root, Linux swap, and /share partitions
are all extended paritions. At the boot loader configuration screen, edit the
boot loader to have the following while keeping Fedora as the default.

  Windows XP     /dev/hdc1
  OpenBSD        /dev/hdc2
  FreeBSD        /dev/hdc3
  Fedora         /dev/hdc5

Now, check Configure advanced boot loader options and click Next. Select the
option to have /dev/hdc5 have the first sector of the boot partition.


6 - Fedora Boot Configuration

Boot from the Fedora Core 3 Disc 1 CD and type "linux rescue". Then type the
following to make the Fedora MBR partition active or bootable. Type the following.

# chroot /mnt/sysimage
# /sbin/grub-install /dev/hdc
# exit
# exit

Reboot and press the down arrow-key, and select Fedora-up. Change to root and
type the following.

# cd /boot
# rm -f config*smp
# rm -f initrd*smp.img
# rm -f System.map*smp
# rm -f vmlinuz*smp
# vi grub/grub.conf

Remove the smp kernel from the grub operating systems along with the hiddenmenu
setting, and then reboot.


7 - OpenBSD Boot Sector

Boot into OpenBSD. Now we will mount the FAT32 partition that was created when
installing Fedora. Type the following.

# disklabel wd0

This shows that g is the last OpenBSD partition because i is NTFS.

# disklabel -d wd0

This shows the unknown and other partition types including MSDOS partitions.
The m partition is the FAT32 (MSDOS) partition created in Fedora. Write down
the size and offset for the m partition, then type the following to add the
partition to that OpenBSD will be able to read it.

# disklabel -e wd0

Type the following entry under the g partition. Remember g was the last OpenBSD
partition. I've included what I typed in.

  h: 12530637 65609523     MSDOS

Now you can run disklabel wd0 and you will see that now OpenBSD recognizes the
FAT32 partition. Add the following line to /etc/fstab. This will allow you
to mount the FAT32 partition.

  /dev/wd0h /share msdos rw

The following commands will mount the FAT32 partition now.

# mkdir /share
# mount -t msdos /dev/wd0h /share

Type the following command as root to make a copy of the OpenBSD boot sector.

# dd if=/dev/rwd0a of=/share/obsd.boot bs=512 count=1

Now reboot.


8 - FreeBSD Boot Sector

Boot into FreeBSD. Add the following line to /etc/fstab. This will allow you
to have mount the FAT32 partition that was created when installing Fedora.

  /dev/ad2s7     /share     msdosfs     rw     0     0

The following commands will mount the FAT32 partition now.

# mkdir /share
# mount -t msdos /dev/ad2s7 /share

Type the following command as root to make a copy of the FreeBSD boot sector.

# dd if=/boot/boot1 of=/share/fbsd.boot bs=512 count=1

Now reboot.


9 - Fedora Boot Sector

Boot into Fedora. Type the following command as root to make a copy of the
Fedora boot sector.

# dd if=/dev/hdc5 of=/share/fedora.boot bs=512 count=1

Now reboot.


10 - NT Boot Loader Configuration

Boot into Windows XP. Copy obsd.boot, fbsd.boot and fedora.boot into C:\. Edit
C:\boot.ini to look like the following.

  [boot loader]
  timeout=10
  default=C:\fbsd.boot
  [operating systems]
  C:\fedora.boot="Fedora Core 3"
  C:\fbsd.boot="FreeBSD 5.3"
  C:\obsd.boot="OpenBSD 3.6"
  multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

Now reboot.


11 - Fedora Boot Loader Configuration

Boot into Fedora. Change to root and edit /boot/grub/grub.conf to have only
the Fedora operating system, and have the timeout set to 0. Now reboot.


12 - Windows XP Master Boot Record

Boot from a Windows 98 Boot Disk and run fdisk. Make partition 1 (Windows XP)
active. Exit fdisk and reboot. Now, boot off the Windows XP Professional CD.
Press R to get to a recovery console. Type the following.

> fixmbr

Answer yes. Now reboot. You can now choose whatever operating system you want
to boot into using the NT Boot Loader.


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2024.