Search This Blog

Monday, December 27, 2010

Grub2 recovery




Grub 2 Recovery:-
Boot from live CD or DVD which support grub2.(BOSS 4 DVD or Ubuntu 9.10 CD or above. DVD will take more time than CD thats why I suggest to boot from CD).
Open terminal.Run fdisk -l to check the partition from which you want to recover grub 2.
Here I assume that you want to recover it form /dev/sda1.
Then run the following commands:-
$sudo mkdir /media/sda1
$sudo mount /dev/sda1 /media/sda1
$sudo mount --bind /dev /media/sda1/dev
$sudo mount --bind /proc /media/sda1/proc

Then chroot into that partition by
$sudo chroot /media/sda1

Then re-install the grub by

#grub-install /dev/sda
The output should be like this:-
Installation finished. No error reported.

If you get error then try
#grub-install --recheck /dev/sda

After successful installation exit from chroot unmount the file systems you mounted and reboot.
#exit
$sudo umount /media/sda1/proc
$sudo umount /media/sda1/dev
$sudo umount /media/sda1
$sudo reboot


Source

http://my.opera.com/seanawake/blog/2010/02/09/grub-2-recovery-with-ubuntu-live-cd-2


No comments:

Post a Comment