CentOS 7 kernel update corrupted, stuck

Operating System & Version
centos 7

CharlesGLondon

Well-Known Member
Jan 30, 2019
54
5
8
London
cPanel Access Level
Website Owner
I tried to update kernel by clicking on link which showed me to update kernel. Either kernel was corrupted or something else happened and server is stuck. I've booted into rescue mode. How do I proceed from here to go back to the old working kernel and get it working?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,139
2,404
363
cPanel Access Level
Root Administrator
Hey there! I'm sorry to hear that happened on your machine. Since the problem is with the kernel itself, there wouldn't be any cPanel tools available that can help with this. The best thing to do would be to work with your hosting provider to let them know the machine is only working in rescue mode.

We do have an article that explains how to manage the Grub system here:


but it's not something our team is able to assist with as it's not part of the cPanel tools.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
854
366
363
cPanel Access Level
DataCenter Provider
Normally if you have a bad kernel you'd simply boot to the previous one (not into rescue). You'd need console, KVM/IP or the data center to do this for you. Once you're booted into the old kernel you can usually do

Code:
yum reinstall kernel
To fix the issue with the new kernel. The most common issue we see with "broken" kernels is not giving it enough time to finish and rebuild the initrd.
 

vacancy

Well-Known Member
Sep 20, 2012
557
223
93
Turkey
cPanel Access Level
Root Administrator
You have 2 options.

You can open the server with kvm and start the server with the previous kernel from the boot screen, see the last corrupt kernel loaded with the rpm -q kernel command, delete the kernel with the rpm -e kernelname command. Then reinstall last kernel install yum upgrade command.

Or

You can do the same after mounting the disk in rescue mode and chrooting it.