HomeAbout UsContact Us

Fixing Buildroot Kernel Panic: VFS Unable to Mount Root FS

By Jithin Tom
November 26, 2026
7 min read
Fixing Buildroot Kernel Panic: VFS Unable to Mount Root FS

Table Of Contents

01
Problem Statement
02
Root Cause Analysis
03
Solution Approaches
04
Complete Working Example: Allwinner Sun8i (Orange Pi Zero)
05
Initramfs Considerations
06
Debugging with earlycon and earlyprintk
07
Verification Steps
08
Common Pitfalls
09
Boot Flow and Rootfs Mount Failure Points
10
Summary
11
Related Reading
12
References
13
Frequently Asked Questions

When you build an embedded Linux system with Buildroot and hit the boot-time kernel panic:

VFS: Cannot open root device "(null)" 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 root cause falls into one of three categories: the kernel command line lacks a valid root= (or rootwait) parameter, root= resolves to the wrong partition or an unsupported identifier like UUID= without an initramfs, or the kernel lacks built-in drivers (=y) to reach the storage controller and filesystem. This guide walks through each failure mode with concrete fixes targeting Buildroot 2024.02+ and Linux 6.1-6.6+.

Problem Statement

You flash a Buildroot-generated image to an SD card or eMMC. The board powers on, U-Boot loads the kernel and device tree, the kernel boots — then panics in mount_block_root() before starting userspace. No shell, no rootfs logs, only serial console output ending in VFS: Unable to mount root fs on unknown-block(0,0).

In Linux init/do_mounts.c, unknown-block(0,0) does not mean a device tried to register as major 0, minor 0. Rather, 0 (MKDEV(0, 0)) is the unset ROOT_DEV sentinel formatted by __bdevname() when root= was omitted, empty, or failed to resolve via early_lookup_bdev() (Linux 6.5+) / name_to_dev_t() (Linux 6.1-6.4). By contrast, if the kernel resolves the block device (for example mmcblk0p2 at major 179, minor 2) yet fails to mount the filesystem (for example because CONFIG_EXT4_FS is missing or the superblock is corrupt), it prints unknown-block(179,2).

Understanding the boot chain when booting directly to a block device — U-Boot (fdt_chosen()) -> kernel command line parsing -> asynchronous driver probe -> prepare_namespace() -> mount_block_root() -> exec /sbin/init — makes it straightforward to pinpoint which stage broke. (If an initramfs with /init is present, kernel_init_freeable() runs /init directly and bypasses prepare_namespace() altogether.)

Root Cause Analysis

When booting without an initramfs /init, kernel_init() (init/main.c) calls kernel_init_freeable(), which invokes prepare_namespace() -> mount_root() -> mount_block_root() in init/do_mounts.c (with mount_root_generic() performing the block open and filesystem mount loop in Linux 6.5+). The panic output breaks down as follows:

ComponentMeaning
VFSVirtual Filesystem Switch — the kernel’s filesystem abstraction layer
root device "(null)"No root= token was parsed (root_device_name is NULL); if root=/dev/mmcblk0p2 was passed but not found, "mmcblk0p2" appears instead
unknown-block(0,0)ROOT_DEV remained 0 (MKDEV(0,0)) because root= was absent or failed device lookup (error -6 = -ENXIO)
unknown-block(179,2)Device 179:2 (mmcblk0p2) resolved, but VFS could not mount any filesystem on it (missing FS driver or corrupt image)

Three primary failure modes produce unknown-block(0,0) in Buildroot builds:

1. Missing or Overwritten bootargs

On Device Tree platforms, U-Boot injects its bootargs environment variable into /chosen/bootargs inside the Flattened Device Tree (FDT) via fdt_chosen() right before jumping to Linux (or via ATAGs on legacy non-DT ARM setups). During Linux startup, start_kernel() -> setup_arch() -> early_init_dt_scan_chosen() reads /chosen/bootargs into boot_command_line, setup_command_line() saves it, and parse_early_param() invokes __setup("root=", root_dev_setup) to store the string in saved_root_name. ROOT_DEV stays 0 until prepare_namespace() resolves saved_root_name.

root= ends up missing or broken when:

  • Booting manually from the U-Boot prompt without running the script or setenv bootargs commands that bootcmd executes during autoboot
  • bootcmd references a variable (such as mmcargs) that was never defined or saved (saveenv omitted)
  • boot.scr or extlinux/extlinux.conf overwrites manually saved bootargs on reboot
  • The kernel was built with CONFIG_CMDLINE_FORCE=y, forcing a built-in CONFIG_CMDLINE that ignores both U-Boot and the Device Tree

2. Mismatched Root Partition or Controller Index

Buildroot’s BR2_TARGET_ROOTFS_EXT2=y and BR2_TARGET_ROOTFS_EXT2_4=y generate a standalone output/images/rootfs.ext4 filesystem image — they do not create a partition table. Partition layout is controlled separately by genimage (via BR2_PACKAGE_HOST_GENIMAGE=y and BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh") or manual flashing.

Common layout and numbering mismatches include:

  • genimage.cfg places boot.vfat on partition 1 and rootfs.ext4 on partition 2, while bootargs still passes root=/dev/mmcblk0p1
  • A raw bootloader entry in genimage.cfg omits in-partition-table = "no", shifting boot to partition 2 and rootfs to partition 3
  • MMC controller renumbering: Partition indices (mmc 0:2 in U-Boot vs /dev/mmcblk0p2 in Linux) are both 1-based, but controller numbers are not guaranteed to match. Linux assigns mmcblk0, mmcblk1, etc. in driver probe order unless pinned by DT aliases { mmc0 = ...; }, so an eMMC that U-Boot calls mmc 1 can become /dev/mmcblk0 in Linux when the SD slot is empty
  • U-Boot bootargs is unset/empty, allowing a stale /chosen/bootargs hardcoded inside the .dts file to take effect

3. Missing Storage or Filesystem Drivers in Kernel Config

Even with an exact root= parameter, prepare_namespace() cannot open the device if the storage controller driver, block driver, or root filesystem driver is missing or built as a module (=m) without an initramfs:

  • MMC/SD/eMMC: CONFIG_MMC=y + CONFIG_MMC_BLOCK=y + SoC host driver (for example CONFIG_MMC_SUNXI=y for Allwinner, CONFIG_MMC_SDHCI_OF_ARASAN=y for Xilinx ZynqMP), plus CONFIG_PWRSEQ_SIMPLE=y if the DT uses an MMC power-sequence node
  • SATA/AHCI: CONFIG_ATA=y + CONFIG_SATA_AHCI=y (PCIe) or CONFIG_SATA_AHCI_PLATFORM=y (SoC platform DT) + CONFIG_SCSI=y + CONFIG_BLK_DEV_SD=y
  • NVMe: CONFIG_PCI=y + SoC PCIe host bridge driver + CONFIG_NVME_CORE=y + CONFIG_BLK_DEV_NVME=y
  • USB Mass Storage: CONFIG_USB=y + host controller driver (e.g., CONFIG_USB_EHCI_HCD=y / CONFIG_USB_XHCI_HCD=y) + CONFIG_USB_STORAGE=y + CONFIG_SCSI=y + CONFIG_BLK_DEV_SD=y
  • Filesystem: CONFIG_EXT4_FS=y (and CONFIG_EXT4_USE_FOR_EXT2=y if mounting ext2, or CONFIG_SQUASHFS=y / CONFIG_BTRFS_FS=y as appropriate)

Critical rule: Without an initramfs, every driver along the path to the root filesystem must be built-in (=y). If compiled as =m, the .ko files live inside /lib/modules on the very rootfs the kernel is trying to mount — an unbreakable circular dependency.

Solution Approaches

Fix 1: Set Correct bootargs and Use Kernel-Native Identifiers

Ensure U-Boot passes a complete bootargs string (or update boot.cmd / extlinux.conf if using script/DistroBoot):

# In U-Boot shell
=> printenv bootargs
bootargs=console=ttyS0,115200
=> setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw
=> saveenv
=> boot

Critical flags explained:

  • rootwait — blocks indefinitely in prepare_namespace() until the root block device registers (essential for MMC/SD and USB devices probed asynchronously; rootwait=<sec> bounds the wait in newer kernels).
  • rootfstype=ext4 — skips probing other compiled-in filesystems in /proc/filesystems and prevents fallback attempts with incompatible ext2/ext3 probes.
  • rw — mounts the rootfs read-write. By default, the Linux kernel mounts root read-only (ro, MS_RDONLY | MS_SILENT in init/do_mounts.c) unless rw is specified or userspace init remounts it later.
  • earlycon / earlyprintk — enables serial output before the full TTY driver probes (earlycon reads DT /chosen/stdout-path; on 32-bit ARM earlyprintk uses compile-time CONFIG_DEBUG_LL).

For boards with multiple MMC/block interfaces where mmcblk0 and mmcblk1 can swap probe order, use PARTUUID=:

# By PARTUUID (natively parsed by Linux early_lookup_bdev / name_to_dev_t without initramfs)
# MBR format: <32-bit-disk-signature>-<2-digit-hex-partition>
=> setenv bootargs console=ttyS0,115200 root=PARTUUID=12345678-02 rootwait

Important PARTUUID= vs UUID= distinction: Direct kernel boot without an initramfs supports /dev/..., major:minor, PARTUUID=, and PARTLABEL= — it does not scan filesystem superblocks for root=UUID=<fs-uuid> or root=LABEL=.... Passing root=UUID=... directly to the kernel without an initramfs triggers VFS: Cannot open root device "UUID=..." or unknown-block(0,0). Only use root=UUID=... when an initramfs runs blkid, findfs, or udev to resolve the filesystem UUID before switch_root.

Inspect PARTUUID (and UUID if using an initramfs) on the host or generated image:

# On host (inspecting partitioned SD card or loop-mounted image)
$ sudo blkid /dev/sdX2
/dev/sdX2: UUID="abcdef12-3456-7890-abcd-ef1234567890" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="12345678-02"

Fix 2: Align Buildroot genimage.cfg Partition Layout with bootargs

In Buildroot make menuconfig, filesystem generation and disk partitioning are configured in two separate places:

Filesystem images --->
[*] ext2/3/4 root filesystem (BR2_TARGET_ROOTFS_EXT2=y)
ext2/3/4 variant (ext4) ---> (BR2_TARGET_ROOTFS_EXT2_4=y)
System configuration --->
(support/scripts/genimage.sh) Custom scripts to run after creating filesystem images
(-c board/<vendor>/<board>/genimage.cfg) Extra arguments passed to custom scripts
Host utilities --->
[*] host genimage (BR2_PACKAGE_HOST_GENIMAGE=y)

Check your genimage.cfg to confirm the exact partition order and ensure raw bootloader blocks do not get added to the partition table:

# genimage.cfg excerpt
image sdcard.img {
hdimage {
# Optional for MBR: pin disk-signature so PARTUUID stays stable across builds
disk-signature = 0x12345678
}
partition u-boot {
# Example for Allwinner SoCs; raw bootloader offset varies by SoC
in-partition-table = "no"
image = "u-boot-sunxi-with-spl.bin"
offset = 8K
}
partition boot {
partition-type = 0x0C
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 512M
}
}

Here, u-boot has in-partition-table = "no", so boot is partition 1 and rootfs is partition 2 (root=/dev/mmcblk0p2 or root=PARTUUID=12345678-02). Always verify the generated partition table on the host:

$ fdisk -l output/images/sdcard.img

Fix 3: Enable Required Storage and Filesystem Drivers (=y, not =m)

In make linux-menuconfig, verify that every required subsystem is built statically (<*> / =y), paying attention that File systems is a top-level menu rather than inside Device Drivers:

Device Drivers --->
MMC/SD/SDIO card support --->
<*> MMC block device driver (CONFIG_MMC_BLOCK)
<*> Secure Digital Host Controller Interface (CONFIG_MMC_SDHCI)
<*> SDHCI platform and OF driver helper (CONFIG_MMC_SDHCI_PLTFM)
<*> SDHCI OF support for Arasan (ZynqMP) (CONFIG_MMC_SDHCI_OF_ARASAN)
<*> Allwinner sunxi SD/MMC Host Controller (CONFIG_MMC_SUNXI)
<*> Synopsys DesignWare Memory Card Interface (CONFIG_MMC_DW)
SCSI device support --->
<*> SCSI disk support (CONFIG_BLK_DEV_SD)
<*> Serial ATA and Parallel ATA drivers (libata) ---> (CONFIG_ATA)
<*> AHCI SATA support (CONFIG_SATA_AHCI)
<*> Platform AHCI SATA support (CONFIG_SATA_AHCI_PLATFORM)
NVME Support --->
<*> NVM Express block device (CONFIG_BLK_DEV_NVME)
File systems --->
<*> The Extended 4 (ext4) filesystem (CONFIG_EXT4_FS)
[*] Use ext4 for ext2 file systems (CONFIG_EXT4_USE_FOR_EXT2)

Also verify Device Drivers ---> Generic Driver Options ---> [*] Maintain a devtmpfs filesystem to mount at /dev (CONFIG_DEVTMPFS=y) and [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs (CONFIG_DEVTMPFS_MOUNT=y) so /dev nodes exist as soon as the rootfs mounts.

Fix 4: Check Device Tree /chosen/bootargs and Kernel CONFIG_CMDLINE Precedence

Precedence between the kernel config, U-Boot, and the Device Tree follows a strict hierarchy:

  1. CONFIG_CMDLINE_FORCE=y (Linux .config): Highest priority — forces the kernel’s hardcoded CONFIG_CMDLINE and discards anything passed by U-Boot or the .dtb.
  2. U-Boot $bootargs via fdt_chosen(): When U-Boot runs bootz/bootm/booti with a non-empty bootargs environment variable, fdt_chosen() overwrites /chosen/bootargs inside the DTB passed to Linux.
  3. Device Tree /chosen/bootargs (.dts): Takes effect when U-Boot’s bootargs is unset/empty, or when a custom boot flow skips fdt_chosen():
/chosen {
bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p1";
stdout-path = "serial0:115200n8";
};

If an outdated .dts /chosen/bootargs or CONFIG_CMDLINE_FORCE is interfering:

  1. Disable CONFIG_CMDLINE_FORCE in make linux-menuconfig (use CONFIG_CMDLINE_FROM_BOOTLOADER=y).
  2. Remove hardcoded bootargs from the board .dts (keep stdout-path) and manage bootargs in U-Boot / boot.cmd / extlinux.conf.
  3. To inspect or patch the loaded FDT manually in U-Boot before booting, point fdt addr to the loaded DTB address and resize it first. Note that if $bootargs is non-empty, bootz/bootm/booti runs fdt_chosen() and overwrites /chosen/bootargs with $bootargs — so either update $bootargs directly or delete bootargs (env delete bootargs) before relying on a patched DTB property:
=> fdt addr ${fdt_addr_r}
=> fdt resize
=> fdt print /chosen
=> setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait
=> bootz ${kernel_addr_r} - ${fdt_addr_r}

Complete Working Example: Allwinner Sun8i (Orange Pi Zero)

Consider an Orange Pi Zero (Allwinner H2+, orangepi_zero_defconfig) configured with Buildroot 2024.02+, Linux 6.6, and U-Boot 2024.01 using a two-partition SD card layout (note that upstream orangepi_zero_defconfig defaults to a single ext4 partition with extlinux.conf; separating boot and rootfs requires updating both genimage.cfg and bootargs together):

  • Raw offset 8K: u-boot-sunxi-with-spl.bin (unpartitioned)
  • Partition 1 (FAT32, boot.vfat): boot.scr, zImage, sun8i-h2-plus-orangepi-zero.dtb
  • Partition 2 (ext4, rootfs.ext4): Buildroot root filesystem

Step 1: U-Boot boot.cmd and bootargs

If your FAT boot partition uses boot.scr, update boot.cmd (not only saveenv) and compile it with mkimage:

# boot.cmd
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
fatload mmc 0:1 ${kernel_addr_r} zImage
fatload mmc 0:1 ${fdt_addr_r} sun8i-h2-plus-orangepi-zero.dtb
bootz ${kernel_addr_r} - ${fdt_addr_r}

Compile to boot.scr (or enable BR2_TARGET_UBOOT_BOOT_SCRIPT in Buildroot):

$ mkimage -C none -A arm -T script -d boot.cmd boot.scr

Step 2: Kernel Config Fragment (BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES)

Store persistent kernel overrides in a config fragment referenced by BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES rather than editing output/build/linux-6.6/.config directly (which make linux-dirclean wipes):

# board/custom/orangepi-zero/linux-mmc-rootfs.fragment
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_SUNXI=y
CONFIG_PWRSEQ_SIMPLE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

Step 3: Buildroot genimage.cfg

Include u-boot-sunxi-with-spl.bin at offset = 8K with in-partition-table = "no" so the Allwinner BootROM loads SPL while boot and rootfs stay at partitions 1 and 2:

image boot.vfat {
vfat {
files = {
"zImage",
"sun8i-h2-plus-orangepi-zero.dtb",
"boot.scr"
}
}
size = 16M
}
image sdcard.img {
hdimage { }
partition u-boot {
in-partition-table = "no"
image = "u-boot-sunxi-with-spl.bin"
offset = 8K
size = 1016K
}
partition boot {
partition-type = 0x0C
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 512M
}
}

Step 4: Flash and Boot

$ sudo dd if=output/images/sdcard.img of=/dev/sdX bs=4M status=progress conv=fsync

Illustrative serial console boot log after fixing bootargs, genimage.cfg, and built-in drivers:

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.6.0 (buildroot@build) (arm-buildroot-linux-gnueabihf-gcc 13.2.0)
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[ 1.812410] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.930115] mmc0: new high speed SDHC card at address aaaa
[ 1.938420] mmcblk0: mmc0:aaaa SC16G 14.8 GiB
[ 1.946204] mmcblk0: p1 p2
[ 2.041890] EXT4-fs (mmcblk0p2): mounted filesystem a1b2c3d4-0000-0000-0000-000000000000 ro with ordered data mode. Quota mode: none.
[ 2.054112] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.061905] devtmpfs: mounted
[ 2.069440] Freeing unused kernel memory: 1024K
[ 2.075301] Run /sbin/init as init process

