How to boot with old kernel in Rescue mode if CentOS server is not getting booted with new kernel?

bhawanisingh

Administrator
Staff member
Sometimes due to some technical reasons like mis-configuration or due to some files missing new updated kernel doesn't get boot and stuck.
To rectify the same we have to change the kernel to old one.

First we have to boot server in rescue mode:

First of all we have to check which kernel is default on our server.
# uname -a
then, you can check what all kernel available on server through:
# awk -F\' /^menuentry/{print\$2} /mnt/grub2/grub.cfg
Then we have to mount the boot partition so that we can make changes in GRUB.
# mount /dev/sda2 /mnt
If you have single physical drive
# mount /dev/md1 /mnt
If you have RAID setup for logical volumes.
After that we have to replace the old kernel name with current kernel in grubenv file.
# nano /mnt/grub2/grubenv
save the file.

un-mount the partition:
# cd /
# umount /mnt
reboot the server now.
 
Top