Sunday 3 July 2011

Reinstalling GRUB2 (Ubuntu 11.04)

First, find out where Ubuntu is installed on your hard disk...
sudo fdisk -l
You should see something like....
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 7 NTFS
/dev/sda2 2612 60279 463218210 83 Linux
/dev/sda3 60280 60801 4192965 5 Extended
My Ubuntu partition is /dev/sda2. The partition now needs mounting...
sudo mount /dev/sda2 /mnt
To install the GRUB2 boot loader, type...
sudo grub-install --root-directory=/mnt /dev/sda
Note, that's /dev/sda (The hard disk itself) NOT The Ubuntu partition /dev/sda2. Once completed unmount the partition and reboot...
sudo umount /dev/sda1 ; sudo reboot
NB -- If you have more than one OS installed, re-detect your various Operating Systems with...
sudo update-grub
 ** Do this before unmounting the partition.