Hi all, I’m setting up a new test server using the Almalinux 9.3 media.
Changes I make to /etc/default/grub to the kernel command line parameters aren’t taking effect. I notice that after I run grub2-mkconfig the resulting file in /boot/grub2/grub.cfg has my changes, but when I reboot and check dmesg the kernel is being booted with the original default parameters.
Maybe something changed or I’m doing something wrong. Why isn’t this working like it used to for me?
Thanks. I did doublecheck and this machine is set to legacy BIOS mode (there isn’t even a /boot/efi/EFI/AlmaLinux/grub.cfg file. Regardless though, using grubby worked. It made the changes to /etc/default/grub and whatever it did afterward worked while grub2-mkconfig -o /boot/grub2/grub.cfg didn’t. (must be more required after that now?)
In any case, grubby solved the problem and that’s what I’ll use going forward. Thanks for the tip again
UEFI mode has grub config in /boot/efi/EFI/almalinux/
In AlmaLinux 9:
Legacy mode has grub config in /boot/grub2/
UEFI mode has grub config in /boot/grub2/ too and /boot/efi/EFI/almalinux/grub.cfg is wrapper that loads /boot/grub2/grib.cfg
The RHEL 9.3 release notes tell:
With this update, the behavior of GRUB variables has changed as follows:
If you set the GRUB_ENABLE_BLSCFG= parameter to true, running the grub2-mkconfig -o /path/to/grub.cfg command makes all the changes to the grub.cfg file that you had made in the /etc/default/grub file except from the kernel command line. In such a case, BLS snippets do not get updated.
If you set the GRUB_ENABLE_BLSCFG= parameter to false, BLS snippets do not get updated, but the changes are still made to the grub.cfg file.
In case you want to update the kernel command line, enter:
Also note that you can make changes to BLS snippets for individual kernels using grubby:
# grubby --update-kernel /path/to/kernel --args "new args"
That (the options) seem a bit redundant. If user has learned that the grub config is dictated by /etc/default/grub but most update operations do use grubby, then the /etc/default/grub does not have to stay consistent with actual config and the user will become confused. Even more so, if automation has been adopted and it relies on (old behaviour of) grub2-mkconfig.