Tuesday, May 31, 2011

Ubuntu Recovering Boot menu after installing Windows

For Ubuntu 9.10 or later:
If you have installed windows OS after installing ubuntu  and windows has deleted the mbr(Master Boot Record)  you can't see the ubuntu at your boot menu, Try this solution.

Boot  from a Ubuntu CD and select Try Ubuntu

First Step:  Just checking the Hard Disk


Open a Terminal,Type in:


sudo fdisk -l


If you are Using only one Hard Disk,  Your Boot record will be in that disk But if you are using two or more and mark the Hard Disk that you have selected to boot first from your Bios Settings.
If you are using one HD your device is - /dev/sda

we will continue assuming your device id is /dev/sda .

Second Step:
Now You have to mount the drive that your Ubuntu was installed previously.
Mount the drive By selecting it from the 'places' menu. It has been mounted at your /media folder(Live CD)
Check the folder name and copy the folder name. You can do it also By dragging any file/folder from the mounted drive.

Now at Terminal:

grub-install is suggested now rather than grub-setup

Try this first:

sudo grub-install --boot-directory=/media/FolderName/boot /dev/sda



Or try this:
sudo grub-setup -d /media/FolderName/boot/grub /dev/sda

Replace The 'FolderName' with the Folder you have found at your /media folder.

Third Step:


Restart Your machine and the boot menu should be there but you will be missing the windows boot menu entry there . So after logging in Open a Terminal and Type:


sudo update-grub

It's Done! It'll show you a message if it finds a boot record for the windows.

If you get any error you check the following link.


There is a detailed description  at http://help.ubuntu.com/community/Grub2

No comments:

Post a Comment

About Me

Web Developer From Dhaka, Bangladesh.