How to add Windows 7 to Grub menu?

The following is the list that I got when I executed the command sudo fdisk -l:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbf4c6203

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13       13708   109998080    7  HPFS/NTFS
/dev/sda3           13708       35952   178676736    7  HPFS/NTFS
/dev/sda4           35952       60802   199606273    f  W95 Ext'd (LBA)
/dev/sda5           35952       58196   178676736    7  HPFS/NTFS
/dev/sda6           58196       58257      487424   82  Linux swap / Solaris
/dev/sda7           58257       60802    20440064   83  Linux

How can I add Windows 7 to my Grub menu?


Solution 1:

First, you will need to know which of the NTFS partitions (I'm assuming the W95 partition isn't Windows, but some external storage). You can test by mounting each and see what they contain. Generally you're looking for whatever contains Windows/ .

Once you know which partition that is (i.e., /dev/sda5), reduce that number by one. That number will be replaced with the "4" in "rootnoverify (hd0,4)"

Then enter this into /boot/grub/grub.conf [if that doesn't show up, /boot/grub/menu.lst]

title Windows
rootnoverify (hd0,4)
makeactive
chainloader +1

This "chainloads" to the Windows bootloader.