I can't get RHEL8 to use latest kernel
I'm running RHEL 8.5 on an EC2 instance in AWS and I can't get it to run on the latest kernel.
[ec2-user@ip-10-10-2-220 ~]$ rpm -qa | grep ^kernel
kernel-modules-4.18.0-348.20.1.el8_5.x86_64
kernel-core-4.18.0-305.el8.x86_64
kernel-4.18.0-348.20.1.el8_5.x86_64
kernel-tools-libs-4.18.0-348.20.1.el8_5.x86_64
kernel-4.18.0-305.el8.x86_64
kernel-tools-4.18.0-348.20.1.el8_5.x86_64
kernel-modules-4.18.0-305.el8.x86_64
kernel-core-4.18.0-348.20.1.el8_5.x86_64
[ec2-user@ip-10-10-2-220 ~]$ uname -r
4.18.0-305.el8.x86_64
[ec2-user@ip-10-10-2-220 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 32G 17M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/nvme0n1p2 128G 4.4G 124G 4% /
/dev/nvme1n1p1 495M 413M 83M 84% /boot
/dev/mapper/newdirs-home 5.0G 128M 4.9G 3% /home
/dev/mapper/newdirs-tmp 2.0G 58M 2.0G 3% /tmp
/dev/mapper/newdirs-var 2.0G 756M 1.3G 38% /var
/dev/mapper/newdirs-var_tmp 2.0G 47M 2.0G 3% /var/tmp
/dev/mapper/newdirs-var_log 2.0G 1.9G 120M 95% /var/log
/dev/mapper/newdirs-var_log_audit 2.0G 2.0G 51M 98% /var/log/audit
tmpfs 6.3G 0 6.3G 0% /run/user/1000
[ec2-user@ip-10-10-2-220 ~]$ ls /boot
config-4.18.0-305.el8.x86_64 initramfs-4.18.0-305.el8.x86_64.img System.map-4.18.0-305.el8.x86_64
config-4.18.0-348.20.1.el8_5.x86_64 initramfs-4.18.0-305.el8.x86_64.img.06-12-004514.bak System.map-4.18.0-348.20.1.el8_5.x86_64
efi initramfs-4.18.0-305.el8.x86_64kdump.img vmlinuz-0-rescue-bd6cf7372f924f33ab49bd9e121a3895
grub2 initramfs-4.18.0-348.20.1.el8_5.x86_64.img vmlinuz-0-rescue-cc248e8c4ee74660b67b51ef99a7837a
initramfs-0-rescue-bd6cf7372f924f33ab49bd9e121a3895.img loader vmlinuz-4.18.0-305.el8.x86_64
initramfs-0-rescue-cc248e8c4ee74660b67b51ef99a7837a.img symvers-4.18.0-348.20.1.el8_5.x86_64.gz vmlinuz-4.18.0-348.20.1.el8_5.x86_64
I have tried reinstalling and rebooting with no success. I followed the solution here here with no errors, but still no new kernel after a reboot.
Responses
Hello John,
It looks to be me that it has successfully installed the latest kernel, but failed to update it as the current one. Do you see the list as given below when you run the command "grubby --info=ALL":
index=0
kernel="/boot/vmlinuz-4.18.0-348.20.1.el8_5.x86_64"
args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet $tuned_params"
root="/dev/mapper/rhel-root"
initrd="/boot/initramfs-4.18.0-348.20.1.el8_5.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (4.18.0-348.20.1.el8_5.x86_64) 8.5 (Ootpa)"
id="b67413d511a9427ba9748f17924cbab7-4.18.0-348.20.1.el8_5.x86_64"
Also, verify what does the file '/boot/grub2/grubenv' shows. If that is not properly set to the latest saved kernel entry then this can reset with the command "grub2-set-default 0". Good to verify if the link file in /etc/grub2.cfg exists and pointing to /boot/grub2/grub.cfg file. Another point to mention here is that the space under /boot & /var as per your "df" command output is showing less, make sure to get the space increased. You may remove older (current -2) kernel packages if not required. Better to verify if the defaults are not changed in '/etc/sysconfig/kernel' file. This file should have the defaults as "UPDATEDEFAULT=yes" & "DEFAULTKERNEL=kernel", verify this. It also helps the community if you could show all these file contents for further diagnosis.
Note: The default kernel entry can also be set or changed using the "grubby" command in RHEL8/9. Please refer this KB https://access.redhat.com/solutions/4326431
Yes, that looks perfect as well to me. Try setting the default kernel using this command "grubby --set-default-index=0", and later reboot and test if that helps. Just noticed that some people have reported stating that grub2-set-default didn't work on RHEL8.x versions and only "grubby" did work well.
If you attempt to choose the latest kernel stanza/line while the system is booting up i.e when grub prompts up on the screen, would that loads the latest kernel successfully? If you have console access then you could check this. Also, send the output of these commands:
# du -sh /boot/*
# cat /etc/default/grub
# grubby --default-kernel; grubby --default-index; grubby --default-title
It could be the order of the files in /boot/loader/entries/. You could try forcing it onto the latest kernel at next reboot via
grub2-reboot 'cc248e8c4ee74660b67b51ef99a7837a-4.18.0-348.20.1.el8_5.x86_64'
where the setting is the id of the kernel you want as listed in your grubby output.