Para este exemplo usaremos uma máquina na OCI.
1- Verificando a versão atual do kernel instalado.
[root@ol8 ~]# uname -a
Linux ol8 5.4.17-2102.201.3.el8uek.x86_64 #2 SMP Fri Apr 23 09:05:57 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@ol8 ~]# uname -r
5.4.17-2102.201.3.el8uek.x86_64
[root@ol8 ~]# grubby --default-kernel
/boot/vmlinuz-5.4.17-2102.203.5.el8uek.x86_64
ShellScript2 – Verificando as versões Oracle Linux disponíveis em seu ambiente.
[root@ol8 ~]# ls -lat /boot/vmlinuz*
-rwxr-xr-x. 1 root root 10028592 Jul 12 23:26 /boot/vmlinuz-0-rescue-20ad9fb5ae164d04b5966daa1f26d106
-rwxr-xr-x. 1 root root 10028592 Jun 30 19:23 /boot/vmlinuz-4.18.0-305.7.1.el8_4.x86_64
-rwxr-xr-x. 1 root root 8984128 Jun 28 23:50 /boot/vmlinuz-5.4.17-2102.203.5.el8uek.x86_64
-rwxr-xr-x. 1 root root 9004608 May 22 23:21 /boot/vmlinuz-5.4.17-2102.202.5.el8uek.x86_64
-rwxr-xr-x. 1 root root 8984072 May 13 02:12 /boot/vmlinuz-0-rescue-0cad77c0503e42b9b081151486ea8f24
-rwxr-xr-x. 1 root root 8984072 Apr 23 16:11 /boot/vmlinuz-5.4.17-2102.201.3.el8uek.x86_64
-rwxr-xr-x. 1 root root 9487864 Apr 7 01:38 /boot/vmlinuz-4.18.0-240.22.1.el8_3.x86_64
ShellScript3 – Versões disponíveis em seu ambiente de forma mais detalhada.
[root@ol8 ~]# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-5.4.17-2102.203.5.el8uek.x86_64"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers $tuned_params"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-5.4.17-2102.203.5.el8uek.x86_64.img $tuned_initrd"
title="Oracle Linux Server 8 (5.4.17-2102.203.5.el8uek.x86_64) "
id="20ad9fb5ae164d04b5966daa1f26d106-5.4.17-2102.203.5.el8uek.x86_64"
index=1
kernel="/boot/vmlinuz-5.4.17-2102.202.5.el8uek.x86_64"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers $tuned_params"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-5.4.17-2102.202.5.el8uek.x86_64.img $tuned_initrd"
title="Oracle Linux Server 8 (5.4.17-2102.202.5.el8uek.x86_64) "
id="20ad9fb5ae164d04b5966daa1f26d106-5.4.17-2102.202.5.el8uek.x86_64"
index=2
kernel="/boot/vmlinuz-4.18.0-305.7.1.el8_4.x86_64"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers $tuned_params"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-4.18.0-305.7.1.el8_4.x86_64.img $tuned_initrd"
title="Oracle Linux Server (4.18.0-305.7.1.el8_4.x86_64) 8.4"
id="20ad9fb5ae164d04b5966daa1f26d106-4.18.0-305.7.1.el8_4.x86_64"
index=3
kernel="/boot/vmlinuz-0-rescue-20ad9fb5ae164d04b5966daa1f26d106"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-0-rescue-20ad9fb5ae164d04b5966daa1f26d106.img"
title="Oracle Linux Server (0-rescue-20ad9fb5ae164d04b5966daa1f26d106) 8.4"
id="20ad9fb5ae164d04b5966daa1f26d106-0-rescue"
index=4
kernel="/boot/vmlinuz-5.4.17-2102.201.3.el8uek.x86_64"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers $tuned_params"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-5.4.17-2102.201.3.el8uek.x86_64.img $tuned_initrd"
title="Oracle Linux Server 8 (5.4.17-2102.201.3.el8uek.x86_64) "
id="0cad77c0503e42b9b081151486ea8f24-5.4.17-2102.201.3.el8uek.x86_64"
index=5
kernel="/boot/vmlinuz-4.18.0-240.22.1.el8_3.x86_64"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers $tuned_params"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-4.18.0-240.22.1.el8_3.x86_64.img $tuned_initrd"
title="Oracle Linux Server (4.18.0-240.22.1.el8_3.x86_64) 8.3"
id="0cad77c0503e42b9b081151486ea8f24-4.18.0-240.22.1.el8_3.x86_64"
index=6
kernel="/boot/vmlinuz-0-rescue-0cad77c0503e42b9b081151486ea8f24"
args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600 rd.luks=0 rd.md=0 rd.dm=0 rd.lvm.vg=ocivolume rd.lvm.lv=ocivolume/root rd.net.timeout.carrier=5 netroot=iscsi:169.254.0.2:::1:iqn.2015-02.oracle.boot:uefi rd.iscsi.param=node.session.timeo.replacement_timeout=6000 net.ifnames=1 nvme_core.shutdown_timeout=10 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 libiscsi.debug_libiscsi_eh=1 loglevel=4 ip=single-dhcp crash_kexec_post_notifiers"
root="/dev/mapper/ocivolume-root"
initrd="/boot/initramfs-0-rescue-0cad77c0503e42b9b081151486ea8f24.img"
title="Oracle Linux Server 8 (0-rescue-0cad77c0503e42b9b081151486ea8f24) "
id="0cad77c0503e42b9b081151486ea8f24-0-rescue"
ShellScript4 – Definindo a versão do kernel 4.18.0-240.22.1.el8_3.x86_64 como padrão.
[root@ol8 ~]# grubby --set-default /boot/vmlinuz-4.18.0-240.22.1.el8_3.x86_64
ShellScript5 – Reinicie o servidor.
[root@ol8 ~]# init 6
ShellScript6 – Versão do kernel sendo usada após a modificação.
[root@ol8 ~]# uname -r
4.18.0-240.22.1.el8_3.x86_64
[root@ol8 ~]# uname -a
Linux ol8 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Tue Apr 6 18:32:06 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux
ShellScript