Fedora 32 does not boot using updated kernel
Using native Linode Grub2, and Fedora 32 distribution (created via vagrant-linode).
When I update the kernel:
# dnf update kernel-core
I expect the next reboot to use the updated kernel. But it does not.
My /etc/default/grub is:
GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="console=ttyS0,19200n8 net.ifnames=0 rhgb " GRUB_DISABLE_RECOVERY="true" GRUB_ENABLE_BLSCFG=true GRUB_TERMINAL=serial 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_GFXPAYLOAD_LINUX=text GRUB_UPDATE_DEFAULT_KERNEL=true
My reading of this BLS issue seemed to suggest that BLS was working, but might there be a problem with the Fedora 32 image?
If I set GRUB_ENABLE_BLSCFG=false in /etc/default/grub then do the following, it works.
# grub2-mkconfig -o /boot/grub2/grub.cfg # dnf reinstall kernel-core
Is BLS broken on Grub2 + Fedora 32?
I had exactly the same issue, and the same change resolved it for me.
I didn’t have enough time to look in detail at it, as I was in a production Linode at the time trying frantically to get it booting the latest kernel installed.
From what I could work out, the kernels were listed in reverse order with BLS enabled, so the latest was always bottom, with Grub always booting the first and ignoring the value of GRUB_DEFAULT, or that saved by grubby.
Disabling BLS got everything working “correctly” (at least from my POV, not necessarily from the developers!)
I need to deploy a new Linode, so I figured I'd look in more detail at this before it goes into service.
It seems like there is a GRUB "saved_entry" pointing to the initial kernel version (5.7.11 in my case) which always overrides any other configuration.
The steps below allow BLS to be used (in my initial testing; time will tell as newer kernels are released.)
- Deploy a Linode built on F32
- Edit the
/etc/default/grubfile and add in the following config:
This tells GRUB not to automatically save the selected option as the default.
- Run the following command to remove the saved_entry link to the original kernel:
grub2-editenv /boot/grub2/grubenv unset saved_entry
Update the GRUB config file:
grub2-mkconfig -o /boot/grub2/grub.cfg
Upgrade and reboot:
Following the reboot, the latest kernel should be automatically selected and used (in my case, 5.7.14.)
@andysh and @bradrubenstein - You're exactly correct. This has to do with the order in which Fedora 32 displays kernels. Our engineers deployed a fix that should allow newly created Fedora 32 Linodes to boot into the correct kernel. For existing Linodes created before the fix went out, you can edit your
/etc/default/grub file to set the saved kernel to whichever one you booted to last, and then run
grub2-mkconfig -o /boot/grub2/grub.cfg. You might need to manually select the kernel on your next reboot, but after that it should be automatic. You don't need to disable BLS if you go this route.
Thanks for this; but I'm still seeing the same behaviour on a fresh Linode built earlier today. The Linode is initially built with 5.7.11, after a
dnf upgrade, 5.7.14 is installed but the Linode always boots into 5.7.11.
In fact, even after rebuilding and following the instructions I posted that just worked for me, don't work! It seems very "hit and miss."
The only consistent way I've got this to work is to run
grub2-set-default 2 which forces GRUB to boot to index 2 (the 5.7.14 kernel) but I suspect this will then have the same effect when a new kernel update is released.
@andysh - Thanks for the info here. I'll follow up with the team that was handling fixing the image to let them know.
Just an update on this.
I’d built an image with my steps above in place and used this image to build my 2 Linodes and they were happily booting into 5.7.14 kernel post-update from the kernel in the Linode image (5.7.11) using BLS and without intervention.
Yesterday, kernel 5.7.15 was released for F32.
I ran a normal “dnf upgrade” on one of my Linodes, rebooted and GRUB automatically selected the new kernel (5.7.15) and booted it, again without intervention.
So I’m fairly confident in my fix/workaround.