Initramfs Considerations

If your Buildroot configuration links an initramfs into the kernel (BR2_TARGET_ROOTFS_INITRAMFS=y, which automatically selects BR2_TARGET_ROOTFS_CPIO=y and populates CONFIG_INITRAMFS_SOURCE), the boot flow changes completely. During do_basic_setup(), populate_rootfs() extracts the CPIO archive into the RAM-backed rootfs. Because /init (ramdisk_execute_command) exists inside rootfs, kernel_init_freeable() executes /init directly and skips prepare_namespace() and mount_block_root() (so no VFS: Mounted root (...) line is printed).

If that initramfs is acting as a pivot stage to mount a real storage partition and fails, you will instead see /init exit with an Attempted to kill init! panic:

Freeing unused kernel memory: 1024K
Run /init as init process
/init: line 12: can't open /dev/mmcblk0p2: No such file or directory
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

When using an initramfs /init script to switch to a real block rootfs, ensure it:

  1. Mounts proc, sysfs, and devtmpfs (mount -t devtmpfs devtmpfs /dev) so /dev device nodes appear dynamically (CONFIG_DEVTMPFS_MOUNT only auto-mounts /dev inside prepare_namespace(), which is bypassed whenever /init executes from initramfs)
  2. Loads any modular storage/filesystem drivers if they are =m inside the initramfs (modprobe mmc_block && modprobe sunxi-mmc)
  3. Waits for the target block node (while [ ! -b /dev/mmcblk0p2 ]; do sleep 0.1; done)
  4. Mounts the real rootfs at /mnt/root, moves pseudo-filesystems if needed, and executes exec switch_root /mnt/root /sbin/init

