Linux GRUB and grub.conf troubleshooting - part1
Troubleshooting GRUB requires knowing how grub works. Looking at a sample
grub.conf file, we can see the commands that grub will accept at command line prompt.
Code:
node1# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=5
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Memtest86+ (1.26)
root (hd0,0)
kernel /boot/memtest86+-1.26 ro root=LABEL=/ idle=poll console=ttyS1,115200
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /boot/vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ console=tty0 console=ttyS0,9600n8
initrd /boot/initrd-2.6.9-42.ELsmp.img
One thing to know about grub is that it's configuration file (grub.conf) reside in the /boot directory. In some cases /boot is a directory on the root filesystem, or a filesystem of it's own. From grub's point of view, there is a difference.
If /boot is a directory on the root filesystem (like above), then all paths in grub.conf will be relative to /.
If /boot is a standalone filesystem, then all paths will be relative to /boot (instead of /boot/vmlinuz-2.6.9-42.ELsmp, it will be /vmlinuz-2.6.9-42.ELsmp).
For each stanza, there is the
root command which defines where is the /boot directory for that specific Linux OS(disk & partition). After that, the
kernel and
initrd define where are the kernel image and the initial ram disk + other parameters, relative paths from /boot directory/filesystem.