Restoring GRUB Boot-Loader After Windows Reinstallation.

Share Tweet 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 [...]

bootusb 150x150 Restoring GRUB Boot Loader After Windows Reinstallation.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 :



Subscribe / Share

Article by rajkumar

Rajkumar is an Electronics and Telecommunication Engineer by education and an Embedded Software Developer by profession, A Researcher, Freelance FOSS enthusiast and A Tech lover by passion. He loves research, innovations and so involves himself in multimedia codec development and optimization. His other interests includes a wide range of things like Classical and Modern Physics, Cosmology, Linux, FOSS, Embedded Multimedia, signal processing etc. He writes at www.cvoid.com rajkumar tagged this post with: , , , , , , , , , Read 5 articles by rajkumar
3 Comments Post a Comment
  1. alienuv says:

    nice article …really helpful…

  2. Mohi says:

    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 usageMy ComLuv Profile

Leave a Reply




CommentLuv Enabled

More in Linux,Ubuntu (11 of 11 articles)