In Buildroot, the default CPIO/initramfs entry script lives at fs/cpio/init (fs/initramfs/initramfs.mk only handles re-linking the CPIO archive into the Linux kernel). To customize /init, supply a custom executable /init via a rootfs overlay (BR2_ROOTFS_OVERLAY) or a BR2_ROOTFS_POST_BUILD_SCRIPT.

Debugging with earlycon and earlyprintk

When a panic or silent hang occurs before the serial TTY driver initializes, early console output reveals the exact failure point:

  • Modern DT / cross-architecture (earlycon): Enable CONFIG_SERIAL_EARLYCON=y (and CONFIG_SERIAL_8250_CONSOLE=y or your SoC UART console driver), ensure /chosen/stdout-path is set in the .dts, and pass earlycon in bootargs (or explicitly: earlycon=uart8250,mmio32,0x01c28000,115200n8). This works across ARM32, ARM64, and RISC-V.
  • 32-bit ARM legacy (earlyprintk): Pass earlyprintk in bootargs:
=> setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait

On 32-bit ARM (arch/arm), earlyprintk does not read the Device Tree. It requires CONFIG_DEBUG_LL=y, CONFIG_EARLY_PRINTK=y, and the compile-time SoC UART selection in Kconfig (for example CONFIG_DEBUG_SUNXI_UART0=y, setting CONFIG_DEBUG_UART_PHYS=0x01c28000 and CONFIG_DEBUG_UART_VIRT=0xf1c28000). Once U-Boot transfers control to Linux (head.S / setup_arch()), kernel messages appear immediately without waiting for full serial driver initialization.

