Skip to main content
Welcome to this comprehensive guide on installing, configuring, and troubleshooting the GRUB2 bootloader on CentOS Stream 8. You’ll learn how to recover a non-booting system using rescue media, install GRUB in BIOS or UEFI mode, customize its settings, and verify your changes.
The image shows a boot menu for CentOS Stream 8-stream, offering options to install, test media, or troubleshoot.

1. Prerequisites

Before you begin, ensure you have:
  • A CentOS Stream 8 installation USB/DVD.
  • Physical or virtual access to the target machine.
  • A basic understanding of Linux shell commands.
You will need root (or sudo) privileges to run most commands in this tutorial.

2. Boot into Rescue Environment

  1. Insert your CentOS Stream 8 installation media and power on the machine.
  2. At the main menu, select TroubleshootingRescue a CentOS Stream System.
  3. Wait for system messages, then choose 1) Continue at the rescue prompt:
The installer will mount your root filesystem at /mnt/sysroot.

3. Chroot into Your System

Change root into the mounted filesystem:
You’re now operating inside your installed system as if you had booted normally.

4. Generate a New GRUB Configuration

GRUB’s configuration file must be regenerated after installation or any changes to /etc/default/grub. Use one of these commands:

5. Install GRUB to the Disk (BIOS Mode)

  1. Identify your disks:
    Example output:
    Here, /dev/sda is our target disk.
  2. Install GRUB to the MBR:
You should see:
Ensure you specify the correct disk (e.g., /dev/sda). Installing GRUB to the wrong device can overwrite another OS or data.

6. Exit Rescue Mode and Reboot

Exit the chroot environment and reboot the system:
Remove the installation media when prompted so the machine boots from the hard drive.

7. Customize GRUB Settings

Once back in your CentOS Stream system, you can fine-tune GRUB by editing /etc/default/grub:
A typical configuration:

Change the Boot Timeout

To reduce the wait time:
Save and exit (:wq in vi).

8. Regenerate Configuration After Edits

Apply your changes by regenerating grub.cfg:
Look for:

9. Verify and Test

Reboot one final time:
You should see the GRUB menu for the new timeout duration, and your kernel options will reflect any changes made in /etc/default/grub.

References

Watch Video