grub menu contains "combinatorial expansion" of existing installations

Bug #26031 reported by Paul Boddie
10
Affects Status Importance Assigned to Milestone
os-prober (Ubuntu)
Fix Released
Medium
Colin Watson

Bug Description

When installing Ubuntu Breezy in a partition alongside two other Ubuntu
installations, the generated /boot/grub/menu.lst file seemed to contain
combinations of the existing installation entries based on the root setting and
on the root parameter of the kernel setting. The new installation was written in
/dev/sda1, whereas the existing installations were present in /dev/sda5 and
/dev/sda6: the resulting menu seemed to contain combinations of the latter two
devices and the root identifiers (hd0,4) and (hd0,5). The term "combinatorial
expansion" probably isn't appropriate here, but the menu contained 16 entries
for the two existing installations instead of the expected 6 entries, thus
requiring me to edit the menu manually and write it out using grub-install.

Revision history for this message
Paul Boddie (paul-boddie) wrote :

Created an attachment (id=5018)
This is the result of the installer's work on the grub menu.

Revision history for this message
Carthik Sharma (carthik) wrote :

Hi,
Thank you for reporting this issue.

Does this problem still occur with the Dapper Beta installer?

Changed in grub-installer:
status: Unconfirmed → Needs Info
Revision history for this message
Paul Boddie (paul-boddie) wrote :

I haven't looked at the Dapper betas, I'm afraid. Is there no official test system that could be used to check this?

Colin Watson (cjwatson)
Changed in grub-installer:
status: Needs Info → Confirmed
Revision history for this message
Ian Jackson (ijackson) wrote : can cause system not to be bootable

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 subscribe

This bug affects me too and is present in dapper and in knot-1.
In the extreme case affecting me it causes the generation of a
350Kby menu.lst file containing >1k entries, which grub cannot boot.

This is a separate bug, Malone 54041, but it would probably be eaiser
to fix it here.

Ian.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEx3qD8jyP9GfyNQARAtFYAJ9ayjAmHE6l/YyE9dEuWegAUE3hbwCfTBmO
571pG9motDMA74JpExyHYzY=
=Icg3
-----END PGP SIGNATURE-----

Revision history for this message
Ian Jackson (ijackson) wrote : Re: [Bug 26031] Re: grub menu contains "combinatorial expansion" of existing installations

Come to think of it, can this bug cause existing installations to
become unbootable after a while ? Consider a machine with only two
installs, each of which runs update-grub occasionally.

Each time update-grub is run in install A, A's menu.list is made to be
twice the size of B's, and vice versa. So after running update-grub
five times in each install, in alternation, the menu.list will have
O(1000) entries (x the original three or so). We don't know when bug
54041
triggers.

Perhaps this bug should be `High' ?

Ian.

Revision history for this message
Colin Watson (cjwatson) wrote :

No, this bug isn't in update-grub, it's in the installer component that generates the initial menu.lst. update-grub only looks at kernels in its own installation.

Note that all the "(on /dev/blah)" entries are outside the "AUTOMAGIC KERNELS LIST" section, so update-grub considers them to be manually-maintained.

Revision history for this message
Ian Jackson (ijackson) wrote :

Colin Watson writes ("[Bug 26031] Re: grub menu contains "combinatorial expansion" of existing installations"):
> No, this bug isn't in update-grub, it's in the installer component that
> generates the initial menu.lst. update-grub only looks at kernels in its
> own installation.
>
> Note that all the "(on /dev/blah)" entries are outside the "AUTOMAGIC
> KERNELS LIST" section, so update-grub considers them to be manually-
> maintained.

So they are.

If we hadn't been in the habit of installing grub in the mbr then this
would be a much easier problem to solve: we could chain to the grub in
the other partition.

Ian.

Revision history for this message
Paul Boddie (paul-boddie) wrote :

Well, as for the importance of this bug, I suppose that people "expert" enough to want to have multiple installations probably should know how to edit grub menus, but I'm a bit disappointed that there have been two releases since Hoary without fixes for this. Had I had time, I would have attempted a Dapper install by now and would have seen this again, but surely this kind of testing shouldn't fall upon random end-users to test, especially since a review of the code would probably have revealed the cause. The big question is and was this: have we (or do we) test our installs alongside existing ones? If the answer is no, the testing process should be improved, because it's a pretty big omission, really.

Revision history for this message
Colin Watson (cjwatson) wrote :

Paul, we certainly do test this. I'm sorry you got bothered earlier with the question of whether this bug still existed in Dapper; I was certainly aware that it still existed and there was no need to ask you again about it. The reason I haven't considered it a high priority to fix is that it really only badly affects users who do lots and lots of consecutive installations in different partitions on the same machine; that's not to say I don't consider it a bug, just that I have many more urgent things to do. I will try to get to it at some point.

Revision history for this message
Paul Boddie (paul-boddie) wrote :

No problem, Colin! I just thought it was a bit embarrassing for Ubuntu, really.

Colin Watson (cjwatson)
Changed in grub-installer:
assignee: kamion → nobody
Revision history for this message
Colin Watson (cjwatson) wrote :

I worked around this in os-prober recently. (Chaining to the other installations rather than copying their boot menu items, as Ian suggests, would still ultimately be better, but is more work to arrange.)

os-prober (1.20) unstable; urgency=low

  * Skip grub-installer's "(on /dev/blah)" entries detected in GRUB
    configuration files, as if they're useful they will probably be found by
    another probe, and detecting them can result in exponential growth of
    menu.lst files if you do repeated test installs on multiple partitions.
  * Use readlink -f in mapdevfs shim so that os-prober runs outside d-i
    handle mount-by-UUID correctly.
  * Use mktemp -d rather than /tmp, to make use outside d-i safer.
  * Merge from Ubuntu:
    - Try to install fs-core-modules and fs-secondary-modules udebs. These
      are specific to the Ubuntu kernel udeb layout, but it's fairly cheap
      to check for them as well and saves on divergence here.
    - Add os-probes/mounted/sparc/80solaris to recognize Solaris/SPARC
      (Fabio M. Di Nitto).
    - Add linux-boot-probes/mounted/sparc/50silo support (Fabio M. Di
      Nitto).
    - Try to load ufs module, for Solaris support (Fabio M. Di Nitto).
    - Tighten check for whether we're running in d-i; anna-install isn't
      quite enough because if you're running d-i code outside d-i it's
      sometimes reasonable to install a shim for anna-install.
  * Don't probe partitions mounted on /target/boot.
  * Teach linux-boot-prober to deal with mounted partitions correctly,
    unless they're mounted on /, /target, or /target/boot (LP: #14780). This
    should largely obsolete the --mounted option.
  * Only use /target/bin/mount if it exists, in order to work better outside
    d-i.

 -- Colin Watson <email address hidden> Thu, 26 Jul 2007 12:33:31 +0100

Changed in grub-installer:
assignee: nobody → kamion
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.