2

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?

1
  • Use the auto-configuration tool grub-mkconfig
    – user341751
    Jul 6, 2014 at 23:27

2 Answers 2

4

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.

3
  • Where do I enter this code ? Mar 16, 2012 at 8:57
  • This is located in "/boot/grub/grub.conf" Some distributions use a different name for it. So if that does not exist already, then it is most likely "/boot/grub/menu.lst"
    – Travis
    Mar 16, 2012 at 9:50
  • For people who have Windows on sdb, you need to use hd1 instead of hd0. Similarly, sdc = hd2, sdd = hd3, etc.
    – crypdick
    Nov 29, 2016 at 7:10
-1

Try this:

title Find and load NTLDR of Windows NT/2K/XP
fallback 1
find --set-root --ignore-floppies --ignore-cd /ntldr
map () (hd0)
map (hd0) ()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr
chainloader /ntldr
1
  • I must admit, I'm not very linux-savvy, but this answer is mostly useless in its current form. How should I try this? Where should I try this? And the worst thing is, that this actually seems to be the better answer! Jul 17, 2016 at 14:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .