Modifying menu.lst File in Ubuntu – Configuring Grub in Ubuntu

The Automagic Kernels List

The Automagic Kernels List holds the global settings applied to the kernels held in the /boot directory. It is populated by the script “update-grub” which runs each time a kernel is installed from the Ubuntu repositories. This list of settings is held between the "### BEGIN AUTOMAGIC KERNELS LIST" and "### END DEBIAN AUTOMAGIC KERNELS LIST” lines, and has a different format than is found in most configuration files or, for that matter, in the rest of the file. This difference is due to the fact that two different scripts must use this part of the file.

Comments in the Automagic Kernel List are designated with two comment symbols (#), instead of the usual one. Global options read by the update-grub script are designated with one comment symbol (#). For example, the line “## default kernel options” is a comment, while the line “# howmany=all” is a global option used by update-grub to generate the file read by grub at boot.

If you want to add additional kernel parameters, you add them to the end of the line that looks like:

# kopt=root=UUID=e4f56224-63eb-4f0f-a974-7b4938d56fd3 ro

You do not remove the comment symbol, or create another kopt variable.

Other Configuration Options

Ubuntu has you press “ESC” during the boot process to get to the grub menu. If you want to change how long you have to press “ESC” (the default is 3 seconds) or if you want the menu to always appear at boot, you can change the following options:

## timeout sec

# Set a timeout, in SEC seconds, before automatically booting the default entry

# (normally the first entry defined).

timeout 3

Changing timeout will change the amount of time you have to press the “ESC” button.

## hiddenmenu

# Hides the menu by default (press ESC to see the menu)


If you want the menu to appear by default, you will comment the “hiddenmenu” line with one comment symbol (#).

Running the update-grub script

There are many other options you can specify in the menu.lst file. Some are purely cosmetic, such as the splash screen. Others are important if you have a non-default set up, such as where the /boot partition is held. There is a nice Howto covering all of the configuration options in the Ubuntu Documentation.

Once you have made all the changes to the configuration that you need, you will want to run the update-grub script to recreate the generate file that grub reads at boot. Simply type “sudo update-grub” and you are finished. Reboot and enjoy.