Methods of payment Abuse

Troubleshooting vfs cannot mount root fs on an unknown block

10.10.2023, 23:34

The vfs unable to mount root fs on unknown block error occurs when the Linux kernel cannot find the root file system to mount when the system boots.

Causes of the error

The error may occur for several reasons:

  1. No file system driver: If the file system specified in the kernel boot parameters is not supported or there is no corresponding driver, then the kernel will not be able to mount the root file system.
  2. The kernel boot parameters are incorrectly specified: if the kernel boot parameters are incorrectly specified or missing, the kernel will not be able to find the root file system.
  3. Block device problems: If the block device containing the root file system is unavailable or damaged, the kernel will not be able to mount it.
  4. Problems with the bootloader: When the bootloader (for example, GRUB) is incorrectly configured or installed, the kernel may not be able to access the root file system.

Solving the problem by booting from the old kernel

If you encounter an error, the first thing to do is try to boot using an older kernel. Select Advanced Options, then point to one of the older cores. If the system boots up in this case, it means that only the new kernel is not working. If you built it yourself, then you may not have included all the necessary file systems in it.

If this is a kernel from the repositories, and the system booted with an older kernel, there is a chance that you have corrupted initramfs for the new kernel. This could also happen due to a lack of memory when updating the system. To fix everything, you just need to free up space in the /boot/ directory and create a new initramfs. Check and free up space in the /boot folder if there is not enough of it there:

$ df -h | grep boot

To create initramfs, first find out the current kernel version:

$ uname -r

We insert the received version into the following command:

$ sudo update-initramfs -u -k version

We get

$ sudo update-initramfs -u -k 4.15.0-36-generic

At the end of the operation, we will update the Grub configuration:

$ sudo update-grub

If the problem is in free space and initramfs, but you can't boot using an older kernel, then try another LiveCD distribution and try to fix everything in a chroot environment.