LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Restore GRUB (http://www.linuxquestions.org/questions/linux-hardware-18/restore-grub-314821/)

Nilesh.Shah 04-19-2005 05:23 AM

Restore GRUB
 
Hello all,


I have done this but cannot figure it out. Reinstalling XP has overwritten the MBR. I dont know thats the commands that you need to type in using CD 1. Its Linux rescue or something else.

A detailed instructions/commands on this would be much appreciated.



Thanks & Regards
Nilesh

abisko00 04-19-2005 05:39 AM

What distribution do you use? On SUSE e.g. you have an option to repair your system, which will restore grub automatically.

xukosky 04-19-2005 10:17 AM

You can easily restore grub using a live cd distro like knoppix or ubuntu live cd

Step 1: Log in a root console.
Step 2: Execute "grub".
Step 3: In the grub shell just type:

root (hd0, 3)
setup (hd0)

Where hd0 is your first hard disk and you have linux installed on the fourth partition of that disk (the first is numbered as 0), just change it to your settings.

Maybe you can find any problems while trying to restore grub, then come back with the message errors and tell us.

Nilesh.Shah 04-19-2005 11:41 AM

Sorry for the incomplete information. I am using Redhat 9.

abisko00 04-19-2005 11:55 AM

So you need to do it the way xukosky suggested. You can use the rescue system from your CD1.
Here is a nice grub manual:
http://portal.suse.com/sdb/en/2002/0..._overview.html
It is written for SUSE sytems, but the commands should be the same in RedHat. The file menu.lst is called grub.conf in RedHat (AFAIK).

Make sure you know on which partition your kernel is located (this will be the above mentioned root).

jojotx0 04-19-2005 11:58 AM

1> Boot RH9 Disc 1 CD
2> Type in linux rescue at RH9 Disc 1 boot screen
3> Type chroot /mnt/sysimage at the rescue console
4> Type grub-install /dev/hda
5> type exit 2x with the CD ejected from the CDROM drive
6> Have fun with GRUB :)

Xerom 01-09-2010 11:43 AM

Sorry for posting to an old thread but I spent 3hrs searching till I found this post which fixed my system after XP install wiped grub from my mbr.

For my sata drive I had to type
grub-install /dev/sda


-restore grub after windows install-
Insert fedora install dvd, select recovery mode.
After hardware/os detection you'll get a command prompt, run these commands:

[root@eos ~]# chroot /mnt/sysimage
[root@eos ~]# grub-install /dev/hda

OR depending on your system..

[root@eos ~]# grub-install /dev/sda


All times are GMT -5. The time now is 02:53 PM.