Skip navigation.

Mr Green's house of joints.

Enter with THC in blood.

Windows reinstall messes up grub.

,

Last night I reinstalled Windows to make it a mean, lean gaming machine. And that's what it looks like it's gonna be. A major advantage with using Linux for all your non-gaming needs is that you don't need to install all sorts of crap on your Wintendo partition. That's something to think about for you die hard gamers. Reboot in thirty seconds is a nice thing!

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 :D

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.

File permissionsHow to unsecure Samba

Comments

miano 28. July 2006, 12:05

worked like a charm after trying other methods that miserably failed. thanks man

MarbleheadMan 14. August 2006, 14:08

Another thanks here. Flawless instructions indeed.

Anonymous 20. August 2006, 19:08

adrian15 writes:

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

thankful guy writes:

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

Xyc0 writes:

Does this include M$ entries?

Heh, just rebooted, yes worked perfectly. Thanks a ton.

Anonymous 17. September 2006, 14:16

harsha writes:

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

Anonymous writes:

just rebooted - thanks man , worked excellent!!!

Anonymous 11. December 2006, 16:49

Aby writes:

Thanks a ton... worked a charm .. order is restored!!

Anonymous 18. December 2006, 05:47

Jordan writes:

Cheers for the tip. Worked for me.

Anonymous 18. December 2006, 17:22

smspvdm writes:

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

alnokta writes:

Muchas Gracias

Anonymous 7. February 2007, 05:59

Anonymous writes:

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

Did you use "setup (hdX)" without the comma and the number behind. If you used it with the comma it most likely wiped the area where Linux boots from.

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

MxG writes:

Thank you, worked on Edgy for me.

Anonymous 27. May 2007, 10:49

Anonymous writes:

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

Anonymous writes:

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

vazine writes:

OMG you saved me so much time! Thank You

Anonymous 3. August 2007, 18:41

Anonymous writes:

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

Anonymous writes:

thanks

Anonymous 10. September 2008, 20:11

Anonymous writes:

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

Anonymous writes:

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.

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

Type the two words displayed in the image below:


Smilies

July 2009
M T W T F S S
June 2009August 2009
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31