[Grml] Grub2 install behavior changed? Grml LiveCD 2010.12

hansbkk at gmail.com hansbkk at gmail.com
Wed Feb 16 09:25:57 CET 2011


I've previously been using Ubuntu v10.10 as my maintenance OS for
managing Grub2, but since discovering that Grml's LiveCD environment
includes a recent Grub2 release I thought I'd give that a go.

Grml is using Grub2 version 1.99~201012221-1" (same as "beta0" right?)

While Ubuntu 10.10 reports "1.98+20100804-5ubuntu3".

I have my "master grub partition" - which contains my bootable ISOs,
persistence files for some of the LiveCDs, and a /boot/grub/ folder.
This folder has the results of previous "grub-install" commands run
from Ubuntu, as well as a manually maintained grub.cfg. There is no OS
in this partition (other than the LiveCD ISOs). Even though under most
distros the drive containing this partition comes up as /dev/sde,
Grub2 sees it as (hd0), so I've got it set up as my boot device.

I also have a second drive (/dev/sdf or (hd1) via grub) set up
identically, also bootable and use rsync to back up the partitions'
contents after any significant changes (I originally tried to do this
as a RAID1 mirror, but ran into problems with some LiveCDs mounting
the persistence files from the member partition, breaking the array).

Booting into Grml, I map the first drive's grub partition to
/mnt/g201, so the grub folder is now at /mnt/g201/boot/grub and run:

grub-install --boot-directory=/mnt/g201/ /dev/sde

At next boot, the loader brings me to a blank grub prompt (not the
rescue grub, a full working grub2 environment with root=(hd0,msdos1)
as it should be

To figure out what the boot loader is doing, I run boot-info-script
(excellent tool BTW, should definitely be added to Grml!) and it tells
me

"Grub 2 is installed in the MBR of /dev/sde and looks for we."

As opposed to my second drive, for which says (much more informatively)"

"Grub 2 is installed in the MBR of /dev/sdf and looks on the same
drive in partition #1 for (,msdos1)/boot/grub."

The latter being normal for a correctly working boot loader, at least
as far as Ubuntu is concerned.

I then have a look at my first drive's grub partition, and see that my
grub-install command from Grml resulted in a whole new grub folder
directly under the root /mnt/g201/grub, rather than updating the
existing /mnt/g201/boot/grub

So I figure this is why the boot loader isn't loading the grub.cfg
from my usual /boot/grub - presumably it's looking for a grub.cfg in
/grub and of course there isn't one there.

So this time I run the command as follows:

grub-install --boot-directory=/mnt/g201/boot /dev/sde

Note the path spec'd to the /boot parent of where grub should go,
rather than the root of the device as is usual under Ubuntu.

This time the result file for the boot-info-script tells me

"Grub 2 is installed in the MBR of /dev/sde and looks for le." (as
opposed for "we" before - WTF?)

But the drive now boots up properly into my boot.cfg.

So I was able to get it working.

Is this an intended behavior change for grub-install, that
--boot-directory is now supposed to specify the immediate parent of
where I want the /grub folder to go?

I hope not, because having a canonical /boot/grub location seems to be
helpful in troubleshooting - letting the user put it anywhere s/he
likes seems an unnecessary complication. . .

It also seems that many of the entries in my grub.cfg no longer are
working, so rather than troubleshooting all the other changes between
these two Grub2 version, at this point I'm going back to Ubuntu's and
hopefully these problems will go away.

If I do want to come back to this later, is there a good location for
documentation on things the end user needs to be aware of regarding
differences between 1.98 and 1.99?

Thanks in advance. . .


More information about the Grml mailing list