CQuirke’s Long View

Long lead times need long forward planning

Ubuntu grub 2 Boot Menu – Extra Wrinkle

Posted by cquirke on 22 May 2010

Ubuntu 9.10 and later (as of writing this, 10.04 LTS) use grub 2 as the boot manager, which differs substantially from the original grub used previously. You may have heard that Linux uses editable text rather than inscrutible binary files to configure the system; in this respect, grub 2 is a step backwards.

In the original grub, you’d edit the menu.lst file and grub would respect this; in grub 2, grub will build its own configuration file (overwriting your settings) and all you can do is shake the table via an editable file called grub, and hope grub 2 will build your “control” into the actual control file it spawns.

This previous post covers those differences and how to work with each, but misses one detail; the need for yet another setting so that what you thought GRUB_DEFAULT=saved would do, actually works. Without this setting, you have to explicitly set the default boot entry you want to be “saved”; with this setting, it will take your previously booted choice as the current default.

So, if you want to display the boot menu for 20 seconds and default to what you’d selected previously, then this is how your grub settings should look:


Background: GRUB_DEFAULT can take one of three types of parameter; the ordinal number of the boot menu entry, a full and exactly matching text string for that entry, or the keyword “saved”, as used above.

Whenever grub 2 detects relevant changes to the system, it rebuilds the boot menu, padding it out from the top. Linux comes first (of course) so all your other OSs trail at the end, and as the menu gets longer, so the ordinal number gets bumped up.

So trying to set (say) Windows 7 as the default entry via explicit ordinal number, is inherently doomed; that’s why the “saved” value becomes so important. But unless you add the GRUB_SAVEDEFAULT=true setting, it’s as useless as an explicit selection, because the ordinal number used by the grub-set-default command will point to the wrong entry after grub 2 rebuilds the boot menu.

That can happen sooner than you think; Ubuntu 10.04 has just been released, yet already there are over 70M of updates, including a new kernel that spawns two new boot menu entries after the updates are applied.

The pages I found that document all of this, are here, here and here.

Technorati : , ,
Del.icio.us : , ,


One Response to “Ubuntu grub 2 Boot Menu – Extra Wrinkle”

  1. Chris Quirke said

    This is why I don’t trust “the cloud”, even the part we’re already living in, such as this blog.

    I come back after a while, and find WordPress is now displaying text ads in “my” blog, in larger fonts than is typical for “Ads by Google”. And the advert I see, is “Top 10 Keyloggers of 2011”.

    Now I hate malware with a passion, including keyloggers, so I find this quite offensive. But what can I do? I’m sure WordPress’s Terms and Conditions give them the right to do this, and if I don’t like it, I should pay for my own server box somewhere and grow the smarts to run it.

    Fair enough, but in an all-cloud furture, I wouldn’t have that option. I consider WordPress to be the best of the bunch, so imagine the sort of mileage I’d get at the other end of the scale – and with far higher stakes, if it were my personal and/or crucial business data floating around in the cloud.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: