Windows reinstall messes up grub.
Wednesday, 19. April 2006, 09:12:34
The only thing installed on my Wintendo now is drivers for the Radeon x800 Pro card and the Soundblaster Live soundcard. I also installed the latest version of DirectX and the game I'll be playing 98% of the time; Counter Strike:Source and Steam. Now all I need to do to is tweak Windows a bit.
Of course the Windows installation messed up the grub bootloader and now I can't access my precious Ubuntu Linux. Now I need a way of getting GRUB back, as I do not plan to use Windows until Dapper is released and I'm not about to reinstall Ubuntu.
There is a howto at the wiki so I'll check out that when I get home from work.
Recovering Ubuntu after installing Windows
PS! As opposed to installing Ubuntu, where all the hardware works out of the box, Windows did not have drivers for the Soundblaster Live 5.1 soundcard
A word of advice:
Do not use the Super Grub Disk as it doesn't work, at least it did not work for me.
When using the Live CD approach, DO NOT setup grub on (hd0,1) or whatever is behind the comma for you. USE "setup (hdo)" instead.
This will reinstall grub on your MBR which is what you want, I tried the hd0,1 approach first with no luck and that made sure that the linux OS could not be booted when running setup (hd0) afterwards. I guess it installed the grub boot files where the linux kernel were supposed to boot from.
So to sum it all up, this is what I do(Overwrites MBR):
Boot the livecd.
Start a terminal.
sudo -i grub find /boot/grub/stage1 // Will print something like (hd0,1) root (hd0,1) setup (hd0) quit
Reboot computer.
Now your old grub menu should be there.



miano # 28. July 2006, 12:05
MarbleheadMan # 14. August 2006, 14:08
Anonymous # 20. August 2006, 19:08
In a future... Can you please give another oportunity to Super Grub Disk ? If it does not work... could you please send me an email ( adrian15 @ raulete . net ) ?
Thank you.
adrian15
Anonymous # 9. September 2006, 22:12
Let me just add another thank you here. I read on another page that reinstalling grub was very difficult and got worried, but your method was very straightforward. Saved me a lot of time!
Anonymous # 13. September 2006, 16:51
Does this include M$ entries?
Heh, just rebooted, yes worked perfectly. Thanks a ton.
Anonymous # 17. September 2006, 14:16
I've some problem,
i tried root (hd0,4) 4 is ext3 where ubuntu was installed.
setup (hd0), it says /boot/grub/stage1 is not found.
/boot/grub/stage2 is not found.
Anonymous # 20. November 2006, 08:19
just rebooted - thanks man , worked excellent!!!
Anonymous # 11. December 2006, 16:49
Thanks a ton... worked a charm .. order is restored!!
Anonymous # 18. December 2006, 05:47
Cheers for the tip. Worked for me.
Anonymous # 18. December 2006, 17:22
Hey man, this procedure was just what I was looking for, and it worked like a charm! All my Windows and Linux boot options are now back! I will primt this manual for future reference.
Thanks very much indeed!
Anonymous # 19. January 2007, 16:33
Muchas Gracias
Anonymous # 7. February 2007, 05:59
arghh...this did not work for me at all. Are the instructions different if one is using sata drives?
Mr Green # 7. February 2007, 09:21
Hence the word of caution.
I'm not sure if this approach works with SATA drives.
This was also written during Breezy or Dapper and I don't know if it's any different in Edgy.
Anonymous # 3. April 2007, 11:29
Thank you, worked on Edgy for me.
Anonymous # 27. May 2007, 10:49
beautifull. You are the best. I rebooted and there it was.......my old grub menu. It didn;t even lose all my custom edits (I edited menu.lst before the failure)
P.S. Windows Vista is not recommended in quad booting. It self distructs with partitioning changes
Anonymous # 10. June 2007, 16:30
Doesn't work. I wonder why there so many damn guides for Linux that doesn't work even if you follow it exactly. It has made me hate Linux so damn much.
Anonymous # 5. July 2007, 19:29
OMG you saved me so much time! Thank You
Anonymous # 3. August 2007, 18:41
Thank you! Worked great. One little hitch though. When I got to the command:
find /boot/grub/stage1
I got (hd1,0) as opposed to (hd0,1). The command:
root (hd1,0)
worked great but the command:
setup (hd1)
claimed to work but did nothing. After trying:
setup (hd0)
everything worked fine. Thanks again!
Anonymous # 19. December 2007, 23:29
thanks
Anonymous # 10. September 2008, 20:11
Very helpful. For others finding this with boot issues, I had to fix the XP boot sector after installing Ubuntu for dual boot:
http://articles.techrepublic.com.com/5100-10877_11-6031733.html?tag=nl.e138
After repairing, grub was gone. These instructions brought them right back, but as another user pointed out your mileage may vary. What worked for me was:
--
sudo -i
grub
find /boot/grub/stage1 // mine was (hd1,0), probably because of 2 drives
root (hd1,0)
setup (hd0)
quit
--
Thanks for the clear instructions.
Anonymous # 24. February 2009, 14:56
It is worth stressing out that in the case of multiple hard drives, the MBR might not be located on hd0.
in my case there are two, "setup (hd0)" did not work and "setup (hd1)" did the trick.