Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Needless to say I am fairly new to this. Here is the problem I have encountered. Was on Windows 7 and made a new partition for Ubuntu installation. After installing Ubuntu on the said partition I can only boot into Ubuntu, Windows was not an option until I manually added it in /boot/grub/grub.cfg using the following lines:

menuentry "Windows 7" { insmod part_msdos insmod ntfs set root='(hd0,msdos1)' chainloader +1 }

The option is now available but it won't boot (returns an error saying something about signatures).

I also tried the following code:

menuentry "Windows" { set root=(hd0,3) //Tried both, hd0,2 and hd0,3 chainloader +1 }

It returned an error saying BOOTMGR is missing..

Here is what fdisk -l returns:

Device Boot Start End Blocks Id System /dev/sda1 2048 52435641 26216797 83 Linux /dev/sda2 52436992 52641791 102400 82 Linux swap / Solaris /dev/sda3 * 52641792 200241151 73799680 7 HPFS/NTFS/exFAT /dev/sda4 200243198 242184191 20970497 f W95 Ext'd (LBA) /dev/sda5 200243200 242184191 20970496 7 HPFS/NTFS/exFAT r00t@admin-box:~$

SDA3 = Windows partition

PLEASE help I beg you!

share|improve this question
I have also tried adding : menuentry "Windows 7" { insmod part_msdos insmod ntfs set root='(hd0,msdos1)' chainloader +1 } in /etc/grub.d/custom_40 – me77ow Jul 7 '14 at 20:26

It is not advisable to edit the /boot/grub/grub.cfg file except for one off testing because this file is automatically generated by the update-grub script which is run when kernel packages get updated.

The first thing you should have tried, and the first thing to try now is

sudo update-grub

and check to see if this correctly detects your Windows 7 installation and adds the appropriate entry to the /boot/grub/grub.cfg

If for some reason that does not work, then the recommended solution is to create a custom file in /etc/grub.d which must specify all of the necessary details.

You can either add the entry to the already present 40_custom file or to make it obvious that you have your own file in the directory something like 40_windows7 If using your own name it must be numerically/alphabetically after 40_custom but before 41_custom.

Now as to what goes in that file, what you have shewn above looks partly correct, but you will need some other lines, most probably insmod ntfs

If that kernel module for the NTFS file system is not loaded, it would explain why grub cannot see the bootmgr file on the NTFS file system.

Take a look at Post #3 at

and also Post #16 at

for examples of the details needed.

Obviously you must correctly specify the correct hard disk and partition in your file for your Windows 7 installation.

You should also take a look at the other postings in the file as they may answer the issue of update-grub not finding Windows 7 if it in fact does not when you try that as the first thing to do stated above.

And when you have created that file, then run

sudo update-grub

and check the contents of the freshly generated /boot/grub/grub.cfg file.

The other file which affects the behavior of update-grub is located at


but its contents will not affect whether or not update-grub finds the Windows 7 partition so should not be changed for this issue.

share|improve this answer

Your Answer


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.