Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Part 1,   100 MB, Linux EXT2, /boot
Part 2,   280 GB, Linux Raid, /root
Part 3,   40 GB, Windows NTFS

I can't get the Windows install CD to boot unless I set the Part1 and Part2 types to '0'. Is there anyway around this? I would like a solution where I do not have to change the 1st or 2nd partitions. Where can I go from here?

If I install Windows to the 3rd partition, and then switch the Part1 and Part2 types back to correct values, will Windows be able to boot off of the 3rd partition?

share|improve this question
1  
What do you mean, that you can't get it to boot? Are you booting on cd, in bios options? –  Gnoupi Nov 9 '09 at 8:27
    
Yes, BIOS is set to boot from the CD, however if the partition type is not '0', then the CD hangs at a black screen a few seconds after loading. –  Casey Nov 11 '09 at 19:26

3 Answers 3

I am afraid that Windows wants first partition for it's boot files. You must have it formatted as MS-DOS.

share|improve this answer
    
This is wrong, see my answer which explains how to do it. –  Casey Nov 22 '09 at 4:51
up vote 0 down vote accepted

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://ubuntuforums.org/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.


  1. 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.

  2. 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.

  3. 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.

  4. From the Linux terminal, correct the partition table on the disk by restoring/recreating it exactly from the backup.

  5. 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
    
  6. 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
    
  7. 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.

  8. 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.

share|improve this answer

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.

share|improve this answer
    
Obviously it is set to boot the CD, because it works when the partition type is set to '0'. See the original question. –  Casey Nov 11 '09 at 19:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.