Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

PANIC: VFS: Unable to mount root fs on unknown-block(0,0)

Wed Aug 27, 2014 3:04 pm

I'm not really expecting anyone to reply to this post as I've sorted the problem. I'm posting in case anyone else hits the same problem and googles for it.

I'm using my Pi as a midi sequencer. I tested it out to make sure all was working, then shut it down. Two days later, an hour before leaving the house to use it in anger, I tried it again, just to be sure. And I got a kernel panic just a couple of seconds into boot. Here is the last output on the console:

Code: Select all

[    2.178843] VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
[    2.200207] mmc0: read SD Status register (SSR) after 2 attempts
[    2.207822] Please append a correct "root=" boot option; here are the available partitions:
[    2.231223] mmc0: new high speed SDHC card at address 59b4
[    2.238342] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.249636] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.24+ #614
[    2.257338] [<c00139f8>] (unwind_backtrace+0x0/0xf0) from [<c0010d5c>] (show_stack+0x10/0x14)
[    2.269040] [<c0010d5c>] (show_stack+0x10/0x14) from [<c03fbf24>] (panic+0x94/0x1e4)
[    2.280128] [<c03fbf24>] (panic+0x94/0x1e4) from [<c0572f5c>] (mount_block_root+0x1a0/0x270)
[    2.292063] [<c0572f5c>] (mount_block_root+0x1a0/0x270) from [<c0573240>] (mount_root+0xf0/0x118)
[    2.304555] [<c0573240>] (mount_root+0xf0/0x118) from [<c05733cc>] (prepare_namespace+0x164/0x1c4)
[    2.317156] [<c05733cc>] (prepare_namespace+0x164/0x1c4) from [<c0572be0>] (kernel_init_freeable+0x170/0x1b4)
[    2.330790] [<c0572be0>] (kernel_init_freeable+0x170/0x1b4) from [<c03fb02c>] (kernel_init+0x8/0xe4)
[    2.343650] [<c03fb02c>] (kernel_init+0x8/0xe4) from [<c000db58>] (ret_from_fork+0x14/0x3c)
PANIC: VFS: Unable to mount root fs on unknown-block(0,0)

Entering kdb (current=0xd6850000, pid 1) due to Keyboard Entry
I booted the Pi off another SDCard and ran fsck on the unbootable card. It reported it clean. Dead SDCard? (It wouldn't be the first!) I tried imaging it with Win32DiskImager. No problems.

Eventually I found that /boot/cmdline.txt had been truncated to

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4
and the newline at the end had disappeared. After fixing it, the SDCard booted like a dream.

How cmdline.txt got corrupted is a mystery. I may have examined it with vi the previous time it booted successfully, but even though I've been using vi on and off since the 1980's and know well the havoc you can wreak with a bit of finger trouble, I'm not even sure off hand how you do delete the newline on the last line of a file.

So, if you get a kernel panic on booting, check your cmdline.txt file.

Regards - Philip

Return to “Troubleshooting”