Thursday, June 23, 2011

GRUB 2 Recovery in Debian Linux

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

No comments:

Post a Comment

JMeter JSON Extractor

      json response {"Key1":"Value1","Key2":"Value2","Key2":"Value2"}  Name of t...