OS Revolution

Living in a matrix

How to boot Linux after Windows XP installation Part 2

A couple of weeks ago, John Doe wrote a tutorial about how to make Linux work after you've installed Windows XP, which, of course, has made your Linux primary partition inactive.

Well, let's say you try a different solution, like I did, the one found here (Recovering GRUB after reinstalling Windows section). Everything was fine and dandy, except I couldn't boot Windows after that. What was the problem? I'm a noob, so of course I didn't know. Luckly, there is #ubuntu, with some very helpful people. They helped solve the problem, so I figured I'd share the solution.

First of all, I opened the terminal and typed:

sudo fdisk -l

I got:


Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0a1b0a1b

Device Boot Start End Blocks Id System
/dev/sda1 1 1216 9767488+ 83 Linux
/dev/sda2 * 1217 2432 9767520 7 HPFS/NTFS
/dev/sda3 2433 9729 58613152+ 5 Extended
/dev/sda5 2433 2554 979933+ 82 Linux swap / Solaris
/dev/sda6 2555 9729 57633156 83 Linux

Disk /dev/sdb: 2090 MB, 2090336256 bytes
8 heads, 32 sectors/track, 15948 cylinders
Units = cylinders of 256 * 512 = 131072 bytes
Disk identifier: 0x6756c86c

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 15948 2041328 b W95 FAT32

As you can see, my Linux partition is /dev/sda1 and my Windows partition is /dev/sda2.
Next, I opened menu.lst with the following command:
gksu gedit /boot/grub/menu.lst

A window appeared asking for my administrator password, and then the text editor opened the file.
In there, I had to look for the following section:

# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1

I have to explain now what's with (hd0,0), because it's essential for solving the problem. The first number between the brackets designates the hard drive. The count starts at 0, so 0 refers to the first hard drive, 1 to the second hard drive and so on. The second number designates the partition, and the counting procedure is the same. In my case, (hd0,0) meant that my designated Windows root partition was the first partition, which was wrong. I have Linux on my first partition (/dev/sda1), and Windows on the second (/dev/sda2). So, the correct notation is:


title Windows 95/98/NT/2000
root (hd0,1)
makeactive
chainloader +1

By the way, you can see that there are no more # in front of the lines. The lines have to be uncommented (without #) in order for the whole thing to work.
After that I saved the file, rebooted the computer, and, voilà!, Windows appeared in my GRUB menu.

Author: Lucas

Who's online

There are currently 0 users and 1 guest online.