Verification Steps

1. Confirm Kernel Command Line at Runtime

# On target (if you reach shell)
$ cat /proc/cmdline
console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait

If root= is missing or points to the wrong partition, check boot.cmd / extlinux.conf, U-Boot bootargs, and kernel CONFIG_CMDLINE_FORCE.

2. Verify Root Partition Exists in U-Boot

# In U-Boot (for GPT tables, use 'part list mmc 0' as well)
=> mmc dev 0
=> mmc part
Partition Map for MMC device 0 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 2048 32768 12345678-01 0c Boot
2 34816 1048576 12345678-02 83

Confirm partition 2 has Linux type 83 (or Linux filesystem GUID on GPT) and matches root=/dev/mmcblk0p2 or root=PARTUUID=12345678-02.

3. Check Kernel Driver Binding

# On target
$ dmesg | grep -i mmc
[ 1.760120] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.812410] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.930115] mmc0: new high speed SDHC card at address aaaa
[ 1.938420] mmcblk0: mmc0:aaaa SC16G 14.8 GiB

The host controller driver (sunxi-mmc at 0x01c0f000) probed cleanly and registered mmcblk0.

4. Validate Filesystem Integrity

# On host (read-only check before flashing)
$ fsck.ext4 -fn output/images/rootfs.ext4
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs.ext4: 1234/32768 files (0.1% non-contiguous), 18432/131072 blocks

5. Verify Kernel Config for Rootfs Drivers

$ grep -E '^CONFIG_(MMC|MMC_BLOCK|MMC_SUNXI|ATA|SATA_AHCI|SATA_AHCI_PLATFORM|NVME_CORE|BLK_DEV_NVME|SCSI|BLK_DEV_SD|EXT4_FS|DEVTMPFS|DEVTMPFS_MOUNT)=' output/build/linux-*/.config
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_SUNXI=y
CONFIG_EXT4_FS=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

Every driver required to reach and mount the rootfs must show =y, not =m or is not set.

Common Pitfalls

PitfallSymptomFix
root= uses /dev/sda1 on MMC/SDPanic persists (unknown-block(0,0))Use /dev/mmcblk0pX or PARTUUID= for SD/eMMC
root=UUID=... passed without initramfsCannot open root device "UUID=..."Use root=PARTUUID=... for direct kernel boot, or enable an initramfs
rootwait omitted on slow MMC/USB probeIntermittent panic on bootAdd rootwait so prepare_namespace() waits for device registration
Storage or FS driver built as =mBlock device or FS never mountsRebuild kernel with required drivers as =y
mmcblk0/mmcblk1 probe order flipsWorks with SD card, fails on eMMC-only bootPin DT aliases { mmc0 = ...; } or boot via root=PARTUUID=...
genimage regenerates MBR disk-signaturePARTUUID changes after image rebuildPin disk-signature (MBR) or partition-uuid (GPT) in genimage.cfg
boot.scr / extlinux.conf or CONFIG_CMDLINE_FORCE overrides saveenvsetenv bootargs reverts on rebootUpdate boot.cmd / extlinux.conf and disable CONFIG_CMDLINE_FORCE
Initramfs /init missing devtmpfs or pivotKernel runs /init then panics on missing /dev/mmcblk0p2Mount devtmpfs, load drivers, wait for node, then exec switch_root
Wrong console device in bootargsSilent hang after Starting kernel ...Match console= to SoC UART (ttyS0, ttyAMA0, ttyLP0) and enable earlycon

Boot Flow and Rootfs Mount Failure Points

+----------------------+ +----------------------+ +----------------------+
| U-Boot | | Linux Early Boot | | VFS Rootfs Mount |
+----------------------+ +----------------------+ +----------------------+
| 1. Load zImage + DTB |-->| 1. Scan /chosen/ | | 1. If /init exists: |
| 2. Run boot.scr or | | bootargs cmdline | | exec /init (cpio) |
| extlinux.conf | | 2. Probe block + FS |-->| 2. Else prepare_ |
| 3. fdt_chosen() sets | | drivers (=y) | | namespace() -> |
| /chosen/bootargs | | 3. Wait if rootwait | | early_lookup_bdev |
| from $bootargs | | is set on cmdline | | 3. mount_block_root |
| | | | | 4. exec /sbin/init |
+----------------------+ +----------------------+ +----------------------+
| | |
v v v
+----------------------------------------------------------------------------+
| FAILURE MODES |
| [X] No root=, or root=UUID= without initramfs -> unknown-block(0,0) |
| [X] Wrong partition in root= or no rootwait -> unknown-block(0,0) |
| [X] Storage driver =m (no block dev probed) -> unknown-block(0,0) |
| [X] Block dev ok, FS =m or corrupt superblock -> unknown-block(179,2) |
| [X] Initramfs /init exits before switch_root -> Attempted to kill init! |
+----------------------------------------------------------------------------+

Summary

The VFS: Unable to mount root fs on unknown-block(0,0) panic is a boot configuration or kernel-config mismatch rather than a runtime code defect:

  1. Verify U-Boot bootargs and boot scripts — ensure root=/dev/<device> rootwait (or root=PARTUUID=...) reaches /proc/cmdline and is not overwritten by boot.scr, extlinux.conf, or CONFIG_CMDLINE_FORCE
  2. Match genimage.cfg partition order — confirm in-partition-table = "no" on raw bootloader regions so the rootfs lands on the expected partition number
  3. Build storage and filesystem drivers as =y — controller, block (CONFIG_MMC_BLOCK, CONFIG_BLK_DEV_SD, CONFIG_BLK_DEV_NVME), CONFIG_DEVTMPFS_MOUNT, and filesystem (CONFIG_EXT4_FS) drivers must be built-in when booting without an initramfs
  4. Use kernel-native PARTUUID= (not UUID=) for direct boot — name_to_dev_t() / early_lookup_bdev() cannot resolve filesystem UUID= without userspace initramfs tooling
  5. If using initramfs — remember fs/cpio/init runs directly and skips prepare_namespace(); mount devtmpfs, load any modules, wait for the block node, and exec switch_root

Once the bootloader, partition table, and built-in kernel drivers agree, mount_block_root() mounts the root filesystem cleanly and hands execution to /sbin/init.

References

  1. Linux Kernel Documentation, The Kernel’s Command-Line Parameters (root=, rootwait, earlycon)
  2. Linux Kernel Documentation, ramfs, rootfs and initramfs
  3. Linux Kernel Documentation, MMC/SD/SDIO Card Support (driver-api/mmc)
  4. Linux Kernel Documentation, Block Layer Documentation
  5. Buildroot Project, The Buildroot User Manual — Filesystem Images
  6. Das U-Boot Documentation, Environment Variables (bootargs, bootcmd)
  7. Das U-Boot Documentation, fdt Command (fdt chosen, fdt set)
  8. Das U-Boot Documentation, mmc Command (mmc dev, mmc part)
  9. Pengutronix, genimage — Image Creation Tool

Frequently Asked Questions

What causes the 'VFS: Unable to mount root fs on unknown-block(0,0)' kernel panic?

This panic occurs when the Linux kernel fails to resolve a block device for the root filesystem during prepare_namespace(). Common causes include a missing or empty 'root=' kernel command-line parameter, missing 'rootwait' for asynchronous MMC/SD/USB probing, missing built-in storage controller drivers in the kernel, passing 'root=UUID=...' without an initramfs, or a partition mismatch between genimage.cfg and bootargs.

How do I fix the kernel command line in U-Boot to resolve this panic?

Set U-Boot's 'bootargs' environment variable to point to the exact root device and wait for probe completion: 'setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait', then persist it with 'saveenv'. If your board boots via boot.scr or extlinux/extlinux.conf, update that script or config file as well because it overrides saved bootargs on autoboot.

Why does autoboot work but manual boot fails with this panic?

In many Buildroot and U-Boot setups, 'bootcmd' (or a boot script like boot.scr / extlinux.conf) sets 'bootargs' dynamically right before executing bootz, booti, or bootm. Interrupting autoboot and manually typing load and boot commands skips that setup step, leaving 'bootargs' unset or incomplete. Always run 'printenv bootargs' and set 'bootargs' before manual booting.

What if the root device path differs between U-Boot and Linux?

Partition numbers use 1-based indexing in both U-Boot ('mmc 0:2') and Linux ('/dev/mmcblk0p2'), though controller indices ('mmc 0' vs 'mmcblk0') can shift in Linux due to asynchronous driver probing. Use 'mmc dev 0' followed by 'mmc part' (or 'part list mmc 0') in U-Boot to inspect partitions—not 'ls mmc 0:', which lists files on a single partition—and prefer 'root=PARTUUID=...' for direct kernel boot.

Can missing kernel drivers cause this panic even with correct bootargs?

Yes. Without an initramfs, every driver needed to reach and mount the root filesystem must be built directly into the kernel (=y), not as a loadable module (=m). That includes the MMC/SATA/NVMe host controller driver, block layer (CONFIG_MMC_BLOCK or CONFIG_BLK_DEV_SD / CONFIG_BLK_DEV_NVME), and the root filesystem driver (such as CONFIG_EXT4_FS=y).

Tags

buildrootembedded-linuxkernel-panicvfsbootu-boot

Share


Previous Article
Fixing UART DMA Idle Line Detection Failures on STM32
Jithin Tom

Jithin Tom

A Closer Look at C/C++, RTOS, and Embedded Systems

Related Posts

Fixing PREEMPT_RT Spinlock Sleeping Invalid Context
Fixing PREEMPT_RT Spinlock Sleeping Invalid Context
November 15, 2026
10 min
© 2026, All Rights Reserved.
Powered By Netlyft

Quick Links

Advertise with usAbout UsContact Us

Social Media