Discussion Locked

How to install Grub

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I used to have XP and Fedora 5 running in the same computer, using Grub as the boot loader.

I had to reinstall Windows, and yes it over wrote the MBR. Now my system boot Windows only.

How can I install grub again, and keep my old linux installation? I tried rescue, but I have no idea what was to be done! I also tried to run the setup, get the bootloader options, but then I had to install fedora again! I just wanted ti install grub, isn't there a GUI version of the grub setup?

Thanks

8 replies

by jmgarvin

You should still get the grub prompt and you should see:
grub >

So here is what you do:
grub > root (hd0,0)
grub > setup (hd0)
grub > quit

So, you machine might be a little different. What hd(0,0) means is the first hardrive and the first partion. That means that if you have one hdd, that the first 0 is correct. The second 0 might change. Where does /boot live? I would assume if you installed Windows as well as Linux, you have a partion scheme like:
/boot
/
swap
NFTS

So, if /boot lives anywhere else, you might have to change the partion number to where it really lives.

edited to remove some crack smoking comment about sd and not hd....which is wrong and stupid...and probably evil, but it's hard to tell.

by yukon0196

I'm not getting the grub prompt, when I run rescue it offers me to mount the systemimage, or make it "Read Only", or skip. How can I get the grub prompt?

Now if I got to the grub prompt, my system is partitioned as:

NTFS
FAT32
/boot (102MB)
/ (this file system uses a logical or a virtual partition that includes a swap space and the actual ext3 file system).

I assume the grub needs to be installed in the third partition, "/boot". And probably a pointer to that partition from the first sectors (maybe in the NTFS partition).

If this is right I really don't need to install grub, but to update the MBR that was overwritten by windows when I installed it. This means the grub is still there, but needs to be pointed at when the computer first starts.

Where am I going,

What's next?

J.J.

by jmgarvin

Does it just boot to Windows or do you get the grub prompt?

If it just boots to Windows, you'll have to use the rescue CD....If it gives you the grub prompt, then follow my previous directions.

If it doesn't you'll have to boot with the resuce CD. Once you boot with the rescue cd make sure to chroot into the system.

Once chrooted type
grub

That will bring you into the grub command shell. Now type:

grub> root (hd0,3)
grub> setup (hd0)
grub> quit

Double check your grub.conf in /boot/grub/grub.conf

Make sure Windows points to hd(0,0) and Linux points to (hd0,2)

That help?

by jaqui

install booloader.

GRUB = Grand* Unified Bootloader.

*read Grand as grimy in my opinon, I'll stick with the more customisable, non GRAPHIC DEFAULT LILO.
graphic boot is for idjits that want their system to lie to them.

editing to add:

that's my opinion of a graphic boot into a gui, and it isn't going to change any time soon.

by jmgarvin

It seems grub is the wave of the future and lilo is dying...

I like lilo, for all its quirks...

by jaqui

and still being developed.
the Distros are choosing to use the lower quality bootloader.
[ yet another reason to use lfs, you can use whichever bootloader you want. ]:)

by charlesmcdonald

It's a little late now but you should always back up your MBR. I use MBRtool (available from http://www.diydatarecovery.nl/mbrtool.htm ) installed on a bootable MS-DOS floppy.

There appear to be several software utilities that provide MBR editing capabilities. I've never used any and can't recommend that you take that route. It's possible that you will corrupt the MBR and won't be able to boot anything. Make sure you back it up before any editing.

The MBR is not human readable, it contains boot loader code and partition table information.

If you really want to do this then search for "edit MBR" using your favorite search engine and you'll find plenty of possibilities.

Good luck, you're gonna need it!

by parthagoswami06

1. Insert the Linux disc 1/ DVD .
2. Then type
# linux rescue

3.type # chroot /mnt/sysimage
4. then type ,
#grub-install /dev/hda
(hda or sda, according to your confgartion.)
5. Then,
# exit
# reboot

Then It Will be done..

Thanks

partha

This discussion is closed to new replies.