HOME
FORUM
LINKS
CHAPTER INDEX
   

    How Do I install Linux on one hard drive, and use Windows on another?


    The situation is this: You have two drives. One has been running Linux on it, and the other, you wish to run Windows upon, for booting back and perhaps playing the occasional game in real Windows.
    How did I do it? Here it is:
    I have SATA as my primary Linux drive, so it sits on a completely different interface than the drive I used to test this, which was an IDE drive. Regardless, this scenario should work just fine on an IDE only setup (assuming you can put one drive on IDE channel 1, and one drive on IDE channel 2 (not master/slave, two seperate masters).
    First off, I have Linux working away just fine on my main drive.
    Next, I remove that drive from the PC completely, so that the computer would not know anything about it.

    Next, I attach a blank IDE drive to my IDE connector and install Windows in a completely normal fashion. Again, make sure that if you have an IDE only setup, install this drive on the secondary IDE channel, not the same one as the Linux drive.
    Once Windows is set up on the drive, install your Linux drive back in. The PC should now boot into Linux as before.

    Now, edit your bootloader file (grub) by editing the /boot/grub/menu.lst file as root:
      $sudo gedit /boot/grub/menu.lst
    go to the bottom of the file, and add an entry for Windows there. Here is what the end of my menu.lst looks like:
      ### END DEBIAN AUTOMAGIC KERNELS LIST
      title Windows 2000
      map (hd0) (hd1)
      map (hd1) (hd0)
      root (hd1,0)
      chainloader +1

    finally, edit, near the top of the file the part that says :
      hiddenmenu
    put a # infront of it, to comment it out.
    Save the file and reboot your PC, you should now see Windows 2000/XP in your boot menu, along with Linux.
    The various options covered perform the following tasks:
      map (hd0) (hd1)
      map (hd1) (hd0)
    This part is the weird one: This makes the drives swap around for my SATA setup. For example, it makes the SATA drive (hd0) become the second drive in the system (hd1), by a bit of trickery. It also reverses (hd1), the second drive (windows), into being the primary drive on the system. If you don't have a SATA/IDE setup like this, you may not need this, so if it gives you problems, try removing these two lines.
      root (hd1,0)
    This line tells grub what partition to boot
      chainloader +1
    This line is necessary to boot a Windows system, it passes grubs boot handling sequence down to the Windows bootloader.

    This Hot Topic was last tested on: Ubuntu 5.10 /Windows XP


    HOME | LINKS | CHAPTER INDEX | FORUM This site is hosted on Linux servers, by the XBOLT.network