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
- 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
- Open terminal by pressing CTRL+ALT+T.
- Type
sudo suto get super user privileges. - Mount the linux system partition to /mnt by entering the following command.
mount /dev/sda1 /mnt. - Install grub to the partition by typing
grub-install --root-directory=/mnt /dev/sda - If all went well you will get a message informing you that grub installed without an error.
Step 5: Reboot
- Reboot the system and remove the external boot media
you used. - If all went well the system will load grub having ubuntu linux as the operating system.
- Just to make sure the boot entries are okay, boot to the linux system and open terminal.
- Type
sudo update-grub2to update the grub entries with the MS Windows OS entries as well. - You should now have both operating systems.
Thank you man, Keep up