Tuesday, October 26, 2010
8:40 PM

Ubuntu 10.04 does not add the windows entry to grub menu

If you installed the Ubuntu 10.04 over your windows and did not see the grub menu list the windows entry here is a work around.

First hold the shift key or press "esc" while booting to view the grub menu and make sure that windows is not listed as some times the grub screen might move too fast to even view what is listed.

If windows is not listed then boot into the ubutnu.
Open a terminal and type
       sudo fdisk -l
It should output something like

  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        6375    51097600    7  HPFS/NTFS
/dev/sda3            6375       12749    51200000    7  HPFS/NTFS
/dev/sda4           12749       19458    53888001    5  Extended
/dev/sda5           12749       19070    50777088   83  Linux
/dev/sda6           19071       19458     3109888   82  Linux swap / Solaris

The entries that have HPFS/NTFS  in the system column are your windows entries.
You can access these drives by clicking on "Places" on the top menubar and the then on the partition you want to mount.

You can download the bootinfo script from

http://sourceforge.net/projects/bootinfoscript/files/bootinfoscript/0.55/boot_info_script055.sh/download?use_mirror=biznetnetworks

Run this script and look at the output, it would tell you in which /dev/sdaX is the windows bootmgr installed. Note that number X down.

In the command prompt type
       gksudo gedit /etc/grub.d/40_custom
This should open a text editor with a few lines of text in it.  At the end of this file add the following lines


 menuentry "Windows" {
root='(hd0,X)   {replace X by the number we found above}
        chainloader +1
}

Save the file by clicking on save option on the top and close the file.

Now run the following command on the terminal
   sudo update-grub

Once the command runs successfully restart your system.
Hold the shift key or press "esc" while the system boots to view the grub menu.
You should see windows listed in the options now.
Move the cursor to windows and press "enter" to boot windows.

If you see the erroe "BOOT MGR MISSING" then press cntrl+alt+delte and come to grub menu again.
Move the cursor to windows option and press "e".
you should see a line that has "root='(hd0,1)'" that we entered previously.
Now press "c" which will take you to "grub>" prompt.

At the "grub>" prompt type "ls"
It will list out all the disks that grub is able to recognize for eg.
(hd0) (hd0,1) )(hd0,2) etc...

Type
ls (hd0,1)
and see what the output is, if it does not display as a NTFS  partition or displays the name of your other disks for eg: one of you other windows drives.
try out
ls (hd0,2)
and similarly for all the hard disks present and figure out which ones are your windows drives.
Now type exit which will take you back tou your grub menu.
Again go to windows option press "e"
and change the root=(hd0,X) to which ever new number you have found and press cntrl+X to boot.
This should boot your windows.

Hope this helps.

0 comments:

Post a Comment