“Kernel Panic – Not Syncing: VFS: Unable to Mount Root FS” is one of the critical system errors that pop out during the Linux kernel booting process when it ultimately fails to mount the root filesystem. That happens quite often after a kernel upgrade when there’s not enough room in the /boot partition or when old kernels are not removed.
Symptoms:
1. Doesn't boot and shows error: "Kernel Panic - Not Syncing: VFS: Unable to Mount Root FS".
2. Inability to use the OS even to operate the recovery tools themselves.
Common Causes:
1. Insufficient free space in the /boot partition for the proper installation of the new kernel.
2. Presence of old and unused kernels occupying precious disk space.
3. Misconfiguration of the partition scheme.
4. Disk corruption or hardware issues affecting the boot partition.
Before proceeding with fixes, check the disk usage of your /boot
partition to see if it’s full.
You can check it using the command below. Ensure you have enough space in this partition by freeing up some space.
df -h
Solution
- Restart your computer.
- When it boots to the GRUB menu, select Advanced options.
- Select the second from the top, not the latest one from the kernels listed on the next screen.
- After that, log in as root and open a terminal.
- Execute the following command to list the installed kernels:
dpkg --list | grep linux-image
OR
rpm -qa kernel
In the listed installed kernel images, identify which of the older kernels you want to remove. Be very careful not to remove the two most recent kernels or the current one in use.
- Remove an older kernel: To do that, use the following command:
apt-get purge linux-image-4.19.0-5-amd64
OR
yum remove linux-image-4.19.0-5-amd64
Replace linux-image-4.19.0-5-amd64 with the intended kernel image that you want to remove. Repeat this for every unused kernel.
- After cleaning the old kernels, update GRUB for the changes to take effect:
update-grub
The above commands may not work for RedHat-based systems.
- Reboot the system using the below command. When restarting, make sure to opt for the newest Linux kernel in the GRUB menu.
reboot
“Kernel Panic – Not Syncing: VFS: Unable to Mount Root FS” are common issue for Linux users, aside from which users commonly avoid by freeing the /boot partition or managing old kernel images effectively. If problems persist, further investigation may be needed into hardware issues or disk integrity.