Skip navigation.
Home
Write anything I want to write...

Restore Grub Boot Loader in Ubuntu

Sometimes, especially if you have just installed Windows operating system alongside with your Ubuntu, your precious Grub boot loader will be wiped out from the MBR (Master Boot Record) from your hard disk. How do you restore it?

The steps here have been tested with Ubuntu 9.10.

  1. Boot into the Ubuntu Live CD or USB stick.
  2. Open a terminal with 'Accessories' -> 'Terminal'.
  3. Find out the partition that correspond to your root /. If you have a separate partition for /boot, find it out too. The command sudo fdisk -l may help. Here we assume that the partitions are /dev/sda1 and /dev/sda2 (if any) respectively.
  4. Now mount your root partition with sudo mount /dev/sda1 /mnt. If you have a separate partition for /boot, mount it too with sudo mount /dev/sda2 /mnt.
  5. Restore Grub with sudo grub-install --root-directory=/mnt /dev/sda. (Assume that you want to install Grub to the MBR of /dev/sda.)

Reboot your computer and it should work fine now.