Discussion:
[Grml] Grub2 install behavior changed? Grml LiveCD 2010.12
hansbkk
2011-02-16 08:25:57 UTC
Permalink
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. . .
Jason White
2011-02-16 08:47:57 UTC
Permalink
Post by hansbkk
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. . .
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.

The grub-install(8) manual page says:

--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory


You could have used chroot and then run grub-install without specifying
--boot-directory if you wanted.

this is Linux. There are choices. Comamnds have options to cater for a wide
variety of needs and preferences. You don't have to use this option if you
don't want to. It's documented precisely in the manual page.
hansbkk
2011-02-16 09:30:34 UTC
Permalink
Post by Jason White
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.
--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory
The change in behaviour is that when you use --boot-directory to point
to the root/mount point of a device X, it used to write to X/boot/grub
not X/grub. NBD now that I know, but it is a change from the current
Ubuntu's grub2 version and therefore from many of the howto/blog
examples out there on the interwebs.


I'll follow up with the authors of that script to let them know
grub2's changed its MBR code with 1.99.

OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Post by Jason White
You could have used chroot and then run grub-install without specifying --boot-directory if you wanted.
this is Linux. There are choices. Comamnds have options to cater for a wide variety of needs and preferences. You don't have to use this option if you don't want to. It's documented precisely in the manual page.
Thanks for the clarification.
Ulrich Dangel
2011-02-16 15:17:25 UTC
Permalink
* hansbkk at gmail.com wrote [16.02.11 10:30]:
Hi,
Post by hansbkk
OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Maybe not exactly what you need or want, but maybe linux-boot-prober
from the os-prober package goes in the right direction. But it does not
run auomatically on all detected blockdevices AFAIK.
--
twitter: @mr_ud | identica: @mru
IRCNet: mru | freenode: mrud
Ulrich Dangel
2011-02-16 15:17:25 UTC
Permalink
* hansbkk at gmail.com wrote [16.02.11 10:30]:
Hi,
Post by hansbkk
OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Maybe not exactly what you need or want, but maybe linux-boot-prober
from the os-prober package goes in the right direction. But it does not
run auomatically on all detected blockdevices AFAIK.
--
twitter: @mr_ud | identica: @mru
IRCNet: mru | freenode: mrud
Ulrich Dangel
2011-02-16 15:17:25 UTC
Permalink
* hansbkk at gmail.com wrote [16.02.11 10:30]:
Hi,
Post by hansbkk
OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Maybe not exactly what you need or want, but maybe linux-boot-prober
from the os-prober package goes in the right direction. But it does not
run auomatically on all detected blockdevices AFAIK.
--
twitter: @mr_ud | identica: @mru
IRCNet: mru | freenode: mrud
hansbkk
2011-02-16 09:30:34 UTC
Permalink
Post by Jason White
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.
--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory
The change in behaviour is that when you use --boot-directory to point
to the root/mount point of a device X, it used to write to X/boot/grub
not X/grub. NBD now that I know, but it is a change from the current
Ubuntu's grub2 version and therefore from many of the howto/blog
examples out there on the interwebs.


I'll follow up with the authors of that script to let them know
grub2's changed its MBR code with 1.99.

OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Post by Jason White
You could have used chroot and then run grub-install without specifying --boot-directory if you wanted.
this is Linux. There are choices. Comamnds have options to cater for a wide variety of needs and preferences. You don't have to use this option if you don't want to. It's documented precisely in the manual page.
Thanks for the clarification.
hansbkk
2011-02-16 09:30:34 UTC
Permalink
Post by Jason White
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.
--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory
The change in behaviour is that when you use --boot-directory to point
to the root/mount point of a device X, it used to write to X/boot/grub
not X/grub. NBD now that I know, but it is a change from the current
Ubuntu's grub2 version and therefore from many of the howto/blog
examples out there on the interwebs.


I'll follow up with the authors of that script to let them know
grub2's changed its MBR code with 1.99.

OT - Do you (or anyone) know of a tool (other than boot-info-script)
that parses all block device bootloaders and reports what type they
are and where they're pointing to?
Post by Jason White
You could have used chroot and then run grub-install without specifying --boot-directory if you wanted.
this is Linux. There are choices. Comamnds have options to cater for a wide variety of needs and preferences. You don't have to use this option if you don't want to. It's documented precisely in the manual page.
Thanks for the clarification.
hansbkk
2011-02-16 08:25:57 UTC
Permalink
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. . .
Jason White
2011-02-16 08:47:57 UTC
Permalink
Post by hansbkk
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. . .
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.

The grub-install(8) manual page says:

--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory


You could have used chroot and then run grub-install without specifying
--boot-directory if you wanted.

this is Linux. There are choices. Comamnds have options to cater for a wide
variety of needs and preferences. You don't have to use this option if you
don't want to. It's documented precisely in the manual page.
hansbkk
2011-02-16 08:25:57 UTC
Permalink
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. . .
Jason White
2011-02-16 08:47:57 UTC
Permalink
Post by hansbkk
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. . .
The --boot-directory argument is optional; if you don't specify it,
grub-install uses /boot.

The grub-install(8) manual page says:

--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the /boot/grub
directory


You could have used chroot and then run grub-install without specifying
--boot-directory if you wanted.

this is Linux. There are choices. Comamnds have options to cater for a wide
variety of needs and preferences. You don't have to use this option if you
don't want to. It's documented precisely in the manual page.
Loading...