(Re)installing GRUB bootloader

We had the following problem on the computer:
2 hard drives (hda and hdb).
hda contains the MBR (master boot record) and a Windows 2000 install on the first partition. hdb contains Linux (and its first partition is a boot partition that contains a GRUB installation as done by the RedHat 9 installer).
In the BIOS you can only specify one hard drive into the boot priority sequence and that was hda (probably defined by it being the master on the first IDE chain). Therefore we had to start Linux from a boot floppy (because the floppy drive had boot priority over the hard drive). To get a functioning GRUB, we did the following:

$/sbin/grub (starting grub shell)

grub> root (hd1,0) (telling which one is the boot partition where grub got installed)

Filesystem type is ext2fs, partition type 0x83 (tells us that it found the partition)

grub> find (hd1,0)/grub/stage1
(fd0)
(hd0,0)
(hd1,0)
(hd1,1)
(hd1,2)
(hd1,5)
(hd1,6)
(this command is maybe not necessary, it apparently list all possible partitions on which the grub bootloader could be installed

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 d (hd0) (hd0)1+16 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
(this installs the bootloader onto the first hard drive, apparently not into the first partition, maybe into the MBR?)

grub> quit (exit the grub shell)

emacs /boot/grub/grub.conf

Now you just have to edit the grub configuration file. Ours looks like this:

grub.conf generated by anaconda
Note that you do not have to rerun grub after making changes to this file
NOTICE: You have a /boot partition. This means that all kernel and initrd paths are relative to /boot/, eg.

root (hd1,0)
kernel /vmlinuz-version ro root=/dev/hdb3
initrd /initrd-version.img
root=/dev/hdb1 default=0 timeout=10 splashimage=(hd1,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.20-19.9)
root (hd1,0)
kernel /vmlinuz-2.4.20-19.9 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-19.9.img

title Red Hat Linux (2.4.20-18.9)
root (hd1,0)
kernel /vmlinuz-2.4.20-18.9 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-18.9.img

title Red Hat Linux (2.4.20-13.9)
root (hd1,0)
kernel /vmlinuz-2.4.20-13.9 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-13.9.img

title Red Hat Linux (2.4.20-9)
root (hd1,0)
kernel /vmlinuz-2.4.20-9 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-9.img

title Red Hat Linux (2.4.20-8)
root (hd1,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-8.img

title Windows 2000
rootnoverify (hd0,0)
chainloader +1

title Floppy
rootnoverify (fd0)
chainloader +1

title Reboot
reboot

title Halt
halt