more grubbiness (was Re: 1.6.0-i686-rc2)

Dennis Veatch dveatch at woh.rr.com
Fri Feb 3 18:11:54 UTC 2006


On Saturday 28 January 2006 11:39, Dennis Veatch wrote:

>
> Well, isn't that special. That's right I got the church lady on this now.
> :) Had the ol' hag setup /dev/hda with /boot part of / and run through the
> install choosing grub. And wadya know. It worked.
>
> So the problem I've been having is with /boot as it's own partition. So
> making use of the "feature". Defore the install asks for bootloader. Made
> that symlink in /mnt/boot/ and tried it, didn't work. :( Might be the way
> the installer code handles that, dunno for sure didn't look.

Let's try this and hopefully I can explain it well enough and I will use the 
following partitioning scheme as an example;

swap - /dev/sda1
/boot - /dev/sda2
/         - /dev/sda3

Now bear with me as I will be a little footloose here in describing this but 
the *gist* of it is correct.

When grub boots a drive it has no sense or concept of filesystems. As far as 
grub is concerned stage1 and 2 can be anywhere in any partition. We, meaning 
I and us the general Linux population tend to always think of directory 
structures in relation to "/". Naturally of course. It's the root of the 
tree.

Grub otoh has no notion of these things and is only concerned with where the 
boot partition is. If boot happens to be in the *same partition* as "/". Then 
running "grub", then "root (hd0,2)" and then "setup (hd0)" will work. This is 
because "root (hd0,2)" tells grub, look in the "/" partition which 
is /dev/sda3 or "2" using grubs counting methodology.

Using my example partitioning scheme above, issuing those same commands will 
fail. Why? Because your telling grub the boot partition is in the same 
partition as root and of course it is not. It is in it's own partition.

So to correct that, the correct sequence of commands with grub are;

root (hd0,1)
setup (hd0)
quit

Now grub will install successfully because I told it /boot is in /dev/sda2 The 
was all confusing to me until I realized just what the "root" command really 
means within the "grub" command. Simply it means partition and has *nothing* 
to do with "/" as it were. 

Which is starting to make sense now because grub does not run under any 
operating system so it has no knowledge or concept of directory structures 
*BUT* it does know partitions. 

And that is where I was falling down. Yes I am aware of e2fs_stage1_5 and it's 
kinfolk in /boot/grub but those come way after grub has figured out where the 
*boot partition* is. I'll say it once again, think *partitions* and nothing 
else.

So how do we fix the "install_grub()" function in the lunar-install script? 
Again bear with me as my bash reading skills suck. But it looks to me $ROOT 
is the culprit. Perhaps redefine it to $GRUB_PARTITION and adjust the rest of 
the code within install_grub(). 

I hope this explains it well enough. If not then I will try again.


More information about the Lunar-dev mailing list