How to Fix Kernel Panic Error in RHEL 7/8

In this article we are going to cover How to Fix Kernel Panic Error in RHEL 7/8.

See the details of Kernel Panic Error (Identify the reason behind it eg. New Kernel, Corrupted initramfs, New Packages after Patching, Hardware change etc.)

cd /boot
ls -lrt
How to Fix Kernel Panic Error in RHEL 7/8 1
uname -r
pwd
rm -rf initramfs-4.18.0-240.el8.x86_64.img
How to Fix Kernel Panic Error in RHEL 7/8 2

Reboot the machine

How to Fix Kernel Panic Error in RHEL 7/8 3

Login the system with root credentials through rescue mode.

How to Fix Kernel Panic Error in RHEL 7/8 4

Take necesarry action as the reason of getting this error. If it is due to new kernel, then downgrade it. If it is due to corrupted or missing initramfs, regenerate it

How to Fix Kernel Panic Error in RHEL 7/8 5

Login the system with root credentials through rescue mode.

How to Fix Kernel Panic Error in RHEL 7/8 6

Take necesarry action as the reason of getting this error. If it is due to new kernel, then downgrade it. If it is due to corrupted or missing initramfs, regenerate it

In our case it is due to corrupted/absent initramfs file. First check your kernel version.

uname -r

Now regenerate initramfs with dracut or mkinitrd command: (here your kernel version should be same as in previous command result)

To create new initramfs use:

dracut initramfs-3.10.0-1062.el7.x86_64.img 3.10.0-1062.el7.x86_64

OR

mkinitrd initramfs-4.18.0-240.el8.x86_64.img 4.18.0-240.el8.x86_64
How to Fix Kernel Panic Error in RHEL 7/8 7

To replace exsiting initramfs file use:

dracut -f initramfs-3.10.0-1062.el7.x86_64.img 3.10.0-1062.el7.x86_64

OR

mkinitrd --force initramfs-4.18.0-240.el8.x86_64.img 4.18.0-240.el8.x86_64
How to Fix Kernel Panic Error in RHEL 7/8 8

Finally reboot the machine and check

Conclusion:

In this article we have covered How to Fix Kernel Panic Error in RHEL 7/8.

Related Articles:

Reference:

RedHat Official Page

FOSS TechNix

FOSS TechNix (Free,Open Source Software's and Technology Nix*) founded in 2019 is a community platform where you can find How-to Guides, articles for DevOps Tools,Linux and Databases.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap