Skip to content
ohsudo, Home
Linux

"Kernel panic - not syncing: VFS: Unable to mount root fs": boot the old kernel, rebuild the initramfs

Fix "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)": boot an older kernel, rebuild the initramfs, and check /boot space and disk drivers.

Intermediate4 min readApplies to Ubuntu · Debian · RHEL / Rocky / AlmaLinux · virtual machines

by OhSudo ··

Checked on real software: Linux kernel, QEMU · November 2026How we check

VFS: Cannot open root device "UUID=3f1c..." or unknown-block(0,0): error -6
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)

The kernel started, and couldn’t find the disk to continue from. Normally a small file loaded next to the kernel, the initramfs, brings the drivers needed to reach that disk. unknown-block(0,0) almost always means the initramfs is missing, or is broken, so the kernel never saw the disk at all.

It typically appears right after a kernel update that didn’t finish: /boot was full, or the upgrade was interrupted. The previous kernel still works, and that’s the way back in.

  1. The kernelstarts(works)
  2. initramfsmissing or broken (an unfinished update)(breaks here)
  3. Root filesystemroot= never mounted
The kernel started and couldn't reach the disk to continue from. The initramfs brings the drivers for that; unknown-block(0,0) almost always means it's missing or broken.

TL;DR

  1. Restart, and in the GRUB menu choose Advanced options, then the previous kernel.
  2. Once logged in, rebuild the initramfs for the broken kernel and update GRUB:
Terminal window
# Ubuntu, Debian
sudo update-initramfs -c -k 6.8.0-51-generic
sudo update-grub
# RHEL, Rocky, AlmaLinux
sudo dracut -f --kver 5.14.0-503.14.1.el9_5.x86_64

Use the version of the kernel that panicked, which ls /boot shows.

1. Get to the GRUB menu

If the menu doesn’t appear, hold Shift while the machine starts, on BIOS systems, or press Esc repeatedly, on UEFI. On a virtual machine, open its console early. Choose the entry for an older kernel. Most distributions keep two or three.

2. Find what’s missing

Once you’re in, compare the kernels with their initramfs files:

Terminal window
ls -l /boot
-rw------- 1 root root 14M Nov 10 09:12 vmlinuz-6.8.0-51-generic
-rw-r--r-- 1 root root 68M Oct 2 10:40 initrd.img-6.8.0-49-generic
-rw------- 1 root root 14M Oct 2 10:40 vmlinuz-6.8.0-49-generic

Here the new kernel, 6.8.0-51, has no initrd.img beside it. On RHEL, the files are called initramfs-<version>.img. A file that exists and is much smaller than the others is suspect too.

Then find why it wasn’t built:

Terminal window
df -h /boot

A full /boot is the classic cause. The file couldn’t be written, and the update went on anyway. Remove old kernels you don’t use, never the one you’re running (uname -r):

Terminal window
sudo apt autoremove --purge
sudo dnf remove --oldinstallonly

If apt itself complains that an install was interrupted, finish that first: see dpkg was interrupted. For space in general, see No space left on device.

3. Rebuild it

Terminal window
# Ubuntu, Debian: create the file for one kernel
sudo update-initramfs -c -k 6.8.0-51-generic
sudo update-grub
# RHEL, Rocky, AlmaLinux
sudo dracut -f --kver 5.14.0-503.14.1.el9_5.x86_64

update-initramfs -u -k all rebuilds the files for every installed kernel. On RHEL, sudo dracut --regenerate-all -f does the same, and sudo grubby --info=ALL lists the boot entries.

Restart, and choose the new kernel. If it boots, it’ll be the default again.

4. A different number: the disk is seen, and can’t be used

When the numbers aren’t (0,0), as in unknown-block(8,1), the kernel did find a disk, 8 being SCSI and SATA disks, and couldn’t mount it. The usual reasons:

  • The root= setting points at the wrong partition. This happens after cloning a disk, or editing /etc/default/grub. Compare the kernel’s command line, with cat /proc/cmdline from the working kernel, and blkid.
  • The file system’s driver is missing from the initramfs, which a rebuild fixes.
  • The file system is damaged. Check it from a live USB with fsck, or xfs_repair for XFS, on the unmounted partition.

5. Virtual machines that were moved

A VM converted from another platform, or whose disk controller was changed, for example from IDE to virtio or SCSI, may boot a kernel whose initramfs lacks that controller’s driver. Switch the controller back, boot, and rebuild the initramfs with all drivers:

Terminal window
# RHEL
sudo dracut -f --no-hostonly --kver "$(uname -r)"

On Debian and Ubuntu, set MODULES=most in /etc/initramfs-tools/initramfs.conf, which is the default, then rebuild.

6. No working kernel left

Boot from a live USB of the same distribution, mount the system, and rebuild from inside it:

Terminal window
sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot # if /boot is separate
for d in dev proc sys run; do sudo mount --bind /$d /mnt/$d; done
sudo chroot /mnt
update-initramfs -c -k 6.8.0-51-generic
update-grub
exit

lsblk -f shows which partition is which. On a UEFI system, also mount the EFI partition at /mnt/boot/efi.

If you land at a prompt like this, the initramfs is fine, and it couldn’t find the root partition:

ALERT! UUID=3f1c... does not exist. Dropping to a shell!
(initramfs)

Type blkid there to see the real UUIDs, and compare with root= in GRUB and with /etc/fstab.

Warning

Don’t delete the kernel you booted from to make room in /boot, and keep at least one older kernel installed: it’s your way back the next time an update goes wrong. On servers, check /boot space in your monitoring, as this is entirely preventable.

Shell, we have a problem!

Similar, but different: grub rescue> means GRUB itself can’t find its files, before any kernel loads: see grub rescue: unknown filesystem. Read-only file system after boot means the root was mounted and then switched to read-only. wrong fs type, bad option, bad superblock is the same kind of problem for other disks, after boot. A system that freezes with soft lockup messages is a different problem.

Found this useful? Share it.

Found a mistake? Let us know at contact@ohsudo.com.

Articles

Related articles