grub2 approach can make system unusable if shit happens

Bug #637787 reported by Wolfgang Fahl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: grub2

On my Samsung netbook there is a recovery tool which will try to bring the system into it's
factory state. Unfortunately it will erase your master boot record when you boot it.

The grub2 / ubuntu approach of automatically modifying the configuration and not automatically correcting
the default entry might lead to a situation where the recovery tool will automatically be booted against what the user expect. It happened to me recently when a new kernel was installed. I got two new boot entries and the default entry suddenly pointed to the recovery tools boot entry in the menu.

I think grub2 should be modified to have an option to work in grub 1 mode with fixed menu entries.
grub2 is too unsafe to work with if it does bad things like described above.

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

GRUB 2 has the option already; you just weren't using it. :-) Set GRUB_DEFAULT to the *name* of a menu entry rather than its number.

I would rather not change the behaviour of numbers in GRUB_DEFAULT, because (a) it's very messy to have something automatically modifying a configuration file in /etc and (b) the current behaviour may well be useful. Names are the documented way to do this:

`GRUB_DEFAULT'
     The default menu entry. This may be a number, in which case it
     identifies the Nth entry in the generated menu counted from zero,
     or the full name of a menu entry, or the special string `saved'.
     Using the full name may be useful if you want to set a menu entry
     as the default even though there may be a variable number of
     entries before it.

     If you set this to `saved', then the default menu entry will be
     that saved by `GRUB_SAVEDEFAULT', `grub-set-default', or
     `grub-reboot'.

     The default is `0'.

Changed in grub2 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Wolfgang Fahl (wf-bitplan) wrote :

Thanks for the quick reply. The "by name" approach will make sure a fixed entry is selected. If i understand the approach right it will not make sure that the "right" kernel is booted. On Ubuntu kernel updates new entries are automatically added. The "by name" approach will select the older kernel after update. For proper operation there would have to be some mechanism that allows to have "aliases" an select the alias for an entry. The update procedure would then have to give the grub entry the name "kernel x.y-latest" or something to have a stable alias that always points to the most current kernel. If the most current kernel does not work properly manual intervention would be possible by moving the alias just as the "by name" approach does.

I don't know how to file a change request for two packages that are involved by this comment. Hopefully this comment will spawn some discussion and reaction to get the idea pushed into reality.

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.