解决那些千奇百怪的 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block 错误

传言道:80%的 Kernel panic 是都是同一个报错:

剩下 5% 是 init 设置错了,其余的是剩余各式各样的

---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block ]---

所以开个帖子,记录下遇到的那些奇奇怪怪的 VFS Panic 和解决方法

错误列表

  • [EXFAT] trying to mount...并打印分区表:https://bbs.aw-ol.com/topic/1726/share/3
  • 打印分区表出现 No filesystem could mount root, tried: xxx :https://bbs.aw-ol.com/topic/1726/share/4
  • eMMC、TF卡、SDNAND启动卡在 Waiting for root device /dev/ubiblockxxx... 不动了:https://bbs.aw-ol.com/topic/1726/share/5
  • SPI NAND、SPI NOR 启动卡在 Waiting for root device /dev/ubiblockxxx... 不动了:https://bbs.aw-ol.com/topic/1726/share/6
  • rootfs格式设置都是正确的但是还是打印分区表然后 No filesystem could mount root, tried: xxx :https://bbs.aw-ol.com/topic/1726/share/7
  • 报错 Filesystem uses "xz" compression. This is not supported:https://bbs.aw-ol.com/topic/1726/share/8

错误1

设备:全志T113 + eMMC,SDC2
错误描述:[EXFAT] trying to mount... 后 Panic,显示 MMC 分区表

LOG

[    2.345878] [EXFAT] trying to mount...
[    2.350344] VFS: Cannot open root device "mmcblk0p5" or unknown-block(179,5): error -5
[    2.359283] Please append a correct "root=" boot option; here are the available partitions:
[    2.368687] b300        15392768 mmcblk0
[    2.368690]  driver: mmcblk
[    2.376362]   b301           17219 mmcblk0p1 a0085546-4166-744a-a353-fca9272b8e45
[    2.376366]
[    2.386443]   b302            1024 mmcblk0p2 a0085546-4166-744a-a353-fca9272b8e46
[    2.386446]
[    2.396519]   b303            1024 mmcblk0p3 a0085546-4166-744a-a353-fca9272b8e47
[    2.396521]
[    2.406588]   b304           16384 mmcblk0p4 a0085546-4166-744a-a353-fca9272b8e48
[    2.406590]
[    2.416657]   b305           16384 mmcblk0p5 a0085546-4166-744a-a353-fca9272b8e49
[    2.416659]
[    2.426726]   b306            1024 mmcblk0p6 a0085546-4166-744a-a353-fca9272b8e4a
[    2.426728]
[    2.436797]   b307        15302828 mmcblk0p7 a0085546-4166-744a-a353-fca9272b8e4b
[    2.436799]
[    2.446875] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5)
[    2.456348] CPU0: stopping
[    2.459386] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.61+ #3
[    2.466119] Hardware name: Generic DT based system
[    2.471515] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[    2.480206] [] (show_stack) from [] (dump_stack+0x88/0xa4)
[    2.488313] [] (dump_stack) from [] (handle_IPI+0xd4/0x180)
[    2.496518] [] (handle_IPI) from [] (gic_handle_irq+0x70/0x78)
[    2.505016] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0xa8)
[    2.513408] Exception stack(0xc0b01f40 to 0xc0b01f88)
[    2.519077] 1f40: 000008d0 c7aba334 00000000 c01149c0 00000001 c0b00000 c0b03de4 c0b03e20
[    2.528253] 1f60: 00000000 c7bff5c0 c0a240c0 00000000 00000001 c0b01f90 c01080a0 c01080a4
[    2.537424] 1f80: 60000113 ffffffff
[    2.541342] [] (__irq_svc) from [] (arch_cpu_idle+0x2c/0x38)
[    2.549643] [] (arch_cpu_idle) from [] (do_idle+0xbc/0x128)
[    2.557845] [] (do_idle) from [] (cpu_startup_entry+0x18/0x20)
[    2.566344] [] (cpu_startup_entry) from [] (start_kernel+0x354/0x3e0)
[    2.575520] [] (start_kernel) from [<00000000>] (0x0)
[    2.582170] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5) ]---

解决

看到 [EXFAT] trying to mount... 不用慌,这只是一个障眼法,它真正的报错是 No filesystem could mount root, tried: xxx 也就是没有找到可以挂载的格式。

因为 EXFAT 的驱动很特别,他一般是之前设置的格式都没法挂载后才会尝试 EXFAT。所以实际上错误与下一个要介绍的错误是相同的。

建议关闭 exfat 看看真正的报错是什么

错误2

设备:全志T113 + eMMC,SDC2
错误描述:显示分区表后 Panic,提示没有可供挂载的格式

LOG

[    2.337965] List of all partitions:
[    2.341882] b300        15392768 mmcblk0
[    2.341885]  driver: mmcblk
[    2.349544]   b301           17219 mmcblk0p1 a0085546-4166-744a-a353-fca9272b8e45
[    2.349547]
[    2.359627]   b302            1024 mmcblk0p2 a0085546-4166-744a-a353-fca9272b8e46
[    2.359630]
[    2.369712]   b303            1024 mmcblk0p3 a0085546-4166-744a-a353-fca9272b8e47
[    2.369714]
[    2.379784]   b304           16384 mmcblk0p4 a0085546-4166-744a-a353-fca9272b8e48
[    2.379786]
[    2.389853]   b305           42232 mmcblk0p5 a0085546-4166-744a-a353-fca9272b8e49
[    2.389855]
[    2.399921]   b306            1024 mmcblk0p6 a0085546-4166-744a-a353-fca9272b8e4a
[    2.399923]
[    2.409989]   b307        15302828 mmcblk0p7 a0085546-4166-744a-a353-fca9272b8e4b
[    2.409992]
[    2.420057] No filesystem could mount root, tried:
[    2.429837]  squashfs
[    2.434530]
[    2.438364] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5)
[    2.447834] CPU0: stopping
[    2.450871] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.61+ #4
[    2.457595] Hardware name: Generic DT based system
[    2.462990] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[    2.471682] [] (show_stack) from [] (dump_stack+0x88/0xa4)
[    2.479789] [] (dump_stack) from [] (handle_IPI+0xd4/0x180)
[    2.487994] [] (handle_IPI) from [] (gic_handle_irq+0x70/0x78)
[    2.496491] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0xa8)
[    2.504883] Exception stack(0xc0b01f40 to 0xc0b01f88)
[    2.510552] 1f40: 00000a3c c7aba334 00000000 c01149c0 00000001 c0b00000 c0b03de4 c0b03e20
[    2.519728] 1f60: 00000000 c7bff5c0 c0a240c0 00000000 c0b4b7e8 c0b01f90 c01080a0 c01080a4
[    2.528900] 1f80: 60000113 ffffffff
[    2.532816] [] (__irq_svc) from [] (arch_cpu_idle+0x2c/0x38)
[    2.541118] [] (arch_cpu_idle) from [] (do_idle+0xbc/0x128)
[    2.549321] [] (do_idle) from [] (cpu_startup_entry+0x18/0x20)
[    2.557819] [] (cpu_startup_entry) from [] (start_kernel+0x354/0x3e0)
[    2.566996] [] (start_kernel) from [<00000000>] (0x0)
[    2.573643] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5) ]---

解决

检查下你的 rootfs 的格式,这里只支持 squashfs 看看你的 rootfs 是不是打包成 ext4 或者是其他什么格式的了。

错误3:

设备 全志T113 + eMMC,SDC2
错误描述:卡在 Waiting for root device /dev/ubiblock0_5... 不动了

LOG

[    3.793291] Waiting for root device /dev/ubiblock0_5...
[    3.836994] random: crng init done
[    6.927839]
[    6.927839] insmod_device_driver
[    6.927839]

解决

