This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UBI文件系统掉电出错问题请教

我的板子烧写内核、文件系统之后,系统都可以正常启动,在用过一段时间之后(几天之内掉电、上电若干次),随机会出现根文件系统无法加载的情况,系统正常工作时也未对nandflash进行大量、频繁的数据读写操作,通过串口终端打印log如下:

[    3.877593] UBIFS: recovery needed
[    4.104644] UBIFS error (pid 1): ubifs_scanned_corruption: corruption at LEB 636:0
[    4.119293] UBIFS error (pid 1): ubifs_recover_leb: LEB 636 scanning failed
[    4.128021] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
[    4.135437] Please append a correct "root=" boot option; here are the available partitions:
[    4.144195] 1f00             128 mtdblock0  (driver?)
[    4.149475] 1f01             128 mtdblock1  (driver?)
[    4.154754] 1f02             128 mtdblock2  (driver?)
[    4.160064] 1f03             128 mtdblock3  (driver?)
[    4.165344] 1f04            1920 mtdblock4  (driver?)
[    4.170623] 1f05             128 mtdblock5  (driver?)
[    4.175903] 1f06            5120 mtdblock6  (driver?)
[    4.181182] 1f07          254464 mtdblock7  (driver?)
[    4.186462] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    4.195098] Backtrace:
[    4.197692] [<c001796c>] (dump_backtrace+0x0/0x110) from [<c0368a70>] (dump_stack+0x18/0x1c)
[    4.206512]  r6:cf922000 r5:c04c3444 r4:c0543340 r3:c0510538
[    4.214355] [<c0368a58>] (dump_stack+0x0/0x1c) from [<c0368ae0>] (panic+0x6c/0x1a0)
[    4.222351] [<c0368a74>] (panic+0x0/0x1a0) from [<c0498cb4>] (mount_block_root+0x184/0x228)
[    4.231079]  r3:c0510538 r2:00000000 r1:cf81df78 r0:c041b2f0
[    4.236999]  r7:00008000
[    4.239654] [<c0498b30>] (mount_block_root+0x0/0x228) from [<c0498fd0>] (prepare_namespace+0xac/0x1d4)
[    4.249389] [<c0498f24>] (prepare_namespace+0x0/0x1d4) from [<c049890c>] (kernel_init+0x124/0x130)
[    4.258758]  r5:c04ef9b0 r4:c04ef9b0
[    4.262512] [<c04987e8>] (kernel_init+0x0/0x130) from [<c003f5a0>] (do_exit+0x0/0x67c)
[    4.270782]  r5:c04987e8 r4:00000000

