Recovery of grub after re-installing window

For the recovery of grub follow the following steps :

  •  Boot your system using Ubuntu Live CD.
  •  Now using the terminal check the version of grub. In terminal type :

grub-install -v

  • Grub2 should display a version number of 1.96 or later.If you don’t have Grub2 installed,you can install it. In terminal type :

 sudo apt-get install grub

  • Now go to Places and mount your Ubuntu partition.Then Go to boot/grub directory and check for the existence of the file grub.cfg.
  • Now switch the terminal.
  • If you mounted the right partition then verify by typing :

mount | tail -1 

  • To make sure this is indeed the Ubuntu boot partition, type in terminal :

ls /media/0d104aff-ec8c-44c8-b811-92b993823444

  • Replace ‘0d104aff-ec8c-44c8-b811-92b993823444’ with your UUID which you found earlier.
  • The output should be something like this :

config-2.6.18-3-686  initrd.img-2.6.18-3-686.bak   System.map-2.6.18-3-686
 grub                 lost+found                          vmlinuz-2.6.18-3-686
 initrd.img-2.6.18-3-686     memtest86+.bin

  • Now we just need to reinstall GRUB by specifying the correct directory and the correct drive name.Type in the terminal :

sudo grub-install –root-directory=/media/0d104aff-ec8c-44c8- b811-92b993823444 /dev/sda

  • If all went well, you should see something like this :

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install’.

(hd0) /dev/sda 

  • Reboot.Now Grub should be installed and both Ubuntu and Windows should have been automatically detected and listed in the menu.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment