When we have the Dual boot with Windows and Any other Linux Operating system, we may come across a situation to reinstall the OS of our machine. When you Re-install your Linux, It should be no problem as it can automatically map your windows back into her own Boot loader, let it be GRUB or LILO. But it’s not the same case with the Windows Re-installation with Linux parallel on the machine. Windows cant map your Linux partition into its boot loader, and hence we have to map it manually.
It is better to use the GRUB as the Boot loader commonly. Here follows the steps for Restoring the GRUB boot loader back after installing the Windows parallel with Linux in the machine.
Boot into a Live Session with any Ubuntu Live Disk.
Get into the Terminal, and run
sudo grub
Now the terminal will get into the GRUB prompt as following
grub>
First find the System Volume of our Linux installation. For this run the find command with the grub menu list directory to ensure the GRUB settings are still unaltered in the location.
find /boot/grub/stage1
Now it will be returning something as (hdX,Y), [ e.g. (hd0,0) ].
The X and Y will be a numerical value representing the Hard disk number and partition number of the Linux System Volume. From here onwards replace the upcoming X and Y with values that you got in this step.
Our next step is to restore the GRUB. To do that, enable the Root mode for the Linux System Volume access by
sudo root(hdX,Y)
Now run the setup command to restore the GRUB.
sudo setup(hdX)
Now Quit the Grub Prompt by quit command and reboot to get the GRUB with all OS in your Machine.
Article by Rajkumar, an engineering student doing research in DSP. He is an open source freak, especially UBUNTU. You can find him active and supporting in UbuntuForums.
Related Posts :
This article helps you to create a swap file in your Linux systems. This swap file helps you whe ...
In many situation's we come across a need to enable only a certain applications for the guest us ...
This tutorial demonstrates the installation of Windows Seven on a computer from scratch. After s ...
Windows 7 by default dont have telnet enabled. We have to enable it manually. Telnet is actually ...
Hi! Folks….hope you all had a great weekend and first of all I must say…, Oops I dn’t know wh ...










nice article …really helpful…
In grub2, There is another command that we must know for restoring grub. Goto terminal and do the following
1)Mount the partition containing the Ubuntu installation.
sudo mount /dev/sdXY /mnt
2) Run the grub-install command as described below
sudo grub-install –root-directory=/mnt/ /dev/sdX
This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device. Nice work Raj Kumar

Mohi recently posted..Operators and their usage
Twitter: _robinsonc
says:
How about writing it as another article mentioning it as GRUB 2 ???
That would be great .