How to rebuild the kernel

If it doesn't fit in another category, ask it here.
Post Reply
grens
Posts: 2
Joined: 2005/10/19 15:37:38
Location: Montreal

How to rebuild the kernel

Post by grens » 2006/03/10 21:15:04

After updating the kernel 2.6.9-22.EL to 2.6.9-22.0.1.EL the system do not boot anymore.
I get Kernel panic. The upgrade was done with the rpm command.

Any way to return to the original kernel ?

Thanks !!

Sylvain

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: How to rebuild the kernel

Post by Lenard » 2006/03/11 18:53:23

Hopefully you used 'rpm -i' to install the new kernel....

If yes, then just boot to the older kernel that works, and remove the one that does not.

If not, then consider this a lesson learned.
Always install a new kernel using the -i switch instead of the -U or -F switch this way you keep the older kernel(s0 in case of problems.

All is not lost, boot with the installation media (CD or DVD) into rescue mode and install the kernel on the media;

So you know which kernel(s) you need to re-install type something like;

rpm -qa --queryformat "%{n}-%{v}-%{r}.%{arch}.rpm\n" 'kernel*'

From the installion media where the binary rpm is located install the older kernel, for example;

rpm -ivh kernel-2.6.9-22.EL.i686.rpm --force

The '-- force' switch is needed since this is an older version of the kernel then what is currectly installed.

To remove the non-working kernel type something like;

rpm -e kernel-2.6.9-22.0.1.EL

FYI: the current kernel for CentOS-4.2 is kernel-2.6.9-34.EL ; http://mirrors.kernel.org/centos/4.2/updates/

Post Reply

Return to “CentOS 4 - Miscellaneous Questions”