Friday, June 5, 2009

Restore Linux Grub

Hi all,

Did you install Windows after installing Linux? Are you unable to get the Linux boot menu? Then, this post is for you.

When you install Windows, it overwrites the Linux grub with that of Windows. Hence, when you start the system, it will directly boot Windows, where you had options to boot Linux or windows. In order to restore Linux grub, you should follow the procedure given below:
  • Insert any linux live cd and boot from it.
  • Go to terminal, type 'sudo grub' (or just 'grub' if you are in root terminal).
  • Then type 'find /boot/grub/stage1'. This should retrieve your linux partition info. (It should be like (hdx,y)).
  • Then type 'root (hdx,y)' (Replace x, y with values you get).
  • Type 'setup (hdx)'. This will give a successful message if grub is restored.
  • Then 'quit' and 'reboot'.
You can enjoy both Linux and Windows as before :)

I consider this as my best discovery in Linux commands because I have used this no. of times. It is very useful and simple method to restore grub.

You can also use 'Restore Grub' image to restore both Windows or Linux grub.

No comments:

Post a Comment