[F36] Boot stick at "Loading Linux <version> ..." after every kernel update

I’m using Fedora 36 on Surface Pro 7+, and primarily use the kernel-surface. But since the time I updated kernel-surface to 5.19.7-1.fc36.x86_64, I can’t boot normally and stuck at Loading Linux 5.19.7-1.surface.fc36.x86_64 ..., and my disk led indicator shows that no read/write is happening. And today I updated kernel to 5.19.8-200.fc36.x86_64, the issue happened again. So now I believe that the issue is not related to which kernel I use.

The solution is simple, boot to previous kernel and run sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg can fix the issue. But this issue surely isn’t normal, and it’s inconvenient to manually run the fix.

So is there anyone know how to fix this, or make the fix automatically? Thanks in advance.

That is a nasty solution since that file is only a pointer to the real grub.cfg file at /boot/grub2/grub.cfg (and has been since fedora 34 was released). A kernel update does not ever change that file with the config as it is today.

You will first need to fix the problem caused by running the grub2-mkconfig command by running
sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
then run
sudo dnf reinstall grub2-common grub2-efi*
followed by a reboot.

For future reference you may want to remember that the proper command is grub2-mkconfig -o /boot/grub2/grub.cfg or one of the others as is shown here.
https://fedoraproject.org/wiki/GRUB_2#Reinstalling_GRUB

Once it boots properly it should automatically work with every update. There was a glitch a few versions back where the update did not work properly, apparently due to something else that was updated at the same time, but that has been resolved and there have been few reports of problems since.

1 Like

Thanks a lot! I can’t test since no kernel update available, but thanks.

1 Like

The next kernel update will tell the tale. :nerd_face:

1 Like

Hello, I updated kernel-surface from 5.19.7 to 5.19.8 and ran into a new issue. My grub entries are not updated. The entry for the 5.19.7 one still exists though the package is already removed. And there’s no entry for the updated one. Could you help me with this?

If you are using a normal update procedure the upgrade of kernel keeps the one booted, the latest other than that, and installs the newer kernel so you should always have at least 3 kernels installed. Is that not the case on your machine?

If you can not boot to the latest installed kernel you should be able to select the last one booted from the grub menu. If you were booted from the 5.19.7 kernel when the update was done it is almost impossible for that kernel to have been removed.

Tell us if that is not the case and give us details as to why.

I’m using the installonly_limit=2 to remove the old kernels, but that shouldn’t stop new entries from being added, weird.

Using installonly-limit-2 forces dnf to keep only the kernel that is currently booted plus the new one installed and no others. The default limit of 3 allows only one additional kernel and gives a little more safety net when a problem is seen.

You are correct that it should not prevent a new kernel from being installed but things sometimes happen unexpectedly.

I do not however know how that relates to a Surface Pro machine.

Please confirm that GRUB_ENABLE_BLSCFG=true in the file /etc/default/grub and that grub2 is updated to the latest version.

1 Like

Thanks. I forgot I disbaled this and reverting it back fixed the new issue.