Revelation: Using Grub (long)


Subject: Revelation: Using Grub (long)
From: Mike Barsalou (mbarsalou@aidea.org)
Date: Tue Oct 22 2002 - 08:29:04 AKDT


On the one hand I dislike sending this kind of e-mail...it shows my
ignorance. On the other hand, I don't like to see others struggle when they
don't have to.

I have been installing Linux on different machines and have been playing
around a little with the way Grub works. Trying to understand it in a
non-productionit'sokifIscrewitup environment. One of the things that I was
not understanding well is this:

If the grub.conf file, which on my machine is found at /boot/grub/grub.conf,
contains the following information, why does it work?

I have the following partitions:

/dev/hda1 will be mounted on /boot
/dev/hda2 will be mounted on / and has a label of "/1"
/dev/hda3 is swap

and the file /boot/grub/grub.conf contains:

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Linux 2.4.18
        root=(hd0,0)
        kernel=/vmliuz-2.4.18-14 ro root=LABEL=/1
        initrd=/initrd-2.4.18-14.img

My first question is, "If my files are stored in the /boot directory, why
does the kernel line not reflect that?".

For some of you this answer is obvious, the kernel line reflects the
location of the file ***relative to the partition that it is on***. Because
I have a /boot partition and a / partition, the files that are on the /boot
partition will be accessed as though they are at the root of the drive.
This is because grub is unaware of and does not care where these files will
be mounted later.

You will also notice the funky drive designations that look like (hd0,0).
This is how grub points to the particular partition on the drive. For
reasons known only to the programmers and others that want to read more at
http://www.gnu.org/software/grub/, hd0 is synonymous with hda and the comma
0 is synonymous with partition 1. Partition two on hdb would be (hd1,1).

Lastly, on my RedHat machine, there is a script called grub-install that
installs the needed files into the correct directory. This script gives
valuable insight about how things work. Grub-install does not put the
kernel files and initrd files in the correct spaces, but it does prepare the
drive for booting.

Hopefully, others who have had more extensive experience with grub can offer
their insights as well.

Mike

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Tue Oct 22 2002 - 08:31:45 AKDT