Kernel panic - not syncing: reading the reason after the colon

The kernel called panic(): it met a condition it cannot continue from and stopped everything. The text after the colon is the reason, written by the code that gave up.

The line

[    3.104512] VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
[    3.112961] Please append a correct "root=" boot option; here are the available partitions:
[    3.121402] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    3.129688] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0 #1
[    3.171530] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

Shortened; the timestamps and device name are illustrative. The message formats are those of Linux v6.12.

What it means

not syncing means the kernel did not try to flush file system buffers before stopping, because after a panic it no longer trusts its own state. What happens next depends on the panic= setting: with 0, the default, the board stays stopped; with a positive number the kernel prints Rebooting in N seconds.. and restarts, which on a bench looks like a boot loop.

A panic is often the second message, not the first. When an Oops or a Unable to handle kernel report is printed above it, that earlier report is the fault and the panic is only the kernel’s decision to stop because of it.

Common reasons after the colon

Applies to: Linux v6.12; the strings come from the files named.

TextPrinted byMeans
VFS: Unable to mount root fs on unknown-block(0,0)init/do_mounts.cThe root device from root= was not found or could not be mounted.
No working init found. Try passing init= option to kernel.init/main.cThe root file system mounted, but no init program could be executed.
Attempted to kill init! exitcode=0x...kernel/exit.cProcess 1 exited or was killed.
Fatal exception / Fatal exception in interruptarch traps codeAn Oops with panic_on_oops set, or an Oops in interrupt context.
stack-protector: Kernel stack is corrupted in: ...kernel/panic.cA stack canary in the named kernel function was overwritten.

Source: Linux v6.12: kernel/panic.c

Common causes

Unable to mount root fs: the kernel cannot find or read the root device

The device named in root= does not exist at the moment the kernel looks for it. Typical reasons are a wrong device or partition name, a storage or file system driver that was built as a module or left out, or a slow device such as an SD card or USB disk that had not been detected yet and no rootwait on the command line. unknown-block(0,0) means the kernel could not resolve the name to any block device at all.

Sources: Linux kernel docs: The kernel’s command-line parameters (root=, rootwait, init=, panic=) · Linux v6.12: init/do_mounts.c

No working init found: the root file system has nothing to run

The kernel mounted the root file system and then failed to execute /sbin/init, /etc/init, /bin/init and /bin/sh in turn. The kernel’s own guide lists the reasons: the binary is missing, it was built for another architecture, the shared libraries or the dynamic loader it needs are absent, or the root file system is not the one you intended.

Source: Linux kernel docs: Explaining the "No working init found." boot hang message

Attempted to kill init: process 1 died

Process 1 must never exit. When init crashes, is killed, or is a shell script that reached its end, the kernel panics with the exit code in the message. An exitcode whose low byte is a signal number, such as 0x0000000b for SIGSEGV, means init itself crashed; 0x00000100 and similar mean it exited with a status.

Source: Linux v6.12: kernel/exit.c

Fatal exception: an Oops that was not allowed to continue

An Oops normally kills only the offending process. It becomes a panic when the panic_on_oops setting is on, as it is on many production images, or when the Oops happened in interrupt context, where there is no process to kill. The Oops report printed just above carries the actual fault.

Source: Linux kernel docs: /proc/sys/kernel (panic, panic_on_oops, softlockup_panic)

What to check first

  1. Read the text after not syncing: and find it in the table. That is the reason; the register and stack dump below it only matter for the Fatal exception and stack-protector cases.
  2. Scroll up to the first error before the panic. An Unable to handle kernel line or an Oops with [#1] is the original fault, and everything after it is consequence.
  3. For a root file system panic, read the Kernel command line: line near the top of the boot log and the partition list the kernel prints just before the panic, and compare the two.
  4. If the device is on SD, eMMC or USB, add rootwait to the command line; if the driver or file system is a module, build it in or boot with an initramfs that loads it.
  5. For No working init found, mount the root file system on your host and check that init exists, that file reports the board’s architecture, and that its loader and libraries are present.
  6. Decide what the board should do next. panic=5 on the command line makes it reboot after five seconds, and a ramoops region keeps the panic log in memory across that reboot.

In NeuroTerm

On a serial tab with pattern markers on, NeuroTerm recognises this line as “Board crash: Linux kernel panic”. A coding agent connected through Terminal Use gets that name in its list of tabs and among the markers of the output it reads, with a cursor for reading the lines around it. Setup is in Terminal Use (MCP).