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.
- Boot the Windows XP Pro installation CD
- Create a primary partition for Windows (C:)
- Create a second partition for Linux (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:)
- Format a DOS floppy disk. (This will be used only once to copy your Linux boot sector back over to Windows.)
Install Linux
- Boot the Linux installation media
- Choose to install it on the second, unused partition (aka D:)
- When asked, choose GRUB as the boot loader
- 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.
- Allow Linux to create a boot disk from your second floppy disk
- After completing the installation, reboot using the boot floppy
- Login as root and get to a shell
- Use df to see which filesystem device holds /boot (e.g. /dev/hdc1)
- Insert the DOS floppy disk and enter:
mount -t msdos /dev/fd0 /mnt/floppy
- Substituting your /boot device, enter:
dd if=/dev/hdc1 of=/mnt/floppy/linux.bin bs=512 count=1
- Remove the floppy and reboot to Windows
Set up the Windows boot menu
- Boot into Windows XP if you're not already there
- Insert the DOS floppy disk
- Copy the LINUX.BIN file from A:\ to C:\
- 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:\LINUX.BIN="Linux"
- Close the Startup and Recovery settings, open it again, and Linux should now appear in the Default operating system drop-down menu.
- 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).
|