How to generate BLS configuration files under /boot/loader/entries in Red Hat Enterprise Linux?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • GRUB2

Issue

  • No entries in /boot/loader/entries directory

  • System is upgraded from Red Hat Enterprise Linux 7 to Red Hat Enterprise Linux 8 but the system does not reflect entries under /boot/loader/entries directory or follows BLS framework

Resolution

  • Add the below entry in /etc/default/grub file:

      GRUB_ENABLE_BLSCFG=true
    
  • Generate the updated grub.cfg

    • For Red Hat Enterprise Linux 8, Legacy BIOS system: regenerate /boot/grub2/grub.cfg file

        [root@test ~] # grub2-mkconfig -o /etc/grub2.cfg
      
    • For Red Hat Enterprise Linux 8, UEFI system: regenerate /boot/efi/EFI/redhat/grub.cfg file

        [root@test ~] # grub2-mkconfig -o /etc/grub2-efi.cfg 
      
    • For Red Hat Enterprise Linux 9, regardless of the CPU architecture, i.e UEFI or Legacy BIOS, you need to generate the updated grub.cfg using:

           [root@test ~] # grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline
      

      NOTE: The /boot/efi/EFI/redhat/grub.cfg file, which GRUB previously used on UEFI systems, is now a stub redirecting to the /boot/grub2/grub.cfg file, which contains the real Grub configuration.

      Since RHEL 9.3, the default behavior of grub2-mkconfig is changed. Refer to Change in the default behavior of grub2-mkconfig

      If GRUB_ENABLE_BLSCFG is true, running the grub2-mkconfig -o /path/to/grub.cfg command makes all the changes to the grub.cfg file that had been made in the /etc/default/grub file. In such a case, BLS snippets do not get updated.

      --update-bls-cmdline option should be used to update BLS snippets.

      This is because of notable change documented in Product Documentation which simplifies the GRUB configuration file.

  • Generate the /boot/loader/entries

      [root@test ~] #  kernel-install add $(uname -r) /lib/modules/$(uname -r)/vmlinuz
    
      OR
      
      [root@test ~] # yum reinstall kernel-core-$(uname -r)
    

Root Cause

  • Missing GRUB_ENABLE_BLSCFG in /etc/default/grub file
SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.