How to Restore Grub 2 As The Main Bootloader

For those who are having a dual (triple or quad) boot system in your computer, chances are, your bootloader might break when you update one OS to a newer version. If you are using Ubuntu (with the new Grub 2 bootloader) and you installed Windows. The Windows bootloader will erase your Grub 2 and you won’t be able to boot in your Ubuntu. As such, you will need to restore your bootloader to Grub 2.

Requirement: Ubuntu LiveCD (download it from

Start your computer and boot into your Ubuntu LiveCD.

The first thing that we need to do is to mount your existing Ubuntu partition. If you already know your partition number (of the form “sda1”, “sdb2” etc), you can easily mount using the following command:

sudo mount /dev/sda1 /mnt    #replace sda1 with your partition number

If however, you have completely no idea of your partition number, launch GParted (System -> Administration -> gParted). Locate your Ubuntu partition and record down the partition number.


If you are are using different partitions for the “root” and the “home” folder, make sure you record the root partition instead of the home.

Close the GParted. Open a terminal and type in the following command:

sudo mount /dev/sda1 /mnt    #replace sda1 with your root partition number

Next, all you need to do is to reinstall Grub 2 with the following command:

sudo grub-install --root-directory=/mnt/ /dev/sdX  
#replace the X in sdX with your partition alphabet


You should be able to boot into your Ubuntu now.

Run the following to update your Grub 2 to include the bootloader of Windows (or other OS).

sudo update-grub

You should be able to boot into your Ubuntu and Windows (or other OS) now.


Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox