Using the GRUB Menu to Alter the Boot Sequence





Last Updated on 07/24/2009 by dboth

GRUB, the GRand Unified Bootloader can be used to manage the boot sequence. Two ways to do this are by changing /boot/grub/grub.conf (or the link /etc/grub.conf) and by modification of the boot sequence during the boot itself using the GRUB menu. Any configuration changes made to grub.conf are permanent and will persist through reboots. Configuration changes made through the GRUB menu are transient and will only be valid for the current boot.

The document Configuring GRUB discusses making permanent changes by modification of the grub.conf file. This document covers using the GRUB Menu to make changes that are only valid for the current boot.

Accessing the GRUB Menu

During the boot process, GRUB, when configured correctly, allows you to press any key to enter the menu. Figure 1 shows the GRUB splash screen. If you use the up or down arrow keys, you can simply select the kernel to boot and then press the Enter key to boot the selected kernel.

Press any key before the timer expiers in order to enter the GRUB Menu.

Figure 1: Press any key before the timer expires in order to enter the GRUB Menu or use the up and down arrow keys to select a different kernel to boot.

For other actions you can press the “e” key to enter Edit more, or the “a” key to go directly to editing the kernel parameters.

Figure 2: This screen allows selection of a line from the kernel stanza to edit. Use the arrow keys to select the desired line and press the "e" key to enter Edit mode.

Figure 2: This screen allows selection of a line from the kernel stanza to edit. Use the arrow keys to select the desired line and press the "e" key to enter Edit mode.

After selecting a kernel to edit,use the arrow keys to select a line to edit then press the “e” key to edit that line. Then press  the Enter key when you have competed editing the desired line. Press the “b” key to boot the modified kernel stanza.

Figure 3: Editing the kernel line.

Figure 3: Editing the kernel line. In this case I have appended a "1" to the kernel line so that Linux will boot into runlevel 1.

In Figure 3 I have edited the kernel line by appending a “1”. This specifies that the system is to boot into runlevel 1.

Note that this is actually an init parameter rather than a kernel parameter. Parameters that are appended to the kernel line of the boot stanza which are not recognized by the kernel itself are passed on to init. Refer to the document Kernel Boot Parameters for more information.





Leave a Reply