看设备名:ubiblock0_5ubixxxx 表示这是一个 SPI NAND 设备,如果是 SPI NOR 那一般是 mtdxxxx
再看看我们实际的启动设备,是eMMC,是一个MMC设备,应该是 mmcblkxxx 这样的才对
检查下 bootargs 里的参数,看看 root= 后面是不是设置成 SPI FLASH 了

错误4:

设备 全志T113 + SPI NAND,SPI 0
错误描述:卡在 Waiting for root device /dev/ubiblock0_5… 不动了

LOG

[    3.793291] Waiting for root device /dev/ubiblock0_5...
[    3.836994] random: crng init done
[    6.927839]
[    6.927839] insmod_device_driver
[    6.927839]

解决

看设备名:ubiblock0_5,ubixxxx 表示这是一个 SPI NAND 设备,如果是 SPI NOR 那一般是 mtdxxxx。
再看看我们实际的启动设备,也是 SPI NAND,那这里就对上了。
再看看咋们的设备树:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dhffnaLK-1690770200946)(/assets/uploads/files/1657271058379-ea4b47ee-ca68-4560-a670-90d02764d003-image.png)]
好嘛,你把 SPI0 都 disable 了他咋启动啊,设置 okay 就好了

错误5

设备:全志T113 + eMMC,SDC2
错误描述:rootfs格式设置都是正确的,驱动也有,但是还是打印分区表然后提示没有可供挂载的格式

LOG

[    2.337965] List of all partitions:
[    2.341882] b300        15392768 mmcblk0
[    2.341885]  driver: mmcblk
[    2.349544]   b301           17219 mmcblk0p1 a0085546-4166-744a-a353-fca9272b8e45
[    2.349547]
[    2.359627]   b302            1024 mmcblk0p2 a0085546-4166-744a-a353-fca9272b8e46
[    2.359630]
[    2.369712]   b303            1024 mmcblk0p3 a0085546-4166-744a-a353-fca9272b8e47
[    2.369714]
[    2.379784]   b304           16384 mmcblk0p4 a0085546-4166-744a-a353-fca9272b8e48
[    2.379786]
[    2.389853]   b305           16384 mmcblk0p5 a0085546-4166-744a-a353-fca9272b8e49
[    2.389855]
[    2.399921]   b306            1024 mmcblk0p6 a0085546-4166-744a-a353-fca9272b8e4a
[    2.399923]
[    2.409989]   b307        15302828 mmcblk0p7 a0085546-4166-744a-a353-fca9272b8e4b
[    2.409992]
[    2.420057] No filesystem could mount root, tried:
[    2.420059]  ext3
[    2.425525]  ext2
[    2.427686]  ext4
[    2.429837]  squashfs
[    2.431988]  vfat
[    2.434530]
[    2.438364] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5)
[    2.447834] CPU0: stopping
[    2.450871] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.61+ #4
[    2.457595] Hardware name: Generic DT based system
[    2.462990] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[    2.471682] [] (show_stack) from [] (dump_stack+0x88/0xa4)
[    2.479789] [] (dump_stack) from [] (handle_IPI+0xd4/0x180)
[    2.487994] [] (handle_IPI) from [] (gic_handle_irq+0x70/0x78)
[    2.496491] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0xa8)
[    2.504883] Exception stack(0xc0b01f40 to 0xc0b01f88)
[    2.510552] 1f40: 00000a3c c7aba334 00000000 c01149c0 00000001 c0b00000 c0b03de4 c0b03e20
[    2.519728] 1f60: 00000000 c7bff5c0 c0a240c0 00000000 c0b4b7e8 c0b01f90 c01080a0 c01080a4
[    2.528900] 1f80: 60000113 ffffffff
[    2.532816] [] (__irq_svc) from [] (arch_cpu_idle+0x2c/0x38)
[    2.541118] [] (arch_cpu_idle) from [] (do_idle+0xbc/0x128)
[    2.549321] [] (do_idle) from [] (cpu_startup_entry+0x18/0x20)
[    2.557819] [] (cpu_startup_entry) from [] (start_kernel+0x354/0x3e0)
[    2.566996] [] (start_kernel) from [<00000000>] (0x0)
[    2.573643] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5) ]---

