centos – reload new kernel without reboot

uname -r
2.6.32-71.29.1.el6.i686

yum update kernel*

then:
yum install kexec-tools

Now we get last installed kernel version release and put it on a var:

# latestkernel=`ls -t /boot/vmlinuz-* | sed “s/\/boot\/vmlinuz-//g” | head -n1`

# echo $latestkernel
2.6.32-220.4.1.el6.i686

Now we need to load the new kernel version in memory:

kexec -l /boot/vmlinuz-${latestkernel} –initrd=/boot/initramfs-${latestkernel}.img –append=”`cat /proc/cmdline`”

realod new kernel:
kexec -e

The system will “restart without restarting”..something like a fast reboot, without performing BIOS checks

name -r
2.6.32-220.4.1.el6.i686

Leave a Reply

Your email address will not be published. Required fields are marked *