Skip to main content
In this lesson we work directly with the system bootloader — specifically GRUB2 on RHEL 10 — to inspect and safely modify which kernel is selected and what kernel parameters are passed at boot. When a machine powers on, firmware (BIOS or UEFI) initializes hardware and then hands control to the bootloader. The bootloader’s job is to decide which kernel to load and how to invoke it. Without a correct bootloader configuration, a system may fail to boot or boot with incorrect kernel options.
A dark-themed slide titled "Modifying the System Bootloader" showing a three-step flowchart: 01 Power on, 02 Bootloader activates, and 03 Operating System selection, each in its own box with teal icons. The layout uses a navy background and minimal teal-and-white accents.
GRUB2 (GNU GRand Unified Bootloader) is the default bootloader in RHEL 10. It runs immediately after system firmware, loads the chosen Linux kernel into memory, and passes any command-line arguments you specify. Think of GRUB2 as the bridge between firmware and the operating system kernel.
A dark-themed slide titled "Bootloader" showing three panels that explain GRand Unified Bootloader (GRUB2) as the default in RHEL 10, that it runs immediately after firmware (BIOS/UEFI), and that it bridges firmware and the Linux kernel. Each panel features a simple blue icon above the text.

Use grubby — the safe tool for kernel entries and kernel arguments

On RHEL 10, avoid hand-editing the generated GRUB configuration file (for example, /boot/grub2/grub.cfg on BIOS systems). Use grubby to query and modify kernel entries and kernel command-line arguments safely. Use grub2-mkconfig only to regenerate the grub.cfg after you update configuration sources such as /etc/default/grub or scripts under /etc/grub.d/.

Common grubby commands

Examples and commands you’ll use

List installed kernel RPMs:
Show all boot entries and their arguments:
Check which kernel is the current default:
Set a different default kernel (use the full path from --info=ALL):
Add a kernel argument to all installed kernels (example: disable SELinux at boot):
Verify that the argument was added:
Remove the kernel argument:
Verify it was removed:

Where grubby makes changes

grubby updates the kernel entries GRUB2 uses at boot time:
  • On BIOS-based systems, the active GRUB configuration is at /boot/grub2/grub.cfg.
  • On UEFI systems, GRUB files are typically placed on the EFI system partition — e.g. /boot/efi/EFI/redhat.
Example listing on a BIOS system:

Regenerate GRUB configuration after editing configuration sources

Only run grub2-mkconfig after you update configuration sources such as /etc/default/grub or scripts under /etc/grub.d/.
  • BIOS systems:
  • UEFI systems (example path):
Before changing GRUB configuration files, back up the current configuration — for example, copy /boot/grub2/grub.cfg and files under /etc/default. Prefer grubby for per-kernel parameter changes instead of editing grub.cfg directly.
Manual edits to /boot/grub2/grub.cfg are error-prone and can render a system unbootable. Only edit generated grub.cfg temporarily if you have a recovery plan (rescue media or alternate boot methods). When in doubt, use grubby or update /etc/default/grub and regenerate with grub2-mkconfig.

When to use grubby vs. direct edits

  • Use grubby to:
    • Add or remove kernel command-line arguments safely.
    • Set the default kernel without manually editing grub.cfg.
  • Use grub2-mkconfig after updating configuration sources in /etc/default/grub or /etc/grub.d/.
  • Avoid hand-editing /boot/grub2/grub.cfg except for temporary troubleshooting with a recovery plan in place.

Summary

  • GRUB2 is the bootloader used on RHEL 10 and runs directly after BIOS/UEFI firmware.
  • Use grubby to inspect installed boot entries, change the default kernel, and add or remove kernel boot arguments safely.
  • Regenerate the active grub.cfg with grub2-mkconfig -o <path> only after updating configuration sources.
  • Always back up existing GRUB files before making changes to avoid rendering the system unbootable.
A dark-themed presentation slide titled "Summary." It lists three bullets about boot and recovery tasks: selecting the correct boot target, resetting the root password when administrative access is lost, and troubleshooting startup issues.
This completes the lesson on modifying the system bootloader and safely managing kernel boot parameters.

Watch Video