Redhat Linux kernel panic error

Kernel Panic error come usually when kernel corrupt or if  after kernel update it will get panic error if the kernel update had done wrong or any miss updated package

you can check your current kernel using

# uname -a Linux ip-172-31-19-108.ec2.internal 4.14.193-149.317.amzn2.x86_64 #1 SMP Thu Sep 3 19:04:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # uname -r 4.14.193-149.317.amzn2.x86_64

and the kernel package are stored in /boot location

# ls -lah /boot/ total 40M dr-xr-xr-x 4 root root 4.0K Sep 21 21:12 . dr-xr-xr-x 18 root root 257 Oct 24 14:31 .. -rw-r--r-- 1 root root 118K Sep 3 19:06 config-4.14.193-149.317.amzn2.x86_64 drwxr-xr-x 3 root root 17 Sep 21 21:10 efi drwx------ 5 root root 79 Sep 21 21:12 grub2 -rw------- 1 root root 31M Sep 21 21:12 initramfs-4.14.193-149.317.amzn2.x86_64.img -rw-r--r-- 1 root root 654K Sep 21 21:12 initrd-plymouth.img -rw-r--r-- 1 root root 230K Sep 3 19:07 symvers-4.14.193-149.317.amzn2.x86_64.gz -rw------- 1 root root 2.7M Sep 3 19:06 System.map-4.14.193-149.317.amzn2.x86_64 -rwxr-xr-x 1 root root 5.5M Sep 3 19:06 vmlinuz-4.14.193-149.317.amzn2.x86_64 -rw-r--r-- 1 root root 174 Sep 3 19:06 .vmlinuz-4.14.193-149.317.amzn2.x86_64.hmac

//here you intramfs file are the kernel file in aws there is no rescue mode

//ec2 and normal vm are different normal vm you could see three file

//below are the normal vm server kernel file

initramfs-0-rescue-8ecdff3415a94ce2bc3f5125db312e97.img initramfs-3.10.0-1062.12.1.el7.x86_64.img initramfs-3.10.0-1062.12.1.el7.x86_64kdump.img

------------------

EC2

# rpm -qa |grep kernel kernel-tools-4.14.193-149.317.amzn2.x86_64 kernel-4.14.193-149.317.amzn2.x86_64

normal server

# rpm -qa | grep kernel

kernel-tools-3.10.0-1160.2.1.el7.x86_64 kernel-headers-3.10.0-1160.2.1.el7.x86_64 kernel-3.10.0-1160.2.1.el7.x86_64 kernel-3.10.0-1062.12.1.el7.x86_64 kernel-3.10.0-1127.18.2.el7.x86_64 kernel-tools-libs-3.10.0-1160.2.1.el7.x86_64

//before update kernel check boot space because kernel package will stored in /boot

# df -h /boot/ Filesystem Size Used Avail Use% Mounted on /dev/xvda1 10G 1.4G 8.7G 14% /

//above is ec2 there have 10 gb available so we can go for kernel update

# df -h /boot/ Filesystem Size Used Avail Use% Mounted on /dev/sda1 1014M 284M 731M 28% /boot

//when see above is my normal vm that have only 1014mb available space is very less,
hence we need to uninstall old kernel which is not used.

# rpm -qa | grep kernel kernel-tools-3.10.0-1160.2.1.el7.x86_64 kernel-headers-3.10.0-1160.2.1.el7.x86_64 kernel-3.10.0-1160.2.1.el7.x86_64 kernel-3.10.0-1062.12.1.el7.x86_64 kernel-3.10.0-1127.18.2.el7.x86_64 kernel-tools-libs-3.10.0-1160.2.1.el7.x86_64
# uname -r 3.10.0-1160.2.1.el7.x86_64

//above example the running kernel is 3.10.0-1160, and we could see on rpm have 3.10.0-1127 -that we can delete

using #rpm -e kernel-3.10.0-1127.18.2.el7.x86_64 //make sure, that was not running.
once it uninstalled you will get some space on /boot

----------------------------
//now going for security update

#yum --security update
.
.
Dependencies Resolved ======================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================== Installing: kernel x86_64 4.14.198-152.320.amzn2 amzn2-core 21 M Updating: kernel-tools x86_64 4.14.198-152.320.amzn2 amzn2-core 136 k Transaction Summary ======================================================================================================================================== Install 1 Package Upgrade 1 Package Total download size: 21 M Is this ok [y/d/N]:

//here it showing new kernel available and ask you want to install y/n ?

//once it done, it needs an reboot for update

#init 6

# uptime 15:22:15 up 1 min, 1 user, load average: 0.25, 0.11, 0.04

# uname -r 4.14.198-152.320.amzn2.x86_64
//kernel has been updated

#ls -lah /boot/
total 79M dr-xr-xr-x 4 root root 4.0K Oct 24 15:10 . dr-xr-xr-x 18 root root 257 Oct 24 14:31 .. -rw-r--r-- 1 root root 118K Sep 3 19:06 config-4.14.193-149.317.amzn2.x86_64 -rw-r--r-- 1 root root 118K Sep 23 23:59 config-4.14.198-152.320.amzn2.x86_64 drwxr-xr-x 3 root root 17 Sep 21 21:10 efi drwx------ 5 root root 79 Oct 24 15:10 grub2 -rw------- 1 root root 31M Sep 21 21:12 initramfs-4.14.193-149.317.amzn2.x86_64.img -rw------- 1 root root 31M Oct 24 15:10 initramfs-4.14.198-152.320.amzn2.x86_64.img -rw-r--r-- 1 root root 654K Sep 21 21:12 initrd-plymouth.img -rw-r--r-- 1 root root 230K Sep 3 19:07 symvers-4.14.193-149.317.amzn2.x86_64.gz -rw-r--r-- 1 root root 231K Sep 23 23:59 symvers-4.14.198-152.320.amzn2.x86_64.gz -rw------- 1 root root 2.7M Sep 3 19:06 System.map-4.14.193-149.317.amzn2.x86_64 -rw------- 1 root root 2.8M Sep 23 23:59 System.map-4.14.198-152.320.amzn2.x86_64 -rwxr-xr-x 1 root root 5.5M Sep 3 19:06 vmlinuz-4.14.193-149.317.amzn2.x86_64 -rw-r--r-- 1 root root 174 Sep 3 19:06 .vmlinuz-4.14.193-149.317.amzn2.x86_64.hmac -rwxr-xr-x 1 root root 5.5M Sep 23 23:59 vmlinuz-4.14.198-152.320.amzn2.x86_64 -rw-r--r-- 1 root root 174 Sep 23 23:59 .vmlinuz-4.14.198-152.320.amzn2.x86_64.hmac

# rpm -qa | grep kernel kernel-tools-4.14.198-152.320.amzn2.x86_64 kernel-4.14.193-149.317.amzn2.x86_64 kernel-4.14.198-152.320.amzn2.x86_64

# rpm -e kernel-4.14.198-152.320.amzn2.x86_64 // here i'm removing current running kernel,
//it will get error after reboot - panic error
//but here i have not receiving any error on booting,
//it successfully up and running with previous kernel (ec2)

# uname -r 4.14.193-149.317.amzn2.x86_64

----------------------------------

need to check the same on normal vm , i think that might get server panic error..





Post a Comment

0 Comments