At the conclusion of Howard's gentoo install yesterday, Howard had a
problem with grub.

To recap, Howard had the following OSes in this order on his HD: XP,
Mandrake, Gentoo. Before we proceeded with gentoo he was booting with
LILO from Mandrake. Once we set up grub in gentoo a blank screen
appeared instead of the grub menu, no grub prompt, just a blank screen.

I am pleased to see that after I left someone managed to get back into
his mandrake system and run lilo to get him back to square one :-).
However it would be nice to give him access to his gentoo system.

The gentoo system is in something like hda8 (root) & hda9 (boot)
although I am not sure of the exact numbers so I will use hdagroot and
hdagboot to avoid confusion. 

THOUGHT 1
=========
Is grub actually installed where we think it is? From inside the
chrooted gentoo environment run the find command from inside grub viz:

#grub   [run the grub prompt]
grub> find /boot/grub/stage2    [look for grub on every partition]
(hd0,2)  [on my system its on (hd0,2) or /dev/hda3]

make sure that the partition where grub is installed is the partition
specified when you set up grub, viz (on my system):
grub> root (hd0.2)   <--- must match the result of find
grub> setup (hd0)
grub> quit

THOUGHT 2
=========
grub installs a 512 byte stage_1 program in the MBR, ie at the very
start of the drive. 512b is too small to know about the operation of
file systems, so it hard codes in the block addresses of the stage_1.5
file that knows how to work the filesystem where the stage_2 program is
stored, stage_2 does the real work. I suspect that grub stage_1 may not
be able to reach the stage_1.5 file which is stored a long way into
Howard's hard drive. I see that the grub setup program has a --force-lba
option and it may be worth trying this, so the sequence to install grub
would be (once inside the gentoo chroot environment)

#grub
grub> root (hd0,x) 
[where x is the partition number of the gentoo boot partition,]
[remembering that hda7 is (hd0,6) etc]
grub> setup --force-lba (hd0)
grub> quit 

THOUGHT 3 (probably the easiest, apart from my desire to actually
troubleshoot Howards's grubby problem)
==================================================================
Include gentoo under mandrake's lilo system.
lilo needs access to the kernel you want to boot when it embeds itself
in your MBR, in other words when you run lilo after a configuration
change. 

1. Boot into mandrake
2. mount the gentoo boot partition

# mkdir /mnt/genboot
# mount /dev/hdagboot /mnt/genboot

3. check the kernel and initrd names

# ls /mnt/genboot/

should return, among the other contents, something like:
kernel-2.5.6-gentoo-r1 initrd-2.5.6-gentoo-r1

4. add the following to /etc/lilo.conf (ie in the mandrake filesystem)

image=/mnt/genboot/boot/kernel-2.5.6-gentoo-r1
  label=Gentoo
  read-only
  root=/dev/ram0
  append="init=/linuxrc real_root=/dev/hdagroot"
  initrd=/mnt/genboot/boot/initrd-2.6.5-gentoo-r1


(actually  those instructions are for a system with an initrd, if Howard
didn't do an initrd it will be like this:

image=/mnt/genboot/boot/kernel-2.5.6-gentoo-r1
  label=Gentoo            # Name we give to this section
  read-only               # Start with a read-only root. Do not alter!
  root=/dev/hdagroot          # Location of the root filesystem

5. run lilo to take in the changes you just made. run it with the -v
option so you can see that it is doing its thing

# lilo -v

will spew out some messages about finding (or not finding) various
things.

Reply via email to