那位大侠帮忙看看,这种情况一般是什么原因引起的,急等贵人相助~

  • 看上去,似乎是反复直接掉电,损坏了文件系统,导致文件系统错误,不能挂载。

    请问您能否做个实验,就是不停的直接上电掉电,看这个问题能否重现。

    如果是,就是这个问题。如果是这个问题,建议考虑用ramdisk作为rootfs

  • 感谢

           首先这种现象很随机,我也曾进行过反复上电测试,至少目前来看,重复20次以上没有出现过问题,还有一个现象需要说明的是:我们用这个硬件平台已经制作了一批产品,其中就发现了2、3台出现了这种情况,而且这种情况只发生在固定产品的固定CPU板上,连log信息里的错误地址信息都是完全一致的(出现了2、3次都是一样),期初怀疑是nandflash的问题,但是通过重新烧写文件系统又可以修复,这种情况使我又非常困惑,不知道是那里的问题了。麻烦帮我分析一下。

         另外你说可使用ramdisk作为rootfs和把ubi根文件系统设置为只读模式有什么区别吗?我理解ramdisk实际上是把文件系统镜像加载到内存中,在内存中模拟一个磁盘分区,这样就不用对nand进行操作了,不知道我的理解对不对,请指教。

  • 你的理解没错。

    另外,建议看看nand flash的时序是否在uboot和kernel中做了配置。

  • Yaoming Qin 建议看看nand flash的时序是否在uboot和kernel中做了配置。

    这个没有什么特别的,这个问题非常随机,应该和时序没太大关系吧

  • 请问您用的Linux SDK的版本是哪个?SDK06?

  • linux-3.2.0-04.06.00.08,我不知道SDK06是和这个版本怎么对应的
  • 对应关系请参考SDK release note:

    http://processors.wiki.ti.com/index.php?title=Category:AM335x&pagefrom=Davinci%2FSitara%2FIntegra+Nand+Boot+FAQ#mw-pages

    另外问下你们的NAND是SLC NAND还是MLC NAND

  • 你好,

        那个网址下面,版本对应关系我还是不太明白,我们用的nand是SLC nand

  • 看一下里面的sitara sdk x.xx.xx release note。

    比如:http://processors.wiki.ti.com/index.php/Sitara_SDK_6.00.00_Release_Notes

    可以看到SDK 06对应的PSP 04.06.00.11,这是3.2内核最稳定的版本,能否用这个版本测一下。

  •       我的内核版本对应的应该是Sitara SDK 05.05.01,可否赐教一下,如何把我现有的内核升级到SDK06,升级后是否会对我目前的一些修改造成影响?,谢谢了

  • 感觉你的SDK版本有点老,可以用SDK06做下验证。

    SDK06也是3.2的内核,你把你的相关驱动移植到这个版本上就可以了。

  • 请问您有进行测试么?有没什么进展?

  • 我们也遇到了同样的问题,不知道有没有解决

  • @leo,

    请问你用的也是SDK06么?出现的概率高么?

  • 是的,目前来看我们做了50套板子,其中有5块板子出现了类似的问题,而且问题的类型总是出现在特定的板子上,期初怀疑是硬件的问题,但是通过重新烧写文件系统,故障又能恢复,所以一直都搞不清是什么原因

  • Jian Zho,你好,感谢前期的指导,

           目前我们还没有时间和精力去做SDK06版本的移植,我当前的进展就是把根文件系统和用户程序分区独立开来,将根文件系统做了裁剪和优化,这段时间正在进行随机性掉电测试,不知道有没有效果,因为问题本身就比较随机,所以短期内还无法验证改进。

  • 周工你好,

      我现在也遇到同样的问题,SDK6.0内核是3.2的。

    对机器断电开机操作几次几会出现[    5.358968] UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0x56363931, read 0x87f83b7b
    [    5.368379] UBIFS error (pid 1): ubifs_check_node: bad node at LEB 1144:104944
    [    5.375933] UBIFS error (pid 1): ubifs_scanned_corruption: corruption at LEB 1144:104944
    [    5.390637] UBIFS error (pid 1): ubifs_scan: LEB 1144 scanning failed
    [    5.415273] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
    [    5.422710] Please append a correct "root=" boot option; here are the available partitions:
    [    5.431478] 1f00             128 mtdblock0  (driver?)
    [    5.436751] 1f01             128 mtdblock1  (driver?)
    [    5.442038] 1f02             128 mtdblock2  (driver?)
    [    5.447307] 1f03             128 mtdblock3  (driver?)
    [    5.452589] 1f04            1920 mtdblock4  (driver?)
    [    5.457862] 1f05             128 mtdblock5  (driver?)
    [    5.463143] 1f06            5120 mtdblock6  (driver?)
    [    5.468415] 1f07          254464 mtdblock7  (driver?)
    [    5.473695] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

    问题很随机,这个到底是什么问题,现在没有头绪了。

    出货了50台机器有5到6台出现这样的问题,重新烧录系统后又可以了,但是断电开机几次又这样了。

  • 这么高的概率,能否先检查下NAND部分的电压是否稳定

  • 周工,你好!

         有的重现的概率要高一些,重新烧系统后又正常了,我现在手上有机器基本上是断电开机200多次就会出现了。

         我感觉应该不是硬件问题。

  • 建议先把NAND的电压提高一点试试有没有改善。

  • 周工,

        nand电压规格书上要求电压是2.7到3.6V,现在我们的电压是3.4V左右。

  • 你好,请问你们这个问题解决了吗?如果方便,咱们可以交流一下,我的QQ:38902292,加我时写上A8

  • Jian Zhou,你好,我们的问题还是没有得到解决,中间又换了一次文件系统,根文件系统采用Cramfs,用户分区采用JFFS2或YAFFS2,又做了一段时间的测试,

    但经过若干次掉电之后还是会出现启动不了的问题:打印启动日志如下:

    [    1.651000] rtc-pcf8563 1-0051: setting system clock to 2016-05-23 09:23:55 UTC (1463995435)
    [    1.667480] VFS: Mounted root (cramfs filesystem) readonly on device 31:7.
    [    1.675231] Freeing init memory: 356K
    [    1.938995] Error -3 while decompressing!
    [    1.943206] c058a000(2574)->cff92000(4096)
    INIT: version 2.86 booting
    [    2.565093] Error -3 while decompressing!
    [    2.569335] c0588000(2574)->cff92000(4096)
    INIT: Entering runlevel: 5
    [    2.655181] Error -3 while decompressing!
    [    2.659484] c058c000(2574)->cff92000(4096)
    INIT: Id "S" respawning too fast: disabled for 5 minutes
    INIT: no more processes left in this runlevel

    按理说,根文件系统已经使用的Cramfs只读型文件系统了,不应该能被再次破坏了啊!

    这个问题已经困扰我们很长一段时间了,恳请能得到您的帮助!

  • 我们也是一样的问题,SDK6 3.2的内核。

         断电重启后就会出现文件系统出错,无法挂载跟上面描述一样,希望TI能够出来解决这个问题。

         

  • 这个问题其实和UBIFS相关,可以参考如下:

    I'm afraid this may be a UBIFS issues:

    http://www.linux-mtd.infradead.org/doc/ubifs.html#L_powercut

    I would like to highlight the specific text:

    "Year 2011 note: however, there is an unsolved unstable bits issue which makes UBI/UBIFS fail to recover after a power cut on modern SLC and MLC flashes. This issue has not been observed on older SLC NANDs back at the time UBI/UBIFS was being developed. Note, the below text is quite old and has been written before the unstable bits issue has been first discovered."

    You can also read more about the "unstable bits" issue that the documentation covers. It seems that switching from what I'm guessing is an older 1-bit ECC SLC NAND to the newer NAND that requires 8-bit ECC, they are running into this very issue.

    Since this is an older Linux kernel used in Android, I'm also assuming the UBI/UBIFS is rather old as well. So, this is still a known issue, but any work to improve it in more recent revisions probably doesn't exist in the Android package.

    There are several links and discussions on the UBI/UBIFS mailing lists that might help validate and debug the problem, but this is beyond the scope of what TI supports. And, as implied by the documentation, there is not a verified fix at this time.