I’ve been flailing a bit trying to figure out how Rocky 8.x does boot management, and after a few false starts trying to figure this out, it looks it’s systemd-boot.
I ended up way down a rabbit hole because grubby and the various grub2 packages are also installed, but that looks like a red herring, so now what I’m trying to reconcile is how to get bootctl to recognize what’s in /boot/loader/entries, although I just copied the contents into /boot/efi/loader/entries. bootctl recognizes them (with errors) but can’t boot from them, and ends up failing through to GRUB, which can.
So I guess after multiple edits of this posting, I think my question is: what is the default boot manager for Rocky?
And what about the default boot loader?
And when the boot manager is GRUB, is /etc/default/grub still the correct place to make changes?
And when using EFI, is /etc/grub2-efi.cfg the correct target when running grub2-mkconfig?
grub.cfg does control the basic behavior of grub and booting. Are you sure you are installed and booting via UEFI? Your /boot/efi/EFI/rocky directory does not appear normal.
[root@xmpp01 ~]# ls -l /boot/efi/EFI/rocky/
total 6100
-rwx------. 1 root root 130 Nov 17 22:29 BOOTX64.CSV
-rwx------. 1 root root 144 Jul 14 2022 grub.cfg
-rwx------. 1 root root 7028 Jul 14 2022 grub.cfg.rpmsave
-rwx------. 1 root root 2525120 Feb 14 12:06 grubx64.efi
-rwx------. 1 root root 856856 Nov 17 22:29 mmx64.efi
-rwx------. 1 root root 947216 Nov 17 22:29 shim.efi
-rwx------. 1 root root 947216 Nov 17 22:29 shimx64.efi
-rwx------. 1 root root 939648 Nov 17 22:29 shimx64-rocky.efi
You’re missing many efi files. You might want to check if /sys/firmware/efi exists, which will tell you if you are indeed booting via UEFI. You should also have an entirely separate /boot/efi partition, which is a requirement in UEFI scenarios.
Given the contents of your EFI/rocky directory I can give a basic outline of how it should work.
First in /etc there should be two grub links pointing to /boot/grub2/grub.cfg
The grub.cfg in rocky is a stub file pointing to the partition that contains your vmlinuz and boot loader files /boot/loader/entries
To update the grub menu parameter (not kernel parameters ) like the timeout the command is:
grub2-mkconfig -o /boot/grub2/grub.cfg
To change kernel parameters you have to use the grubby command. Read the man page. But, understand that to add parameters you have to state all the kernel commandline parameters as grubby can’t append. What that means in particular is that when adding parameters you have to state all of them including the “root=UUID=” portion of the commandline.
If the /boot/efi was quite empty, then the system does not boot with EFI, but in legacy mode – how could you have booted?
Therefore, adding files to /boot/efi does not help anything.
In legacy mode the grub.cfg and grubenv are in /boot/grub2/. The symlink “grubenv” in that location is confusing.
You have Rocky 9, don’t you? Rocky 8 and 9 do differ.
Yes I am on rocky 9. I guess the real test if the OP is booting efi or not is just to issue this command:
efibootmgr
So looks like they screwed up the links in /etc by installing the efi file system. But even so the command to update the grub.cfg is as I indicated.
So the efi file system installed a grub.cfg stub file in /rocky which is counter intuitive if rocky 8 uses the old format where grub.cfg in EFI/ rocky is the real config. Confusing.
As it turned out, /boot/efi was going missing from /etc/fstab due to a bug in one of our in-house pieces of automation. Definitely Rocky 8, definitely using EFI to boot, just no mount of the EFI partition when the system was running.
I built a new VM where /boot/efi is once again present as expected, and lo and behold, expectations are now met when I modify /etc/default/grub and run grub2-mkconfig /etc/grub2-efi.cfg.
Sorry for the long, convoluted original post, and then the somewhat confusing edit, and thank you @nazunalika for your sanity check. Definitely LUSER error.