anyone thats restored grub

Vad3r

Senior member
Nov 25, 2000
274
0
0
i hosed XP some time ago. Tried everything to fix/repair, no go.

So am going to do a fresh install, and i know it's going to overwrite my grub loader.

How hard/easy is it to "restore" grub. I don't wanna have to fresh install linux again too.

I have Legacy grub 0.97. I have an old ubuntu live cd that i have verified that boots (in low graphics mode anyhow).

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)

Code:

sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands

Code:

find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Code:

root (hd?,?)

Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr

Code:

setup (hd0)

Finally exit the grub shell
Code:

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Above is copied from Ubuntu forum, would love to hear from someone thats actually done this and it worked.

is it that simple ?

is there any password when you use sudo from a live cd ?