Saturday 15 January 2022

How to Resolve “kernel panic at boot with error Unable to mount root fs on unknown-block” on CentOS 7



Sometime after yum update transaction break or kernel update or fresh install, the system fails to mount the root file system and also fail to boot the system with below message on CentOS 7 systems:




















This article describes How to Resolve “Kernel panic at boot with error Unable to mount root fs on unknown-block” on CentOS 7.

Step 1: Booting with Old Kernel: Reset the system and wait for CentOS Linux Kernels countdown than select old kernel by pressing arrow keys. Once the kernel highlighted as shown in below screen shot press Enter to boot with selected different kernel.



Step 2: Check the free Space: Run the following command to check free space on /boot /vat/tmp and /tmp file system.
 

In case, space is full on both the file systems list all the installed kernel and remove oldest one to make some space by following Step 3.

Step 3. Installing Kernel: Run the following commands to list the installed kernel. Now remove the latest kernel by running the below commands:

[root@linuxcnf ~]# rpm -qa|grep kernel-3
 
[root@linuxcnf ~]# yum remove kernel-3.10.0-1160.49.1.el7.x86_64

Once the kernel removed run the following command as shown in the below screen shot to install latest kernel again and this might be resolve the root file system mounting issue.

[root@linuxcnf ~]# yum install kernel -y
 


Step 4. Check initrd Image: Run the following command and check if initrd image is created or not:



 
Latest installed kernel version the initrd image version should be same. In this case the initrd image also created with the kernel installation.
 
Step 5. Reboot the System: Now latest kernel installed, Run the following command for normal reboot and this time system might be boot successfully:
 
[root@linuxcnf ~]# init 6
 
Possibly the below screen will be shown:



Done!!! root file system mounting issue resolved on CentOS 7 system.

No comments:

Post a Comment