- Print
- PDF
Rocky Linux 8
- Print
- PDF
Available in VPC
This guide describes how to update a kernel on the Rocky Linux 8 server of NAVER Cloud Platform.
This guide is written based on new servers created on NAVER Cloud Platform, so there might be differences from the user server environment. User server environments may be affected by kernel updates and server restarts due to various reasons such as security hardening tasks and various setting tasks. Therefore, check the following before you perform a kernel update:
- Create a replicated server using Server image before updating a kernel of the actual server. Perform the kernel update on the replicated server and check if it restarts normally. When switching to operational status after restarting, check for any issues in the server. Proceed with the server kernel update only when no issues are found after thorough validation.
- In the case of GPU servers, the GPU driver that matches the kernel version must be installed for normal operation. If the updated kernel isn't compatible with GPU drivers, the GPU server might not function normally. Therefore, check GPU driver compatibility before you perform kernel updates. For related information, see GPU driver guide.
- NAVER Cloud Platform has not tested all kernel versions after each update. As of July 1, 2024, the kernel version tested on Rocky Linux 8 is 4.18.0-553.5.1.el8_10.x86_64.
You do not necessarily have to install the kernel version specified in the kernel guide. Proceed with the installation after you test other versions in the guide sufficiently, as needed. - NCP Repo is a repository provided by NAVER Cloud Platform to support user environments where external access is limited, such as VPC private subnet. For more information, see Linux OS Repository settings inspection guide.
- The user is entirely responsible for performing the user's server kernel updates. NAVER Cloud Platform does not take responsibility for issues caused by kernel updates.
- Normal server usage might be unavailable during kernel updates and restart, and recovery due to this is not supported. In addition, server recovery is not supported when the kernel update fails.
- Before updating the kernel, be sure to keep the backup created through Server image until it is no longer needed.
- No separate support is provided for problems related to this guide.
Update kernel
To update kernels for Rocky Linux 8 servers, follow these steps:
Access the server you want to apply the kernel update to remotely.
Check the kernel version of the server.
- XEN Rocky Linux 8.6
[root@rockylinux86 ~]# uname -r 4.18.0-372.32.1.el8_6.x86_64
- XEN Rocky Linux 8.8
[root@rockylinux88 ~]# uname -r 4.18.0-477.13.1.el8_8.x86_64
- XEN KVM Rocky Linux 8.8
[root@kvm-rockylinux88 ~]# uname -r 4.18.0-477.27.1.el8_8.x86_64
Check the repository information connected to the server.
[root@rockylinux88 ~]# grep -e ^mirrorlist -e ^baseurl /etc/yum.repos.d/Rocky-{AppStream,BaseOS,Extras}.repo /etc/yum.repos.d/Rocky-AppStream.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/ /etc/yum.repos.d/Rocky-BaseOS.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/ grep: /etc/yum.repos.d/Rocky-Extras.repo: No such file or directory
See Rocky Linux Repository settings inspection guide to edit Repo files, and check the changed repository information.
[root@rockylinux88 ~]# grep -e ^mirrorlist -e ^baseurl /etc/yum.repos.d/Rocky-{AppStream,BaseOS,Extras}.repo /etc/yum.repos.d/Rocky-AppStream.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/ /etc/yum.repos.d/Rocky-BaseOS.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/ /etc/yum.repos.d/Rocky-Extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/extras/$basearch/os/
Check the kernel version provided by the repository.
NoteFor more information on how to check the latest kernel version depending on the time when you perform the guide, see Linux OS Repository settings inspection guide.
NoteIf you do not use --releasever=8.10 as the dnf command option, you might not be able to view the latest 8.10 kernel. In this case, see the Change dnf command settings of Rocky Linux 8 servers on Linux OS Repository settings inspection guide to change the dnt command settings.
[root@kvm-rockylinux88 ~]# rm -rf /var/cache/dnf/* [root@kvm-rockylinux88 ~]# dnf --releasever=8.10 list kernel-4.18.0-553.5.1.el8_10 Available Packages kernel.x86_64 4.18.0-553.5.1.el8_10 baseos
Install the viewed version of the kernel. Here, proceed with the assumption of 4.18.0-553.5.1.el8_10.
Carefully review the list of packages being newly installed, updated, or removed. If everything is in order, enter y to complete the installation.- KVM Rocky Linux 8.8
[root@kvm-rockylinux88 ~]# dnf --releasever=8.10 install kernel-4.18.0-553.5.1.el8_10 Last metadata expiration check: 0:01:32 ago on Wed 12 Jun 2024 02:00:49 PM KST. Dependencies resolved. ================================================================================================================================================================= Package Architecture Version Repository Size ================================================================================================================================================================= Installing: kernel x86_64 4.18.0-553.5.1.el8_10 baseos 10 M kernel-core x86_64 4.18.0-553.5.1.el8_10 baseos 43 M kernel-modules x86_64 4.18.0-553.5.1.el8_10 baseos 36 M Transaction Summary ================================================================================================================================================================= Install 3 Packages Total download size: 90 M Installed size: 96 M Is this ok [y/N]: y (Check the installed packages, updated packages, and deleted packages carefully, and proceed with y if there are no abnormalities) ... Omitted ... Installed: kernel-4.18.0-553.5.1.el8_10.x86_64 kernel-core-4.18.0-553.5.1.el8_10.x86_64 kernel-modules-4.18.0-553.5.1.el8_10.x86_64 Complete!
After the installation is complete, check the bootable kernel version and the default boot kernel version.
NoteFor XEN Rocky Linux 8, grub2 is the default, and for KVM Rocky Linux 8, BootLoaderSpec Configuration (BLSCFG) is the default. Thus, XEN Rocky Linux 8 uses grub2 commands, and KVM Rocky Linux 8 uses grubby commands.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grep BLSCFG /etc/default/grub [root@rockylinux88 ~]# [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian) [root@rockylinux88 ~]# ls -ld /etc/grub2* lrwxrwxrwx. 1 root root 22 Apr 29 2023 /etc/grub2.cfg -> ../boot/grub2/grub.cfg [root@rockylinux88 ~]# grub2-mkconfig -o /etc/grub2.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64 Found initrd image: /boot/initramfs-4.18.0-553.5.1.el8_10.x86_64.img Found linux image: /boot/vmlinuz-4.18.0-477.13.1.el8_8.x86_64 Found initrd image: /boot/initramfs-4.18.0-477.13.1.el8_8.x86_64.img Found linux image: /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64 Found initrd image: /boot/initramfs-4.18.0-477.10.1.el8_8.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6 Found initrd image: /boot/initramfs-0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6.img done [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian) [root@rockylinux88 ~]# grub2-editenv list saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-553.5.1.el8_10.x86_64 boot_success=0 [root@rockylinux88 ~]# grub2-set-default "Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian)" [root@rockylinux88 ~]# grub2-editenv list saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) boot_success=0
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grep BLSCFG /etc/default/grub GRUB_ENABLE_BLSCFG=true [root@kvm-rockylinux88 ~]# grubby --info=ALL | grep ^kernel kernel="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64" kernel="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64" kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64" kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9" [root@kvm-rockylinux88 ~]# grubby --default-kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
If the default boot kernel version is different from the installed kernel version, change the default boot kernel.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian) [root@rockylinux88 ~]# grub2-set-default "Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian)" [root@rockylinux88 ~]# grub2-editenv list saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) boot_success=0
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grubby --info=ALL | grep ^kernel kernel="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64" kernel="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64" kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64" kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9" [root@kvm-rockylinux88 ~]# grubby --set-default="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64" The default is /boot/loader/entries/2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-553.5.1.el8_10.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64 [root@kvm-rockylinux88 ~]# grubby --default-kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
Reboot the server to activate the latest kernel version.
[root@kvm-rockylinux88 ~]# sync;reboot
NoteIf the server reboot fails, it means the kernel update was not performed normally. In this case, see Restore kernel update to revert to the previous kernel version.
Log in to the server again and check if the new kernel is activated.
- XEN Rocky Linux 8.6
[root@rockylinux86 ~]# uname -r 4.18.0-553.5.1.el8_10.x86_64
- XEN Rocky Linux 8.8
[root@rockylinux88 ~]# uname -r 4.18.0-553.5.1.el8_10.x86_64
- KVM Rocky Linux 8.8
[root@kvm-rockylinux88 ~]# uname -r 4.18.0-553.5.1.el8_10.x86_64
NoteTo check if the updated kernel is properly applied, see Checking kernel updates to check the kernel installation status.
Change dnf command settings on Rocky Linux 8 server
When running the dnf list kernel command on Rocky Linux 8, the latest 8.10 kernel may not be visible. In this case, see Rocky Linux Repository settings inspection guide.
To ensure compatibility with other services on NAVER Cloud Platform, the DNF settings for the Rocky Linux 8.6 and 8.8 servers are fixed to 8.6 and 8.8 only. You can remove this setting or add the dnf command option to direct the settings toward other versions than 8.6 and 8.8 as well.
Pending error in Extras when running the dnf command on KVM Rocky Linux 8.8
If the dnf command is not running smoothly on KVM Rocky Linux 8.8 server, see Linux OS Repository settings inspection guide FAQ.
Check kernel update
To check if the kernel update is applied normally, follow these steps:
Access to the server remotely.
Check if the kernel package is installed.
[root@kvm-rockylinux88 ~]# rpm -qa | grep kernel-4.18.0-553.5.1.el8_10.x86_64 kernel-4.18.0-553.5.1.el8_10.x86_64
Check if the initramfs file and vmlinuz file are created in the /boot directory.
NoteThe /boot/initramfs-<kernel_version>.x86_64kdump.img file may not be created depending on settings.
[root@kvm-rockylinux88 ~]# ls -l /boot/initramfs-4.18.0-553.5.1.el8_10.x86_64.img -rw------- 1 root root 29468005 Jun 12 14:03 /boot/initramfs-4.18.0-553.5.1.el8_10.x86_64.img [root@kvm-rockylinux88 ~]# ls -l /boot/initramfs-4.18.0-553.5.1.el8_10.x86_64kdump.img -rw------- 1 root root 25120768 Jun 12 16:00 /boot/initramfs-4.18.0-553.5.1.el8_10.x86_64kdump.img [root@kvm-rockylinux88 ~]# ls -l /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64 -rwxr-xr-x 1 root root 10873160 Jun 6 18:56 /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
Check if the latest kernel settings are registered.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian) [root@rockylinux88 ~]# ls -l /boot/loader/entries total 16 -rw-r--r--. 1 root root 405 May 30 2023 a4746ff35a7a4d2a9f4280ec20051fb6-0-rescue.conf -rw-r--r--. 1 root root 368 May 30 2023 a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-477.10.1.el8_8.x86_64.conf -rw-r--r--. 1 root root 368 Jun 23 2023 a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-477.13.1.el8_8.x86_64.conf -rw-r--r-- 1 root root 369 Jun 12 18:49 a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-553.5.1.el8_10.x86_64.conf
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grubby --info=ALL | grep ^kernel kernel="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64" kernel="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64" kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64" kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9" [root@kvm-rockylinux88 ~]# ls -l /boot/loader/entries total 16 -rw-r--r--. 1 root root 405 Jun 14 2023 2faf2183dcf14a70b2b32e1b9fe6e4e9-0-rescue.conf -rw-r--r--. 1 root root 368 Jun 14 2023 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-477.10.1.el8_8.x86_64.conf -rw-r--r--. 1 root root 368 Mar 11 16:32 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-477.27.1.el8_8.x86_64.conf -rw-r--r-- 1 root root 369 Jun 12 14:03 2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-553.5.1.el8_10.x86_64.conf
Check the grub settings.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grep GRUB_DEFAULT /etc/default/grub GRUB_DEFAULT=saved [root@rockylinux88 ~]# cat /boot/grub2/grubenv # GRUB Environment Block saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) boot_success=0 ... Omitted ... [root@rockylinux88 ~]# grub2-editenv list saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) boot_success=0
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grep GRUB_DEFAULT /etc/default/grub GRUB_DEFAULT=saved [root@kvm-rockylinux88 ~]# cat /boot/grub2/grubenv # GRUB Environment Block saved_entry=2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-553.5.1.el8_10.x86_64 kernelopts=root=UUID=f6d14312-d7e3-42d2-bc00-9548b7e2dcf6 ro net.ifnames=0 biosdevname=0 crashkernel=auto console=ttyS0,115200n8 console=tty0 boot_success=0 ... Omitted ... [root@kvm-rockylinux88 ~]# grubby --default-kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
Restore kernel update
If you can't restart the server normally after a kernel update, you must revert to the previous kernel before the update. You can revert it to one of the many installed kernel versions, and this guide describes how to revert the kernel to the version immediately before the update.
To resolve server restart issues, you can attempt server recovery by entering single mode. For more information on how to run reboot in Single Mode, see Server recovery.
Click the environment you are using in the Region menu and the Platform menu on the NAVER Cloud Platform console.
Click Services > Compute > Server, in order.
Click the Server menu.
Select the server to recover from the server image list, and then click the [Server access console] button.
Select the previous version as the booting kernel from the grub booting page and reboot.
- XEN Rocky Linux 8.6 grub boot page
- XEN Rocky Linux 8.8 grub boot page
- KVM Rocky Linux 8.6 grub boot page
- XEN Rocky Linux 8.6 grub boot page
After booting is complete, check the kernel version of the server.
- XEN Rocky Linux 8.6
[root@rockylinux86 ~]# uname -r 4.18.0-372.32.1.el8_6.x86_64
- XEN Rocky Linux 8.8
[root@rockylinux88 ~]# uname -r 4.18.0-477.13.1.el8_8.x86_64
- KVM Rocky Linux 8.8
[root@kvm-rockylinux88 ~]# uname -r 4.18.0-477.27.1.el8_8.x86_64
Check the kernel version that is currently active.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grub2-editenv list saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) boot_success=0 [root@rockylinux88 ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (4.18.0-477.10.1.el8_8.x86_64) 8.8 (Green Obsidian) Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian)
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grubby --default-kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64 [root@kvm-rockylinux88 ~]# grubby --info=ALL | grep ^kernel kernel="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64" kernel="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64" kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64" kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9"
Reset the default kernel version to the previous kernel version when booting.
- XEN Rocky Linux 8
[root@rockylinux88 ~]# grub2-set-default "Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)" [root@rockylinux88 ~]# grub2-editenv list saved_entry=Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian) boot_success=0
- KVM Rocky Linux 8
[root@kvm-rockylinux88 ~]# grubby --set-default="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64" The default is /boot/loader/entries/2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-477.27.1.el8_8.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64 [root@kvm-rockylinux88 ~]# grubby --default-kernel /boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64
(Optional) Reboot the server to check whether the server boots up normally with the updated kernel version.
[root@kvm-rockylinux88 ~]# sync;reboot
(Optional) Log back into the server to check the booting status and the kernel version.
- XEN Rocky Linux 8.6
[root@rockylinux86 ~]# uname -r 4.18.0-372.32.1.el8_6.x86_64
- XEN Rocky Linux 8.8
[root@rockylinux88 ~]# uname -r 4.18.0-477.13.1.el8_8.x86_64
- KVM Rocky Linux 8.8
[root@kvm-rockylinux88 ~]# uname -r 4.18.0-477.27.1.el8_8.x86_64