Grub_logo

Reinstalling GRUB and getting back your Operating Systems in Ubuntu

Installing a Microsoft Windows beside your Ubuntu, or maybe Upgrading your Ubuntu box to the latest version. Lots of reason and the same result, you can’t access your OSs.

The solution is almost always easy, it is just reinstalling your bootloader.

What is a bootloader:

- It is a small program that runs before any operating system is running, bootloaders are used to let you choose which operating system to boot in case you have more than one installed on your machine.

What is GRUB :

GRUB stands for : “GNU GRand Unified Bootloader) and it is a bootloader  package from the GNU project

Click to Enlarge

Click to Enlarge

For whatever a reason GRUB can fail and maybe loses its MBR file and then it doesn’t know where to get the OS from in the Harkdisk, this can happen maybe when you install Windows alongside Ubuntu, and it happened to me once when I upgraded my Ubuntu distribution to the latest edition. But for whatever reason, there is a solution and you can get your machine up and running again in less than 15 min.

- The Graphical way

Boot-Repair:

Click to Enlarge

Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can’t boot Ubuntu after installing Windows or another Linux distribution, or when you can’t boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.

Boot-Repair lets you fix these issues with a simple click, which (generally reinstalls GRUB and) restores access to the operating systems you had installed before the issue.

Getting Boot-Repair

1st Option: get a CD including Boot-Repair

The easiest way to use Boot-Repair is to burn one of the following disks and boot on it.

Remark : you can also install the ISO on a live-USB (eg via UnetBootinLiliUSB or MultiSystem).

2nd Option:  install Boot-Repair in Ubuntu

Obviously this will be done on a Live-CD or a Live-USB.

Open the Terminal (Ctrl + alt + T) and enter :

Note : Boot-Repair PPA packages are available for Ubuntu 10.04, 10.10, 11.04, 11.10 and 12.04.

Using Boot-Repair:

Recommended Repair

  • launch Boot-Repair from either :
    • the dash (Unity)
    • System->Administration->Boot-Repair menu (Gnome)
    • by typing ‘boot-repair’ in a terminal
  • Then try “Recommended repair” button. When repair is finished, note the URL that appeared on a paper, then reboot and check if you recovered access to your OSs.

If the repair did not succeed, indicate the URL to people who help you by email or forum.

Advanced Options

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

- The Terminal Way

Open the Terminal (Ctrl + alt + T) and type in :

Where XXX is the device of which your Ubuntu installation is on. (e.g: grub-install /dev/sda).

Note : You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:

This will give you something like :

You can also use fdisk if you do not see the /dev/disk/by-label:

 

 

From here, find only the drive name, ignore the partition number, that is, for partitions labeled “root”, “data2″, “fat”, “home” and “swap” it’s all still just sda. This is due to the fact that GRUB is installed in the MBR of the drive, and not on a partition.

  • Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

Hope this Helps .. If you have any Question please write in the Comments ..

Related Posts

6783300642_5c8d33e1e6_z

Installing RPM packages on a Debian Linux Distro (ex.Ubuntu)

linux

So where do Linux come from ?

Google-Chrome-vs-Chromium-Understanding-Stable-Beta-Dev-Releases-and-Version-No-2

Using Google Chrome “PDF viewer” in Chromium

  • http://www.facebook.com/profile.php?id=649850667 Mohammed Yahya

    Hello George,
    Thanks for the article, it was really helpful.
    May i suggest that you add EasyBCD as a third option ? (for people who know how to work from the windows side) and as an added benefit it was written by a Jordanian guy!