How to generate BLS configuration files under /boot/loader/entries in Red Hat Enterprise Linux?
Environment
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
- GRUB2
Issue
-
No entries in
/boot/loader/entriesdirectory -
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/entriesdirectory or follows BLS framework
Resolution
-
Add the below entry in
/etc/default/grubfile:GRUB_ENABLE_BLSCFG=true -
Generate the updated
grub.cfg-
For
Red Hat Enterprise Linux 8, Legacy BIOS system: regenerate/boot/grub2/grub.cfgfile[root@test ~] # grub2-mkconfig -o /etc/grub2.cfg -
For
Red Hat Enterprise Linux 8, UEFI system: regenerate/boot/efi/EFI/redhat/grub.cfgfile[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 updatedgrub.cfgusing:[root@test ~] # grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdlineNOTE: The
/boot/efi/EFI/redhat/grub.cfgfile, which GRUB previously used on UEFI systems, is now a stub redirecting to the/boot/grub2/grub.cfgfile, 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_BLSCFGis true, running thegrub2-mkconfig -o /path/to/grub.cfgcommand 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-cmdlineoption 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_BLSCFGin/etc/default/grubfile
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.