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.

Problem with UBIFS

Hello

I'm using ubifs on an omap3evm.
A few days ago, when turning the board on, I got kernel panic- the filesystem seems to be corrupted.
I didn't do anything unusual, and it worked OK for a while before this incident. 
I loaded a kernel with ubi debug options, and this is the relevant output from booting:

Starting kernel ...

[    0.000000] Linux version 2.6.37  (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #333 Tue Mar 27 09:13:53 IST 2012

[    0.000000] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f

[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

[    0.000000] Machine: OMAP3 EVM

.

.

.

.

[    1.864105] brd: module loaded

[    1.895385] loop: module loaded

[    1.910400] mtdoops: mtd device (mtddev=name/number) must be supplied

[    1.917236] omap2-nand driver initializing

[    1.922393] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron )

[    1.931152] Creating 8 MTD partitions on "omap2-nand.0":

[    1.936828] 0x000000000000-0x000000040000 : "X-Loader-NAND"

[    1.953826] 0x000000040000-0x000000060000 : "Production-Params"

[    1.968475] 0x000000060000-0x000000080000 : "Production-Params-BackUp"

[    1.983673] 0x000000080000-0x000000120000 : "U-Boot-NAND"

[    1.997253] 0x000000120000-0x000000300000 : "Boot Env-NAND"

[    2.010925] 0x000000300000-0x000000a00000 : "Reserved-Vx"

[    2.024688] 0x000000a00000-0x000001000000 : "Kernel-NAND"

[    2.038391] 0x000001000000-0x000020000000 : "File System - NAND"

[    2.057250] UBI: attaching mtd7 to ubi0

[    2.061584] UBI: physical eraseblock size:   131072 bytes (128 KiB)

[    2.068237] UBI: logical eraseblock size:    126976 bytes

[    2.073974] UBI: smallest flash I/O unit:    2048

[    2.078918] UBI: VID header offset:          2048 (aligned 2048)

[    2.085266] UBI: data offset:                4096

[    4.598907] UBI: max. sequence number:       24931

[    4.665069] UBI: attached mtd7 to ubi0

[    4.669128] UBI: MTD device name:            "File System - NAND"

[    4.675598] UBI: MTD device size:            496 MiB

[    4.680786] UBI: number of good PEBs:        3956

[    4.685791] UBI: number of bad PEBs:         12

[    4.690551] UBI: number of corrupted PEBs:   0

[    4.695281] UBI: max. allowed volumes:       128

[    4.700195] UBI: wear-leveling threshold:    4096

[    4.705108] UBI: number of internal volumes: 1

[    4.709838] UBI: number of user volumes:     1

[    4.714508] UBI: available PEBs:             0

[    4.719238] UBI: total number of reserved PEBs: 3956

[    4.724517] UBI: number of PEBs reserved for bad PEB handling: 39

[    4.730957] UBI: max/mean erase counter: 9/6

[    4.735443] UBI: image sequence number:  1173620225

[    4.741149] UBI: background thread "ubi_bgt0d" started, PID 559

.

.

.

.

[    7.193176] IP-Config: Complete:

[    7.196380]      device=eth0, addr=172.18.0.11, mask=255.224.0.0, gw=172.18.0.10,

[    7.204315]      host=omap, domain=, nis-domain=(none),

[    7.209899]      bootserver=172.18.0.10, rootserver=172.18.0.10, rootpath=

[    7.264160] UBIFS: recovery needed

[   11.032104] UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0x144318aa, read 0x8a0fbdc

[   11.041503] UBIFS error (pid 1): ubifs_check_node: bad node at LEB 2450:87512

[   11.051788] [<c00414d8>] (unwind_backtrace+0x0/0xec) from [<c01a657c>] (ubifs_check_node+0x2a0/0x2e4)

[   11.061584] [<c01a657c>] (ubifs_check_node+0x2a0/0x2e4) from [<c01ae308>] (ubifs_scan_a_node+0x1d0/0x34c)

[   11.071716] [<c01ae308>] (ubifs_scan_a_node+0x1d0/0x34c) from [<c01c3ed4>] (ubifs_recover_leb+0x150/0x9dc)

[   11.081939] [<c01c3ed4>] (ubifs_recover_leb+0x150/0x9dc) from [<c01af470>] (ubifs_replay_journal+0x95c/0x1ac4)

[   11.092529] [<c01af470>] (ubifs_replay_journal+0x95c/0x1ac4) from [<c01a2bb4>] (ubifs_fill_super+0xbec/0x19a0)

[   11.103118] [<c01a2bb4>] (ubifs_fill_super+0xbec/0x19a0) from [<c01a3c38>] (ubifs_mount+0x2d0/0x374)

[   11.112792] [<c01a3c38>] (ubifs_mount+0x2d0/0x374) from [<c00d7798>] (vfs_kern_mount+0x5c/0x144)

[   11.122100] [<c00d7798>] (vfs_kern_mount+0x5c/0x144) from [<c00d78c4>] (do_kern_mount+0x34/0xd8)

[   11.131439] [<c00d78c4>] (do_kern_mount+0x34/0xd8) from [<c00ee140>] (do_mount+0x664/0x6c4)

[   11.140289] [<c00ee140>] (do_mount+0x664/0x6c4) from [<c00ee224>] (sys_mount+0x84/0xc4)

[   11.148773] [<c00ee224>] (sys_mount+0x84/0xc4) from [<c0008dc0>] (do_mount_root+0x1c/0xb0)

[   11.157531] [<c0008dc0>] (do_mount_root+0x1c/0xb0) from [<c0009038>] (mount_block_root+0xf8/0x210)

[   11.167022] [<c0009038>] (mount_block_root+0xf8/0x210) from [<c0009294>] (prepare_namespace+0x88/0x1b0)

[   11.176971] [<c0009294>] (prepare_namespace+0x88/0x1b0) from [<c0008708>] (kernel_init+0x10c/0x14c)

[   11.186553] [<c0008708>] (kernel_init+0x10c/0x14c) from [<c003c790>] (kernel_thread_exit+0x0/0x8)

[   11.196014] UBIFS error (pid 1): ubifs_recover_leb: bad node

[   11.202026] UBIFS error (pid 1): ubifs_scanned_corruption: corruption at LEB 2450:87512

[   11.210510] UBIFS error (pid 1): ubifs_scanned_corruption: first 8192 bytes from LEB 2450:87512

[   11.230438] UBIFS error (pid 1): ubifs_recover_leb: LEB 2450 scanning failed

[   11.282196] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

[   11.289733] Please append a correct "root=" boot option; here are the available partitions:

[   11.298736] 1f00             256 mtdblock0  (driver?)

[   11.304138] 1f01             128 mtdblock1  (driver?)

[   11.309570] 1f02             128 mtdblock2  (driver?)

[   11.314880] 1f03             640 mtdblock3  (driver?)

[   11.320312] 1f04            1920 mtdblock4  (driver?)

[   11.325714] 1f05            7168 mtdblock5  (driver?)

[   11.331024] 1f06            6144 mtdblock6  (driver?)

[   11.336425] 1f07          507904 mtdblock7  (driver?)

[   11.341857] b300        15921152 mmcblk0  driver: mmcblk

[   11.347503]   b301        15921144 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1

[   11.356018] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

[   11.364807] [<c00414d8>] (unwind_backtrace+0x0/0xec) from [<c041fbac>] (panic+0x54/0x180)

[   11.373504] [<c041fbac>] (panic+0x54/0x180) from [<c0009110>] (mount_block_root+0x1d0/0x210)

[   11.382446] [<c0009110>] (mount_block_root+0x1d0/0x210) from [<c0009294>] (prepare_namespace+0x88/0x1b0)

[   11.392486] [<c0009294>] (prepare_namespace+0x88/0x1b0) from [<c0008708>] (kernel_init+0x10c/0x14c)

[   11.402069] [<c0008708>] (kernel_init+0x10c/0x14c) from [<c003c790>] (kernel_thread_exit+0x0/0x8)

 
Can anyone tell what went wrong?
Thanks in advance,
Tamar
  • Tamar,

    Did you try reproducing the issue by flashing the UBI image again and continuously rebooting? If you are able to reproduce it, could you please let me know the page size of your NAND Flash that you are using? If your NAND's page size more than 512 bytes, could you please try to disable subpages while creating the UBI image and try to see whether it crashes or not.

  • Renjith Thomas ,

       I met the same problem. The page size of my nand is 2k byte,when I copy  lots of files to the rootfs partitionat a time,then read some one of the files,will see the error message like:

    ....

    UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0xbc4b251c, read 0x60
    UBIFS error (pid 1): ubifs_check_node: bad node at LEB 51:45312                
    UBIFS error (pid 1): ubifs_read_node: expected node type 9     

    ....

    How to disable subpages ? Could you help me to solve this problem ?

  • Vincent,

    Please explain what are the steps followed in creating and flashing the file system.

  • Thomas,

    The  steps of creating my root filesystem are:

    1./mkfs.ubifs -r /my_dir/ -F -o /my_dir/ubifs.img -m 2048 -e 126976 -c 1002

    2../ubinize -o /my_dir/root_ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg

    Content of ubinize.cfg file is:

    [ubifs]
    mode=ubi
    image=/tftpboot/RFODNCC_ubifs.img
    vol_id=0
    vol_size=121MiB
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize

    I get my root filesystem MTD partition info via mtdinfo tool,the info is :

    mtd5
    Name: Root Filesystem
    Type: nand
    Eraseblock size: 131072 bytes, 128.0 KiB
    Amount of eraseblocks: 1024 (134217728 bytes, 128.0 MiB)
    Minimum input/output unit size: 2048 bytes
    Sub-page size: 512 bytes
    OOB size: 64 bytes
    Character device major/minor: 90:10
    Bad blocks are allowed: true
    Device is writable: true

    The steps of flashing my root filesystem are:

    in u-boot stage using nand flash command,

    u-boot# nand erase 0x780000 0xF880000

    u-boot# nand write 0x82000000 0x780000 0xFC0000

    Sometimes, when I finish updating some  files(actually is my application files) of rootfs via TFTP or FTP, then read or execute the application file,the error occurred,

    error message  are :

    ....
    [ 339.860931] UBIFS error (pid 2081): ubifs_check_node: bad CRC: calculated 0xa28267cf, read 0xe441ca4c
    [ 339.870697] UBIFS error (pid 2081): ubifs_check_node: bad node at LEB 252:38912
    [ 339.878387] UBIFS error (pid 2081): ubifs_read_node: expected node type 1
    [ 339.885498] UBIFS error (pid 2081): do_readpage: cannot read page 132 of inode 2265, error -117
    [ 339.962158] UBIFS error (pid 2085): ubifs_check_node: bad CRC: calculated 0xa28267cf, read 0xe441ca4c
    [ 339.971923] UBIFS error (pid 2085): ubifs_check_node: bad node at LEB 252:38912
    [ 339.979583] UBIFS error (pid 2085): ubifs_read_node: expected node type 1
    [ 339.986724] UBIFS error (pid 2085): do_readpage: cannot read page 132 of inode 2265, error -117

    ...



  • Thomas,

    Sorry for some mistakes.The correct is as follows

    Content of ubinize.cfg file is:

    [ubifs] 
    mode=ubi 
    image=/my_dir/ubifs.img 
    vol_id=0 
    vol_size=121MiB 
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize


    Best Regards

  • Vincent,

    Can you try using -s 2048 option while creating the image?

    Also could you please send the following files to my email id mentioned in my e2e profile? 

    arch/arm/mach-omap2/board-omap3evm.c or your corresponding board file.

    arch/arm/mach-omap2/board-flash.c

    arch/arm/mach-omap2/gpmc.c

    drivers/mtd/nand/nand_base.c

    drivers/mtd/nand/omap2.c

  • Hi,

    We have AM335x based processor. Flashed all the images, root file system is UBIFS type. In long run test getting the following errors

     

    [350709.733642] UBI error: ubi_io_read: error -74 (ECC error) while reading 2735 bytes from PEB 18:75944, read 2735 bytes
    [350709.744842] UBIFS error (pid 10203): ubifs_leb_read: reading 2735 bytes from LEB 16:71848 failed, error -74
    [350709.755126] UBIFS error (pid 10203): try_read_node: cannot read node type 1 from LEB 16:71848, error -74

    [350709.772186] UBI error: ubi_io_read: error -74 (ECC error) while reading 2735 bytes from PEB 18:75944, read 2735 bytes
    [350709.783508] UBIFS error (pid 10203): read_block: bad data node (block 360, inode 66)
    [350709.791717] UBIFS error (pid 10203): do_readpage: cannot read page 360 of inode 66, error -22

    Continuasly, what could be the issue

    a) Issue either NAND dirver/ ubi drivers ?

    b) Its problem with the UBIFS image creation?

    Any one having any idea? Please reply

  • Hi Renjith,

    Iam also facing the same issue, but the issue is not reproduced by disabling the sub pages while creating UBI image. What is the root cause and why do we have to disable sub pages while creating UBI image?