BleepingComputer.com: How to re-install Grub bootloader after Windows re-install on a dual-boot system

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to re-install Grub bootloader after Windows re-install on a dual-boot system Rate Topic: ***** 1 Votes

#1 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 26 July 2009 - 07:46 PM

How to add Grub bootloader after Windows re-install on a dual-boot system

Guide Overview :
You have a dual boot system with Windows and Linux both on separate partitions. You decide to format the Windows partition and re-install Windows after a malware attack or just because Windows got too much cluttered. The Windows setup re-writes the MBR of primary partition so after re-installing Windows, you no longer have Grub loader and you can no longer boot into Linux. This guide tells you how to re-install Grub bootloader after reinstalling Windows on a dual boot system.

Requirements :
A bootable Linux live CD. For example, a Ubuntu CD. http://www.ubuntu.com/GetUbuntu/download

Instructions :
  • Boot from the Live Linux CD.

  • Choose an option that says something like "Try Linux without installing".

  • After Linux desktop environment (like Gnome or KDE) is finished loading, open a Terminal window.
    Under Gnome, open Terminal through, Applications menu -> Accessories -> Terminal.
    Under KDE, open Terminal through, KMenu -> System -> Terminal Program (Konsole).

  • In the terminal, type sudo grub.

  • Next type, find /boot/grub/stage1 and press Enter. The output may look like hd0, 6

  • Type root (hd0, 6). Note that we have to use whatever output we get from previous command. If you get hd0, 2, then type root (hd0, 2)

  • Type setup (hd0) (again replace hd0 with the output of the find command) and press Enter. next type quit and press Enter to exit grub.

  • Thats it, Grub bootloader is loaded again in MBR. Restart your computer.

This post has been edited by Amazing Andrew: 29 July 2009 - 12:08 PM
Reason for edit: Added parenthetical, just to be safe :) - AA


#2 User is offline   kokopeli 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 1
  • Joined: 24-October 10
  • Gender:Male
  • Location:Rochester, NY, USA

Posted 28 October 2010 - 01:31 PM

Thanks a lot.
How many times I have reinstalled Ubuntu just to fix up GRUB after a Windoz install.
I hope this works with multiple hard drives - I don't see why not.
I made a copy of the procedure and put it on my server - I will certainly use it often.

Walt

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users