Lab activity

GRUB2 Bootloader

Learn how to configure and troubleshoot GRUB2 boot settings, manage kernel parameters with GRUB2 and grubby, and verify bootloader changes across reboots.

Overview

In this lab, you will learn how to manage the GRUB2 bootloader configuration on RHEL systems. You will inspect and modify /etc/default/grub, regenerate the GRUB configuration, and understand how the Boot Loader Specification (BLS) stores kernel-specific boot entries. You will also use grubby to manage kernel parameters and default boot entries, reboot the system to verify that configuration changes take effect, and review troubleshooting techniques for GRUB2 and kernel boot issues.

Learning Outcomes

  • Understand the relationship between /etc/default/grub, grub.cfg, and BLS entries.
  • Inspect and modify GRUB2 bootloader configuration settings.
  • Configure the GRUB boot menu timeout.
  • Add and remove kernel command-line parameters.
  • Regenerate the GRUB2 configuration using grub2-mkconfig.
  • Inspect Boot Loader Specification entries under /boot/loader/entries/.
  • Use grubby to manage kernel parameters and boot entries.
  • Verify kernel parameters after reboot using /proc/cmdline.
  • Use system logs and GRUB configuration commands to troubleshoot bootloader issues.
  • Safely restore the original GRUB2 configuration after making changes.

Key Concepts

  • GRUB2: The bootloader used to load the Linux kernel and initiate the operating system during system startup.
  • /etc/default/grub: The human-edited GRUB2 configuration source file containing settings such as the boot menu timeout and kernel command-line parameters.
  • grub.cfg: The generated GRUB2 configuration that the bootloader uses during startup. It should not be edited directly.
  • Boot Loader Specification (BLS): A boot configuration standard where individual kernel entries are stored under /boot/loader/entries/.
  • grub2-mkconfig: Generates the GRUB2 configuration from the configured GRUB settings.
  • grubby: A RHEL tool used to manage kernel boot entries and kernel command-line parameters directly in BLS entries.
  • Kernel Parameters: Arguments passed to the Linux kernel during boot to control or configure kernel and system behavior.
  • /proc/cmdline: A runtime interface that displays the kernel command-line parameters used by the currently running system.

Why Needed?

  • Controls Boot Behavior: Allows administrators to configure how the system starts and which kernel options are applied.
  • Manages Kernel Parameters: Provides a controlled way to add or remove parameters required for troubleshooting and system configuration.
  • Supports Modern RHEL Boot Configuration: Builds practical understanding of BLS and how RHEL manages kernel boot entries.
  • Improves Troubleshooting: Helps administrators diagnose boot and kernel parameter problems using GRUB2 tools, logs, and runtime information.
  • Enables Safe Configuration Changes: Backing up and restoring the GRUB configuration allows changes to be tested without permanently altering the lab system.