What is GRUB_ENABLE_BLSCFG in /etc/default/grub?
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
- GRUB 2
Issue
- After upgrading to RHEL 8 from RHEL 7,
GRUB_ENABLE_BLSCFG=truewas added in/etc/default/grubfile. - What if I delete
GRUB_ENABLE_BLSCFG=truefrom/etc/default/grubfile?
Resolution
- With
GRUB_ENABLE_BLSCFG=truein/etc/default/grub, GRUB2 uses blscfg files and entries in /boot/loader instead of menuentry entries in grub.cfg. It's the standard configuration since RHEL 8. - On RHEL 8, if GRUB_ENABLE_BLSCFG is removed or set to "false", grub.cfg generated by
grub2-mkconfigwill define the menu entries just as RHEL 7. - The default value of
GRUB_ENABLE_BLSCFGis "true" on RHEL 9. DeletingGRUB_ENABLE_BLSCFG=truefrom/etc/default/grubwon't disable BLS. User has to setGRUB_ENABLE_BLSCFG=falseto disable BLS. - Note On RHEL 8,
grub2-mkconfigis never run on kernel upgrade even if GRUB_ENABLE_BLSCFG=false, user has to rungrub2-mkconfigafter upgrading kernel. The issue is fixed in RHSA-2022:2110. - Note On RHEL 8, when
GRUB_ENABLE_BLSCFGis not set in/etc/default/grub,grub2-mkconfigis never run on kernel upgrade. User has to rungrub2-mkconfigafter upgrading kernel.
Diagnostic Steps
Disable BLS:
# grep BLS /etc/default/grub
GRUB_ENABLE_BLSCFG=false
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.14.0-42.el9.x86_64
Found initrd image: /boot/initramfs-5.14.0-42.el9.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-6c50dcebbd4843e89cd5bfb715c156a4
Found initrd image: /boot/initramfs-0-rescue-6c50dcebbd4843e89cd5bfb715c156a4.img
Adding boot menu entry for UEFI Firmware Settings ...
done
# grep ^menuent /boot/grub2/grub.cfg | awk -F\' '{ print $2 }'
Red Hat Enterprise Linux (5.14.0-42.el9.x86_64) 9.0 (Plow)
Red Hat Enterprise Linux (0-rescue-6c50dcebbd4843e89cd5bfb715c156a4) 9.0 (Plow)
Enable BLS:
# grep BLS /etc/default/grub
GRUB_ENABLE_BLSCFG=true
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
# grep ^menuent /boot/grub2/grub.cfg | awk -F\' '{ print $2 }'
# <== nothing output
SBR
Product(s)
Components
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.