How to restore GRUB in ubuntu after installing windows

So, you had Ubuntu  (or any of its derivative) installed on your system and then decided to install Windows with it? And after installing Windows, you can’t load Ubuntu again, just follow the steps to get this working:

  1. Boot the system using a Ubuntu Live disk.
  2. After you reach the desktop, open Terminal (press Alt+F2, type “gnome-terminal” without quotes and press enter).
  3. Execute:

    sudo fdisk -l

  4. Execute (after replacing sda7 with your corresponding linux root partition, which you will be able to identify from the output of the previous command – it’s usually marked as Linux):

    sudo mount /dev/sda7 /mnt

  5. Just check whether you got the root partition right, if you have more than 1 linux partition on your hard disk:

    cd /mnt
    ls

    If the listing contains names like bin, boot, dev, etc, home, tmp, usr, var, et cetera then you are in the right partition. If not, unmount this using:

    sudo umount /mnt

    and follow the above step again using another partition.

  6. Now:

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

    and grub will get installed if it shows no errors.

  7. As a last step unmount your /mnt directory using:

    sudo umount /mnt

    and restart the system. You will find the friendly grub boot manager giving you the choice to boot into Linux or Windows.

Advertisements

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