Home » Questions » Computers [ Ask a new question ]

Install Windows XP after Linux FS Partioned Space

Install Windows XP after Linux FS Partioned Space

I'm trying to install Windows XP onto the 3rd primary partition of my hard drive. The layout is like so:

Asked by: Guest | Views: 347
Total answers/comments: 2
Guest [Entry]

"Contrary to other ""answers"" this is possible, and I have it working correctly. Here is how I did it. I used the following link for inspiration:

http://ubuntuforumsdotorg/showthread.php?t=1095893

The partition setup was the same from the question.
The Windows XP disk I had was an SP2 version, I did not try any other ones.
You will need a working Linux boot CD w/ grub. I used the standard Ubuntu Desktop Install CD.

In order to get the WinXP install CD to boot:

Start up your working Linux OS, or from booting the Linux boot media. FIRST BACKUP YOUR PARTIION INFO EXACTLY. WINDOWS INSTALL ERASED MINE. After backing-up your partition table, use fdisk or any other partition manager to set the Linxux partition types to '0' or ""none"". This will hide the partitions from the Windows Boot CD.

Write the new partition table and reboot.
If you have extra drives, now is a good time to disconnect them to avoid any confusing during the Windows install. Boot the Windows Install CD as you would normally. Install Windows onto the recognized NTFS partition. Make sure you do not re-partition the drive, or install on the ""unpartitioned space"". This is your Linux FS.
After the Windows install completes and tries to reboots, this is where you might run into problems. On my attempt, Windows re-wrote my partition table and removed all of the Linux partition entries (but did not change the geometry), therefore it was able to reboot into Windows and complete the setup. Either way, at some point you will need to correct your system to get your Linux partitions booting again.

When you are ready to go back into Linux, re-enable all your drives (if disabled) and boot with the Linux Media CD you have.
From the Linux terminal, correct the partition table on the disk by restoring/recreating it exactly from the backup.
Re-install grub back onto the MBR of your hard disk. This can be tricky, but this is how I did it on my system:

mount /dev/sda2 /mnt/root
mount -o bind /dev /mnt/root/dev
mount -o bind /proc /mnt/root/proc
chroot /mnt/root /bin/bash
mount /dev/sda1 /boot
grub-install /dev/sda

Update your grub boot menu to create an option for your Windows partition. Append the following to /boot/grub/menu.lst:

title Windows XP
rootnoverify (hd0,2)
chainloader +1
makeactive

Finally, you have to correct the boot.ini file in your Windows volume. You can mount the volume like so:

mkdir /winxp
mount /dev/sda3 /winxp -t ntfs
vi /winxp/boot.ini

Here is my working boot.ini file for reference:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(3)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS=""Microsoft Windows XP Professional"" /noexecute=optin /fastdetect

You will notice that you have to change the partition(N) to match your drive layout.
If you have followed all these steps, you should now be able to reboot your system, get to the Grub menu, and reboot into either Linux or Windows."
Guest [Entry]

Make sure in your bios that you have it set to boot the CD/DVD drive before any of the hard drives, it sounds like you have it set to boot the hard drive first.