Restore Grub in Ubuntu After Windows Owned The Boot Drive

The guys who made Windows don’t like sharing stuff so its obvious that when you install any Windows OS after Ubuntu Linux or any other Linux flavor you have to loose the Grub loader to the Windows Boot Loader for Windows Xp or Windows 7.

This article explains how you could recover your Grub Loader after installing windows on  a system having Ubuntu linux.

Requirements Before Starting

  1. Ubuntu live boot cd or usb flash drive.If you don’t know how to create one go to the Ubuntu site and read the instruction.

Steps

Step 1:

Boot using your flash drive or boot disk.Your PC has to be set to boot from usb disk or cd/dvd drive respectively.This settings are in the bios.

Step 2 Select Try Ubuntu:

When Ubuntu boots to the desktop, select ‘Try Ubuntu’.

Step 3 Get the device holding the system partition:

Open the disk utility and check to see what the linux system partition is identified as  (i.e /dev/sda1 /dev/sda2 /dev/sda3 e.t.c).In this case my partition will be /dev/sda1 ; yours could be something else.

Step 4:Install Grub

  1. Open terminal by pressing CTRL+ALT+T.
  2. Type sudo su to get super user privileges.
  3. Mount the linux system partition to /mnt by entering the following command.
    mount /dev/sda1 /mnt.
  4. Install grub to the partition by typing
    grub-install  --root-directory=/mnt /dev/sda
  5. If all went well you will get a message informing you that grub installed without an error.

Step 5: Reboot

  1. Reboot the system and remove the external boot media
    you used.
  2. If all went well the system will load grub having ubuntu linux as the operating system.
  3. Just to make sure the boot entries are okay, boot to the linux system and open terminal.
  4. Type sudo update-grub2 to update the grub entries with the MS Windows OS entries as well.
  5. You should now have both operating systems.
About these ads

One thought on “Restore Grub in Ubuntu After Windows Owned The Boot Drive

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 )

Connecting to %s