[vox-tech] Reinstalling GRUB
Jonathan Stickel
vox-tech@lists.lugod.org
Tue, 25 Nov 2003 17:56:18 -0800
Ken Bloom wrote:
> On Tue, Nov 25, 2003 at 11:05:16AM -0800, Robert G. Scofield wrote:
>
>>Can someone tell me how to reinstall GRUB from the command line?
>>
>>I had to reformat my Windows partition and so GRUB got eaten. I checked
>>various documentation, and even asked SuSE Support how to reinstall GRUB, but
>>no one has given me the answer.
>>
>>There is a simple command for reinstalling LILO. If I type /usr/sbin/grub I
>>get a GRUB> prompt, but then I don't know what to do next.
>
>
> There is some way of entering commands at the GRUB commandline that will
> install grub, but I don't know what it is - /usr/sbin/grub is a copy of
> the bootloader itself but I don't know what its capabilities are.
>
Since no one has illustrated this yet, I'll share what little I know.
I've recently learned to do this from the Gentoo install instructions
(http://www.gentoo.org/doc/en/gentoo-x86-install.xml). From shell,
#grub
grub> root (hdX,Y)
grub> setup (hdX)
grub> quit
#
That's it! hdX,Y is your boot partition (e.g. hd0,0 = /dev/hda1) and
hdX is where you want grub installed (e.g. MBR of /dev/hda). The gentoo
install instructions gives more details and is very clear. Also, make
sure your /boot/grub/grub.conf file is correct.
Some of you may be asking, how do I run grub and fix my boot loader if I
can't boot into Linux? Just boot off of a floppy or CD, such as KNOPPIX
or your Linux installation CD.
Jonathan
> Use the grub-install command which should be in the same directory.
>
>
>>I finally figured out how to do it with YAST, and so I'm okay. But I've seen
>>too many GNOME and KDE GUI programs fail, and for something as important as
>>installing a bootloader when Windows is in the neighborhood, I would feel
>>more secure if I could reinstall GRUB from the command line.
>
>