The submenu feature was introduced by Ubuntu in GRUB 1.99. The default submenu title is "Previous Linux versions" and appears immediately below the first kernel menuentry (and its associated recovery mode option, if enabled) in the main GRUB menu.

g2_submenu.png

The purpose of the submenu is to streamline the main menu. In previous versions of GRUB 2, as new kernels were added to the system each kernel and its associated recovery mode entry were added to the main menu. Over time, the main menu display grew and could contain many kernels no longer regularly selected by the user. The submenu structure limits main menu entries to present a more manageable display.

Features & Considerations

Key features of the GRUB 2 Submenu include:

Submenu Display

The Grub2 menu will look unchanged until more than one kernel is available for selection. When more than one kernel is available, Grub2 will automatically add a submenu.

New Kernel Introduction

When a new kernel is installed by Ubuntu:

Manually Setting a Specific Kernel as the Default

To manually set a specific kernel to boot, the user must edit the /etc/default/grub file as the superuser/root.

The line to edit is the GRUB_DEFAULT=0. After setting this line to the desired setting (see below), save the file and update the GRUB 2 configuration file using the following command:

Setting a Main Menu entry as the default

By default GRUB 2 sets the most recent kernel as the default. This kernel choice appears as the first item on the main menu.

Setting a Submenu entry as the default

Designating an entry in the submenu requires a more complex identifier so that Grub 2 will search the submenu.

grub_submenu-examples.png

Failsafe Kernel Booting

If GRUB2 cannot determine the kernel to boot due to an incorrect GRUB_DEFAULT setting in /etc/default/grub, GRUB2 will attempt to boot one additional entry. This is normally the first entry on the main menu; by default this is the newest installed kernel.

The "GRUB_DEFAULT" setting in the /etc/default/grub file never changes automatically except when the GRUB package version is updated by the system. If a kernel is added or removed, the DEFAULT setting does not adjust and can cause the system to boot a menuentry not expected by the user.

When a failure occurs and GRUB is unable to find the DEFAULT entry, it will attempt to boot the most recent kernel (the first menuentry on the main GRUB2 menu).

If the correct kernel is not booting:

Note: The current version of GRUB in Precise Pangolin 12.04 is GRUB 1.99. Improvements to the submenu structure will be included in GRUB 2.0, but this version was not released in time to be incorporated into Ubuntu 12.04.


Links

Grub2

Grub2/Installing

Grub2/Upgrading

Boot-Repair

GNU GRUB Manual


CategoryBootAndPartition CategoryBootAndPartition

Grub2/Submenus (last edited 2012-09-25 11:56:14 by c-24-98-114-236)