Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello every1!!
OK...I reinstalled WinXP on my first partition of my first HD...anmd it seems that GRUB was installed there, and now I cant choose which OS to boot!! :(
How do I reinstall GRUB without reinstalling Linux??
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Boot Linux from floppy boot disk (you do have one don't you?) or rescue CD, then:
/sbin/grub-install /dev/hda (for example)
Guy

I've used Gentoo linux, so thats is how I'll approach it..
Slap the Live CD in the tray and boot from it. Theres a bunch of steps in the hand book (which is onlien that you have to follow to properly mount your boot partition and such. The steps the hand book said were liek this:
# mount /dev/hda3 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot
*or whatever your partitioning scheme is.At this point you should be able to cd into boot and make sure theres a /grub directory, and files. If so, then lets keep going. If not, I forgot something.
Theres somethign in here you have to do to make sure the system knows where grub is, you could probably just mount the cdrom, export PKGDIR=/mnt/cdrom, and then run this, but I'm not 100% sure about that... But assuming you can, Re-emerge Grub (wont take too long)
# emerge grub
your grub.conf file should be fine...# grub-install --root-directory=/boot /dev/hda
*be sure to change like /boot and /dev/hda. If you install to /dev/hda, it will write to the MBR and let you boot, which is what you want me thinks.# grub
grub> root (hd0,0)
grub> setup (hd0)
grub> quitUnmount all your mounts and restart.
(I know that the grub steps here work, but its the getting to this point which is tough)
What we needed to do: When you reinstalled XP, it put its own boot loader onto the MBR of C:\. We need to put grub back. Thats where the install to /dev/hda comes in.
Hope this helps.

Umm...I cant access the boot folder in /mnt/hdb3!! :(
It just appears as if there were no files in there...and when I try to enter there from a shell...and try the "grub-install /mnt/hdb3" command, it says its a read only filesystem!!
I tried un-readonly-ing-it but it doesnt work!! :@
I cant delete files from anywhere in hdb3!! :(
What do I do now?? hdb3 is a Linux partition, not NTFS...
And why is the boot folder empty??
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

El-Trucha why are you giving this command? "grub-install /mnt/hdb3"
I thought you wanted to restore the GRUB boot loader. The GRUB boot loader is usually installed on the Master Boot Record (MBR) of the first hard drive. In most cases this is /dev/hda. I have done this many times.Here is how I would put the GRUB boot loader on the first drive:
1. boot with the first RedHat 9 CD
2. at the comamnd line type:
linux rescue
3. take the default for several more questions until you get the command line again
4. type the following command:
chroot /mnt/sysimage
5. restore the boot loader by typing:
grub-install /dev/hdaIf you want to test your GRUB boot first without writing it to your hard drive you can write it to a floppy instead with the command:
grub-install /dev/fd0After you know it works OK then you can write it to the hard drive.
If need to change the GRUB menu you must edit the GRUB configuration file. This file is called "/boot/grub/grub.conf"

Hmm...I did all the steps, but I ended up on a console that said "grub>"!!
What do I type in now??
I typed in "reboot", then it took me back to the regular console, and I typed in "reboot" again and it just rebooted, but to WinXP, not GRUB!! :(
What now??
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Please get close to a clean Linux boot as you can. Then give us the output of:
fdisk -l /dev/hda
fdisk -l /dev/hdb
cat /etc/fstab
cat /etc/mtab
df
-Guy

Well, I got this:
fdisk -l /dev/hdaDevice B. Start End Blocks Id System
/dev/hda1 * 1 5169 39077608 7 HPFS/NTFSfdisk -l /dev/hdb
Device B. Start End Blocks Id System
/dev/hdb1 * 1 3742 28289488+ 7 HPFS/NTFS
/dev/hdb2 3743 3756 105840 83 Linux
/dev/hdb3 3757 5039 9699480 83 Linux
/dev/hdb4 5040 5169 982800 f Win95
Ext'd (LBA)
/dev/hdb5 5040 5169 962800 Linux swapcat /etc/fstab
cat: /etc/fstab: No such file or directory
cat /etc/mtabrootfs /rootfs rw 0 0
/dev/root.old / ext2 rw 0 0
/proc /proc proc rw 0 0
/dev/pts /dev/pts devpts rw 0 0
none /tmp/ramfs ramfs rw 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0
/tmp/cdrom /mnt/source iso9660 ro 0 0
/tmp/loop0 /mnt/runtime cramfs ro 0 0
/dev/hdb3 /mnt/sysimage ext3 rw 0 0
/dev/hdb2 /mnt/sysimage/boot ext3 rw 0 0
none /mnt/sysimage/dev/pts devpts rw 0 0
none /mnt/sysimage/proc proc rw 0 0df
Filesystem 1K-blocks Used Available Use%
rootfs 6120 3402 2368 59%
/dev/root.old 6120 3402 2368 59%
/tmp/cdrom 653440 653440 0 100%
/dev/hdb3 9546816 7409716 1652128 82%
/dev/hdb2 102486 15435 81759 16%
-Guysh: -Guy: Command not found
No, j/k...:PThanx!! ;)
El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |