1

Possible Duplicate:
How can I repair grub? (How to get Ubuntu back after installing Windows?)

How To Repair GRUB2 In A System With Broken Recovery Mode

1 Answers1

2

I've solve it this is the way how todo(same boot partition):
Boot into the Ubuntu 12.04 Live CD and click "Try Ubuntu without installing": enter image description here After the desktop is loaded, we need to mount the root partition so that we grant the live cd user read/write permissions on your system files and folders. Let's first identify the partition where Ubuntu is installed with this command:

sudo fdisk -l

Note: The Terminal can be started by pressing CTRL+ALT+T.

The Ubuntu partition we will work on will be labeled with the word "Linux" as shown in the screenshot given below:

enter image description here Run now this sequence of commands to mount the root partition:

sudo mkdir -p /media/ubuntu

sudo mount /dev/sda1 /media/ubuntu

Then you need to mount these system folders to use them on your current desktop environment:

sudo mount --bind /dev /media/ubuntu/dev

sudo mount --bind /proc /media/ubuntu/proc

sudo mount --bind /sys /media/ubuntu/sys

Now chroot into your hard drive with this command:

sudo chroot /media/ubuntu

You have now read/write permissions on your root partition. To install GRUB2, you need to use one of these two commands:

grub-install /dev/sda

or

grub-install --root-directory=/media/ubuntu /dev/sda

Note: the "sudo" is not required since you are logged in as root now. Also keep /dev/sda as is.

If the installation is successful, you will get these outputs:

root@ubuntu:/# grub-install /dev/sda

Installation finished. No error reported.

Update GRUB2 with this command:

update-grub

Now Remove the Ubuntu installation CD and reboot your system to see if the GRUB2 boot menu is restored or not.

  • 1
    +1 from me for the neat answer. It will be better if you can elobarate your answer. Suppose if the user has a seperate boot partition, the method which you have shared wont work. Clarify the same in your answer.. – karthick87 Sep 24 '12 at 06:34