解决

这一般是因为 rootfs 的数据错误,看一下是不是打包错了,把uboot打包进rootfs里了,或者是root=的分区搞错了,或者 rootfs 因为不正常关机损坏了

比如这里,mmcblk0p4mmcblk0p5 容量一模一样的,肯定是打包错了

错误5

设备:T113 + TF 卡,SDC0
错误描述:rootfs格式设置都是正确的,驱动也有,报错 Filesystem uses "xz" compression. This is not supported

LOG

[    4.049960] Filesystem uses "xz" compression. This is not supported
[    4.058133] [EXFAT] trying to mount...
[    4.062717] VFS: Cannot open root device "mmcblk0p5" or unknown-block(179,5): error -5
[    4.071559] Please append a correct "root=" boot option; here are the available partitions:
[    4.080869] b300        30253056 mmcblk0
[    4.080872]  driver: mmcblk
[    4.088504]   b301             252 mmcblk0p1 a0085546-4166-744a-a353-fca9272b8e45
[    4.088507]
[    4.098521]   b302             252 mmcblk0p2 a0085546-4166-744a-a353-fca9272b8e46
[    4.098524]
[    4.108544]   b303             252 mmcblk0p3 a0085546-4166-744a-a353-fca9272b8e47
[    4.108547]
[    4.118568]   b304            8316 mmcblk0p4 a0085546-4166-744a-a353-fca9272b8e48
[    4.118570]
[    4.128581]   b305           30992 mmcblk0p5 a0085546-4166-744a-a353-fca9272b8e49
[    4.128583]
[    4.138575]   b306        30176111 mmcblk0p6 a0085546-4166-744a-a353-fca9272b8e4a
[    4.138577]
[    4.148600] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5)
[    4.158014] CPU0: stopping
[    4.161030] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.61+ #1
[    4.167708] Hardware name: Generic DT based system
[    4.173059] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[    4.181681] [] (show_stack) from [] (dump_stack+0x88/0xa4)
[    4.189727] [] (dump_stack) from [] (handle_IPI+0xd4/0x180)
[    4.197865] [] (handle_IPI) from [] (gic_handle_irq+0x70/0x78)
[    4.206291] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0xa8)
[    4.214611] Exception stack(0xc0b01f40 to 0xc0b01f88)
[    4.220234] 1f40: 00000c60 c7abb334 00000000 c01149c0 00000001 c0b00000 c0b03de4 c0b03e20
[    4.229331] 1f60: 00000000 c7bff5c0 c0a240c0 00000000 00000001 c0b01f90 c01080a0 c01080a4
[    4.238429] 1f80: 60000113 ffffffff
[    4.242314] [] (__irq_svc) from [] (arch_cpu_idle+0x2c/0x38)
[    4.250551] [] (arch_cpu_idle) from [] (do_idle+0xbc/0x128)
[    4.258686] [] (do_idle) from [] (cpu_startup_entry+0x18/0x20)
[    4.267114] [] (cpu_startup_entry) from [] (start_kernel+0x354/0x3e0)
[    4.276219] [] (start_kernel) from [<00000000>] (0x0)
[    4.282806] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5) ]---

解决

Filesystem uses "xz" compression. This is not supported

SquashFS 不支持这个压缩格式

丢脸,看看你的 kernel menuconfig 里有没有打开 xz 压缩了,这不没开的嘛

解决那些千奇百怪的 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block 错误_第1张图片

原贴链接:https://bbs.aw-ol.com/topic/1726/
资源获取、问题讨论可以到全志在线开发者社区进行:https://www.aw-ol.com
全志及开发者最新动态可以关注全志在线微信公众号

你可能感兴趣的:(全志-量产方法&问题,全志,嵌入式,VFS,kernel,linux)