grubiconI had to re-install Windows on my partition and in the process it was obvious that I was going to lose my Grub. However, I knew I could very easily get it back. You can lose grub for various reasons and the most common being installing windows, which unfortunately doesn’t respect your settings and erases your grub. However, there’s nothing to panic in that case because restoring grub is no rocket science.

Let’s see how to restore grub on a machine which has Ubuntu:

1. Boot using a Live CD or pen drive of Ubuntu. You’ll be having a live session running.

2. Start a terminal Window by hitting ALT+F2 and typing gnome-terminal.

3. On the terminal window type the following command:

sudo grub

You’ll see the prompt changing in the terminal window.

4. At the grub prompt, type the following:

find /boot/grub/stage1

This should show you info about location

grublocation

5. As I got (hd0,5) in my case, following is what I am going to enter at the grub prompt:

root (hd0,5)

and hit enter

grubroot

6. Next we’ll install the grub at the mbr using the following command:

setup (hd0)

You’ll see the confirmation of installation of Grub.

grubinstall

7. Type quit to exit grub prompt. Close the terminal window and restart your computer.

You’ll have your grub restored.

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related posts:

  1. Install XAMPP-Linux Apache MySQL and PhP {LAMP} on Ubuntu: How-to
  2. How to get transparent matrix style terminal in Ubuntu (Jaunty jackalope): How-to
  3. How to open rar files in Ubuntu (Jaunty Jackalope): Install rar!
  4. Install Wine and run Windows applications on Ubuntu (Jaunty): How-to
  5. Installing latest Nvidia graphic drivers on Ubuntu (jaunty): How-to