Reinstall Grub on Ubuntu 11.04

Almost immediately after upgrading to Ubuntu 11.04 the Windows partition wiped out the Grub2 boot loader. Reinstalling Grub2 is trivial, unless you make the unfortunate choice of upgrading to Ubuntu 11.04, in that case you will run-up against error: cannot stat `aufs'.

It took me days of head scratching until I finally found Odzangba’s work-around:

1. Locate the hard drive partition containing your Ubuntu instillation:

sudo fdisk -l
Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           1        5120   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2   *           1        3505    28140544    7  HPFS/NTFS
/dev/sda3            3505        9605    49003520   83  Linux
/dev/sda4            9605        9730      999425    5  Extended
/dev/sda5            9605        9730      999424   82  Linux swap / Solaris

My Ubuntu partition is /dev/sda3.

2. Mount the Ubuntu partition:

sudo mount /dev/sda1 /mnt

3. Install the Grub2 boot loader on the same hard disk:

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

Note: this Grub2 is installed to the hard disk /dev/sda as opposed to the Ubuntu partition /dev/sda3.
4. Unmount the Ubuntu partition and restart the system:

sudo umount /dev/sda1 ; sudo reboot

Thanks odzangba 🙂

Advertisements
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

One Response to Reinstall Grub on Ubuntu 11.04

  1. Saddy says:

    Thanks bro it works

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s