kernel panic at boot with error: Unable to mount root fs on unknown-block(0,0)

kernel panic

After you install or update CentOS/AlmaLinux on a server or a kernel update, the system may fail to boot with the following error.

VFS: Cannot open root device XXX or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Call Trace:
[<ffffffff81527213>] ? panic+0xa7/0x16f
[<ffffffff81c27432>] ? mount_block_root+0x216/0x2cb
[<ffffffff81002930>] ? bstat+0x2b0/0x980
[<ffffffff81c2753d>] ? mount_root0x56/0x5a

You may use the following steps to resolve the above boot error.

  • Turn on the Linux server.
  • Wait for the Boot screen, and select the different kernel to boot from other than the top selected kernel. After the kernel is selected, hit enter to boot from this kernel.
  • A per your CentOS/AlmaLinux version, make sure the filesystem at /tmp/  or /var/tmp and /boot have free space.

df -h /boot /tmp /var/tmp

  • In case, the above directories are virtually full, remove unnecessary files. If you are not sure which files to remove, check the installed kernel as follows.

rpm --last -q kernel{,-xen,-PAE}

  • Check the output and then use yum remove to remove the oldest kernel to free some disk space.

yum remove kernel-3.1.18-318.el5

  • Then reinstall the newest kernel as shown below.

yum install kernel-3.2.18-318.el5

  • Make sure that an initrd/initramfs file is created in /boot for the newly installed kernel. Check the title of the newly installed kernel in /boot/grub/grub.conf to make sure initrd/initramfs file is mentioned on the initrd line.
  • If initrd/initramfs is not present in /boot, you need to rebuild it manually.

Leave a Reply