1

Our system generates a UBI partition that is being created in NAND on first boot. The system is able to read and write files there. I'm trying to create a binary file that we can use for a NAND 'gang' programmer, so that we can pre-program that partition with some files.

I create a folder/fire structure and use the following two commands:

mkfs.ubifs -r ./files -m 2048 -e 126976 -c 2047 -o ubifs.img 
ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg

ubinize.cfg: 
[files] 
mode=ubi 
vol_id=0 
vol_type=dynamic 
vol_name=fs 
vol_flags=autoresize 
image=ubifs.img

To test my file, using uboot, I program ubi.img at the right offset and boot the system. The system finds the new UBIFS partition which contains valid files! Yay!

The problem: When I change anything in the partition, touch a new file even, and reboot, the partition fails to mount, claiming a large number of ECC errors:

$ log | grep UBI
05:00:59 PM  [    INFO] [        kernel] UBIFS: background thread "ubifs_bgt1_0" started, PID 306
05:00:59 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:00:59 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:00 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:00 PM  [   ERROR] [        kernel] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:00 PM  [   ERROR] [        kernel] UBIFS error (pid 304): ubifs_scan: bad node
05:01:00 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:00 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:01 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:01 PM  [   ERROR] [        kernel] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096,
05:01:01 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096,
05:01:01 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096,
05:01:01 PM  [ WARNING] [        kernel] UBI warning: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096,
05:01:02 PM  [   ERROR] [        kernel] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096,
05:00:00 PM  [   ERROR] [        kernel] UBIFS error (pid 304): ubifs_recover_master_node: failed to recover master node
05:00:00 PM  [   ERROR] [        kernel] UBIFS error (pid 304): ubifs_recover_master_node: dumping first master node
05:00:00 PM  [    INFO] [        kernel] UBIFS: background thread "ubifs_bgt1_0" stops

  [screenshot]

Any ideas where I messed up creating my UBI image?

1 Answer 1

0

RTFM! The -F parameter fixed the errors I listed above.

http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

In addition, the ubi_reader tools has been a great help in understanding various parameters that go into mkfs and ubinize.

https://github.com/jrspruitt/ubi_reader

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .