Kernel update not applying

First post, so shoutout to the team! Thank you for providing us with an alternative to the other guys.

Running update, it installed the latest(?) kernel updates, but we’re not booting to it. Unsure how to proceed.

[root@uisp ~]# dnf check-update --security
Last metadata expiration check: 2:20:46 ago on Tue 03 Aug 2021 06:32:27 AM EDT.
Security: kernel-core-4.18.0-305.10.2.el8_4.x86_64 is an installed security update
Security: kernel-core-4.18.0-305.el8.x86_64 is the currently running version

Thanks,
-Troy

1 Like

Hmm, dnf check-update --security gives nothing on my system.

Being old-fashioned, I would look at what I have installed with:

rpm -qa kernel\*
uname -r

which should show several packages and “4.18.0-305.el8.x86_64”.

When you have multiple kernels installed, the bootloader (GRUB) should have a menuentry for each.
When you did reboot, where there multiple options?

The GRUB default is to boot the latest installed kernel, but that can be changed.
What do you have in /etc/default/grub?

Only 1 kernel and the rescue are available in the grub menu though 3 kernels are installed.

Found this, but no apparent resolution:

https://bugs.almalinux.org/view.php?id=56

[root@uisp ~]# uname -r
4.18.0-305.el8.x86_64

[root@uisp ~]# rpm -qa kernel\*
kernel-core-4.18.0-305.el8.x86_64
kernel-modules-4.18.0-305.7.1.el8_4.x86_64
kernel-4.18.0-305.10.2.el8_4.x86_64
kernel-headers-4.18.0-305.10.2.el8_4.x86_64
kernel-core-4.18.0-305.7.1.el8_4.x86_64
kernel-tools-libs-4.18.0-305.10.2.el8_4.x86_64
kernel-modules-4.18.0-305.10.2.el8_4.x86_64
kernel-modules-4.18.0-305.el8.x86_64
kernel-4.18.0-305.7.1.el8_4.x86_64
kernel-tools-4.18.0-305.10.2.el8_4.x86_64
kernel-core-4.18.0-305.10.2.el8_4.x86_64
kernel-4.18.0-305.el8.x86_64

[root@uisp ~]# ls /boot/loader/entries/
2fbdc3af2cda47c09273015e210dede9-0-rescue.conf
2fbdc3af2cda47c09273015e210dede9-4.18.0-305.10.2.el8_4.x86_64.conf
2fbdc3af2cda47c09273015e210dede9-4.18.0-305.7.1.el8_4.x86_64.conf
2fbdc3af2cda47c09273015e210dede9-4.18.0-305.el8.x86_64.conf

So, /boot/loader/entries is getting updated, but apparently not being used.

Sorry if I’m not asking the right questions, I chose RHEL-based distros because I was tired of constantly fixing things myself. As such, I’ve not touched grub in over a decade.

They tend to work out of the box. Personally, I dislike some of the default choices but they are relatively easy to change.

I presume that you have GRUB_ENABLE_BLSCFG=true in /etc/default/grub.
Check: grep GRUB_ENABLE_BLSCFG /etc/default/grub

The next check is that the grub.cfg is set to use blscfg:
sudo grep -B1 -A1 blscfg /boot/efi/EFI/almalinux/grub.cfg /boot/grub2/grub.cfg

Only one of those files exists.
If your system boots in EFI mode, then the grub.cfg is /boot/efi/EFI/almalinux/grub.cfg
If your system boots in legacy mode, then grub.cfg is /boot/grub2/grub.cfg

If you don’t get

insmod blscfg
blscfg
### END /etc/grub.d/10_linux ###

then the question is, what is in the grub.cfg (10_linux section)?

So no blscfg. The last reply in that bug report says it’s the default, but I’m not seeing that on this VM, so not 100% sure how to proceed.

### BEGIN /etc/grub.d/10_linux ###
menuentry 'AlmaLinux (4.18.0-305.el8.x86_64) 8.4 (Electric Cheetah)' --class almalinux --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.18.0-305.el8.x86_64-advanced-2a9eeb55-f741-4e92-b966-867c66023984' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  2a3f60df-1ceb-4e85-80b6-3dbdbea0e93b
        else
          search --no-floppy --fs-uuid --set=root 2a3f60df-1ceb-4e85-80b6-3dbdbea0e93b
        fi
        linux   /vmlinuz-4.18.0-305.el8.x86_64 root=UUID=2a9eeb55-f741-4e92-b966-867c66023984 ro crashkernel=auto resume=UUID=ee5a8e36-f83e-4884-90bd-c000aa522e79
        initrd  /initramfs-4.18.0-305.el8.x86_64.img
}
menuentry 'AlmaLinux (0-rescue-2fbdc3af2cda47c09273015e210dede9) 8.4 (Electric Cheetah)' --class almalinux --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-2fbdc3af2cda47c09273015e210dede9-advanced-2a9eeb55-f741-4e92-b966-867c66023984' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  2a3f60df-1ceb-4e85-80b6-3dbdbea0e93b
        else
          search --no-floppy --fs-uuid --set=root 2a3f60df-1ceb-4e85-80b6-3dbdbea0e93b
        fi
        linux   /vmlinuz-0-rescue-2fbdc3af2cda47c09273015e210dede9 root=UUID=2a9eeb55-f741-4e92-b966-867c66023984 ro crashkernel=auto resume=UUID=ee5a8e36-f83e-4884-90bd-c000aa522e79
        initrd  /initramfs-0-rescue-2fbdc3af2cda47c09273015e210dede9.img
}

### END /etc/grub.d/10_linux ###

Again, I see that the kernel packages are being installed, but grub.cfg is not being updated as expected. Manually running grub2-mkconfig fixes this, I just wanted to figure out why it didn’t happen automatically during the update process.

While it’s something we need to be aware of, this is the first time in over 10 years I’ve seen this behavior in an RHEL system.

What did it do, exactly? Did it add the

insmod blscfg
blscfg

or did it add menuentry stanzas?

Logic says that if installation of kernel adds a new file into /boot/loader/entries(as it does) and grub.cfg calls blscfg, then the grub.cfg does not need to change at all, when we add/remove kernels.

There is obviously an incoherent configuration, if the grub.cfg does not call blscfg, yet the kernel install acts like it does.

Disclaimer: I have not installed AlmaLinux, just migrated an existing CentOS Linux that uses BLS properly.

It just upgraded grub to the new kernel. Apparently, the default in alma is not to use the blscfg.

I need to check out my CentOS 8 VMs to see what their behavior is. Will also be installing a few actual RHEL 8 VMs soon (vendor requirements), so will have a variety of builds to compare.

Fascinating,

I did remove /etc/default/grub and reinstall grub2-tools.
The resulting /etc/default/grub contains only one line:

GRUB_ENABLE_BLSCFG=true

:astonished:

Furthermore, rpm -q --scripts grub2-tools shows that postinstall might run /sbin/grub2-switch-to-blscfg in some workflow.

I presume that the installer constructs /etc/default/grub with dark magick, or something else is peculiar.

I use the Longterm kernel from kernel.org, which is currently at 5.4.142 on AlmaLinux 8.4 without problem.

If you have the Elrepo repository installed, you have access to it.

Let me know if you need help.

Umm, … how does that relate to OP issue?

I think they are just trying to be helpful. Not directly related, but the good spirited comment is welcome.

The Topic Header was “Kernel update not applying”.

Just giving an alternative to the base Kernel, that was all.

I’m dealing with the same thing on one of our EFI servers.

grub2-pc-modules-2.02-123.el8_6.8.alma.noarch
grub2-tools-minimal-2.02-123.el8_6.8.alma.x86_64
grub2-tools-extra-2.02-123.el8_6.8.alma.x86_64
grubby-8.40-42.el8.x86_64
grub2-common-2.02-123.el8_6.8.alma.noarch
grub2-efi-x64-modules-2.02-123.el8_6.8.alma.noarch
grub2-tools-efi-2.02-123.el8_6.8.alma.x86_64
grub2-pc-2.02-123.el8_6.8.alma.x86_64
grub2-efi-x64-2.02-123.el8_6.8.alma.x86_64
grub2-tools-2.02-123.el8_6.8.alma.x86_64

blscfg is used in /boot/efi/EFI/almalinux/grub.cfg

efibootmfg reports that the default is AlmaLinux

I’ve tried changing timeouts but the machine seems to immediately boot to the same kernel (4.18.0-372.16.1.el8_6.x86_64) - not the latest (.19.1).

Any help would be appreciated.

How did you change the timeout?