GRUB2 Issues With Ubuntu 12.04 Installation

This is by far the weirdest Ubuntu install I have had so far in my more than 2+ years of using the said Linux distro. You see, I started using Ubuntu with version 10.04 Lucid Lynx. It’s not that I’ve not had my share of experiences with weird Linux installs and failed Linux installs. On the contrary I have experienced a lot of that, but not with Ubuntu…  until now.

So what happened?

In a nutshell this is what I did:

1) On my Acer 4750 notebook, I had Windows 7 give up as much as space as it will allow with the 600+GB disk it was sitting on. It gave me about 200+GB of unused space after shrinking.
2) I rebooted and proceeded to install Ubuntu using a LiveCD (actually it’s a USB using UNetbootin application).
3) As I’ve done countless times, I selected GRUB to be installed on the disk MBR.
4) Waited for the install to finish, rebooted, and removed the USB thumb drive. Went out to get a can of soda.
5) When I came back, I was greeted with the Windows 7 login screen.

Shocked! This was the first time in my countless Ubuntu installs that it ever failed to write correctly to the MBR. What made it even worse was that the Wifi, despite having entered the correct password, was not working during the Live session install. I had to reboot to Windows to look for solutions to my case.

Just to be sure, I redid the whole install process (which only takes a few minutes granting you turn off the Internet connection during the installation). Still no luck. Without GRUB on the MBR, there was no way I could boot into Ubuntu unless I let Windows do the loading.

Supposedly this can be done by following the steps at this page – Using Windows 7 Boot-loader. Yes it is for ArchLinux, but the steps should work on most Linux distro. However, I have not had much luck with this alternative. It didn’t work when I tried it and I was left staring at a blank screen with a blinking cursor at the upper left side of the screen. Of course before I followed the instructions on that page, I first reinstalled Ubuntu and placed GRUB on /dev/sda5.

Another way to edit Windows 7 boot loader and add entries for Ubuntu is by using EasyBCD. It is a Windows application. Search for it on Google.

After trying the solutions above I was still left with an unbootable Ubuntu install. I knew I had to find a way to get GRUB to manage the whole disk. So I had to resort to re-installing GRUB which should have been the first thing that I should have done. An officemate of mine who is an ArchLinux user did suggest the above. Using the same Ubuntu Live CD, we can fix GRUB with a few easy steps.

But first, let’s take a look at how my disk looks like after the Ubuntu installation.

1) /dev/sda1 is a hidden partition (recovery files)
2) /dev/sda2 Windows 7 boot loader partition
3) /dev/sda3 Windows 7 partition – C:
4) /dev/sda5 Ubuntu
5) /dev/sda6 swap

To re-install GRUB, follow the 3 simple steps below on Gnome Terminal:

1) Know what partition your Ubuntu is installed using fdisk.

sudo fdisk -l

The above command will result in something like below,

Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    30722047    15360000   27  Hidden NTFS WinRE
/dev/sda2   *    30722048    30926847      102400    7  HPFS/NTFS/exFAT
/dev/sda3        30926848   682250927   325662040    7  HPFS/NTFS/exFAT
/dev/sda4       682252286  1250263039   284005377    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/sda5       682252288  1242263551   280005632   83  Linux
/dev/sda6      1242265600  1250263039     3998720   82  Linux swap / Solaris

2) Then mount that partition to an empty directory. In this example we’ll put it in /mnt and /dev/sda5 is my Ubuntu partition as indicated with the highlighted line above. It may not be the same for you so make sure you get the partition right.

sudo mount /dev/sda5 /mnt

3) Now issue the install command for GRUB.

sudo grub-install –root-directory=/mnt/ /dev/sda

Take note that /dev/sda is correct as we are targetting the disk where Ubuntu is installed and not the partition.

After doing the 3 steps above, reboot and you should have the GRUB menu greet you promptly in a few seconds.

Similar Posts: