Grub2-mkconfig RL9.3 fresh install bug

I just noticed this bug in rocky linux 9.3

grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg not working as inteneded, like in previous versions.

I edit this file /etc/default/grub to add for example intel_iommu=on to the GRUB_CMDLINE_LINUX like so.

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=“console”
GRUB_CMDLINE_LINUX=“crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M rd.lvm.lv=rl/root intel_iommu=on”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=true

The I run grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg like usual, all goes ok, then when I reboot the machine and look at the grub command with “e”

The grub doesn’t get updated with my changes, I tried this with RL9.2 and it’s working correctly, fresh install of RL9.3 doesn’t work, and if you update from 9.2 to 9.3 it stops working.

Way to reproduce:

Install a fresh copy of RL9.3 minimal with all the defaults, change the values in /etc/default/grub then run grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg reboot the machine wait for the grub bootleader menu to load press “e” to edit then notice that your changes are not there.

Thanks I’ll try to find a workaround so far only works in 9.2 and my changes do stay if I add the changes in 9.2 then update to 9.3, not sure what could be happening here.

Thanks :slight_smile:

Looking at the grub.cfg file I can see the changes are there.

Grub config was “normalized” for non-efi and efi systems. Use

grub2-mkconfig -o /etc/grub2.cfg

Oh I see the symlink has changed location

I’ll try this.

Thank you

BTW, its good practice to not upload pictures. Instead include the content as preformatted text, that allows to be found when searched … :slight_smile:

What you’re experiencing won’t be a bug. If the suggested command does not work for you still, consider adding --update-bls-cmdline. You may also want to consider using grubby instead.

grubby --update-kernel=ALL --args='...'

See below for context.

https://bugzilla.redhat.com/show_bug.cgi?id=2203203

https://bugzilla.redhat.com/show_bug.cgi?id=2212320

https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

https://fedoraproject.org/wiki/GRUB_2

1 Like

BS"D
I experienced the same problem. Even updating /etc/grub2.cfg did not work for me until I added the extra argument mentioned by nazunalika

grub2-mkconfig --update-bls-cmdline -o /etc/grub2.cfg

That worked.
Thanks!

Indeed.

In el8 (and el7) the grub.cfg is in /boot/efi/EFI/${VENDOR}/ for EFI system and in /boot/grub2/ for legacy system.
If el9 the actual grub.cfg is in /boot/grub2/ for both, and EFI system has in /boot/efi/EFI/${VENDOR}/ a stub that you don’t want to change after install. An example stub:

search --no-floppy --fs-uuid --set=dev 14fba..5e95
set prefix=($dev)/grub2

export $prefix
configfile $prefix/grub.cfg

where 14fba..5e95 is UUID of the filesystem that has the content of /boot/.
Hence the last line is effectively: configfile /boot/grub2/grub.cfg

One can restore the stub by setting correct UUID (that both blkid and lsblk -f do show) to sample above.


The grub2-mkconfig does apparently follow symlinks, because it can modify grubenv and BLS entries and the former is with actual grub.cfg.

I tried doing grub2-mkconfig -o /boot/grub2/grub.cfg and It did not work, what is the best practice to modify this, seems like things change much. Thank You

My bad sorry I missed this grub2-mkconfig --update-bls-cmdline -o /boot/grub2/grub.cfg this works.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.