Using GRUB

by Erich Boleyn


Contents

GRUB has both a simple menu interface for preset options from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands.

The first action GRUB takes after it is loaded is to look for it's configuration file. If one is not found, then it drops into the command-line interface (and stays there). If one is found, the full menu interface is activated containing whatever entries were found in the file (the command-line is still available via a command from the menu interface).


Command-Line Interface

The command-line interface provides a prompt and after it an editable text area much like a command-line in DOS or UNIX. Each command is immediately executed after it is entered. The list of commands are a subset of those available in the configuration file, used with exactly the same syntax.

Cursor movement and editing of the text on the line can be done via a subset of the functions available in the BASH shell (C-f forward, C-b backward, C-a beginning of line, C-e end of line, C-k delete to end, C-u delete to beginning; the PC left and right arrow keys, HOME, DELETE, and END work as well).

When typing commands interactively, if the cursor is before the "=" character in a command being typed, pressing the TAB key will display a listing of the available commands, and if the cursor is after the "=" character, the TAB will provide a completion listing of disks, partitions, and filenames depending on the context.


Menu Interface

The menu interface is quite easy to use. It's commands are both reasonably intuitive and described onscreen.

Basically, the menu interface provides a list of "boot configurations" to the user to choose from. Use the arrow keys to select the entry of choice, then press ENTER to run it. An optional timeout is available to boot the default entry (the first one if not set), which is aborted by pressing any key.

Commands are available to enter a bare command-line (operating exactly like the non-config-file version of GRUB, but allowing one to return to the menu if desired) or to edit any of the "boot configurations".


Menu Entry Editor

This looks much like the main menu interface, but with the lines in the menu being individual commands of the selected configuration instead of configuration names.

If an ESC is pressed in the editor, it aborts all the changes made to the configuration entry and goes back to the main menu interface.

When a particular line is selected, then it places the user in a special version of the command-line for editing that line. When the user is finished, GRUB replaces the line in question in the "boot configuration" with the changes (unless it was aborted via ESC, and in that case the changes are thrown away).


erich@uruk.org