md   :multiboot  services   résumé   portfolio   pursuits   contact 

Installing Linux and Windows XP Together

After successfully installing Windows XP Pro and FreeBSD together on the same physical drive, and then doing the same thing with Red Hat Linux, I decided to record these notes. Dual (or multiple OS) booting is possible, but you have to get the sequence just right or you can be left with an invalid partition map (an unbootable drive with no access to either operating system), lost time and data.

(By the way, here's how to do this with FreeBSD.)

I wanted both operating systems on the drive, selectable via the standard Windows XP boot menu. I scanned the web and found a few pointers, but nothing straightforward for Windows XP. What hints there were had you using attrib to modify flags on the Windows XP boot.ini, etc. It was all quite unnecessary.

After my exploration, I came up with the following simplified recipe. No special software is needed other than the operating systems. Have two blank floppy disks ready to use, then 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 Linux. 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. Note that if you install Linux on a completely different drive, the steps outlined here will still work -- adjust accordingly.

  1. Boot the Windows XP Pro installation CD
  2. Create a primary partition for Windows (C:)
  3. Create a second partition for Linux (D:)
  4. Format and install XP on the primary partition (C:)
  5. Boot into Windows XP
  6. Open the Computer Management administrative tool
  7. Click Disk Management
  8. Delete the secondary partition (D:)
  9. Format a DOS floppy disk. (This will be used only once to copy your Linux boot sector back over to Windows.)
   Install Linux
  1. Boot the Linux installation media
  2. Choose to install it on the second, unused partition (aka D:)
  3. When asked, choose GRUB as the boot loader
  4. Install GRUB on the first sector of the /boot partition
    Important: If you tell it to install on the drive's master boot record (MBR) you wipe out Windows XP's boot selector. Not what you want.
  5. Allow Linux to create a boot disk from your second floppy disk
  6. After completing the installation, reboot using the boot floppy
  7. Login as root and get to a shell
  8. Use df to see which filesystem device holds /boot (e.g. /dev/hdc1)
  9. Insert the DOS floppy disk and enter:
    mount -t msdos /dev/fd0 /mnt/floppy
  10. Substituting your /boot device, enter:
    dd if=/dev/hdc1 of=/mnt/floppy/linux.bin bs=512 count=1
  11. Remove the floppy and reboot to Windows
   Set up the Windows boot menu
  1. Boot into Windows XP if you're not already there
  2. Insert the DOS floppy disk
  3. Copy the LINUX.BIN file from A:\ to C:\
  4. Open the System Properties window
  5. Click the Advanced tab
  6. Under Startup and Recovery, click Settings
  7. Click Edit to open the boot.ini file in Notepad
  8. Add this line to the end of the file and save:
    C:\LINUX.BIN="Linux"
  9. Close the Startup and Recovery settings, open it again, and Linux should now appear in the Default operating system drop-down menu.
  10. Reboot and test it out
After rebooting, it should bring up the Windows XP boot menu with your two options. When you choose Linux, the GRUB boot loader will appear for a few seconds before launching Linux (or press Enter to load it immediately).




  COPYRIGHT © MORGAN DAVIS