I’ve noticed that my AlmaLinux 8.6 system on Linode experiences the following error on boot:
error: file /boot/grub/grubenv not found.
/boot/grub2/grubenv
seems to exist and has contents:
$ cat grubenv
# GRUB Environment Block
saved_entry=4f09fa5fdd3642fa85221d7c11370603-4.18.0-372.9.1.el8.x86_64
kernelopts=root=/dev/sda ro crashkernel=auto rhgb console=ttyS0,19200n8 net.ifnames=0
boot_indeterminate=2
boot_success=1
######################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
Any idea as to why the above error is showing up and does not actually save and boot this when selected and the second entry?
For example, /etc/default/grub
contains:
GRUB_TIMEOUT=30
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL="console serial"
GRUB_TERMINAL_OUTPUT="console serial"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb console=tty0 console=ttyS0,19200n8 net.ifnames=0"
GRUB_DISABLE_RECOVERY="true"
GRUB_DISABLE_OS_PROBER=true
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"
GRUB_DISABLE_LINUX_UUID=true
GRUB_GFXMODE=1024x768x32
GRUB_ENABLE_BLSCFG=false
And $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
yields:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.18.0-372.19.1.el8_6.x86_64
Found linux image: /boot/vmlinuz-4.18.0-372.9.1.el8.x86_64
Found initrd image: /boot/initramfs-4.18.0-372.9.1.el8.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-4f09fa5fdd3642fa85221d7c11370603
Found initrd image: /boot/initramfs-0-rescue-4f09fa5fdd3642fa85221d7c11370603.img
done
So when I reboot and actually pick entry 2 (actually 1
since it starts on 0s
, but you get the idea) and then reboot again, GRUB 2
actually choses entry #1 (0
again in reality) and does not keep the second entry selected on subsequent boots.
So I’d like to resolve both the error about /boot/grub/grubenv
being missing as well as why the selected kernel does not stay selected between boots.