TI中文支持网
TI专业的中文技术问题搜集分享网站

Nand升级UBI文件系统后,第一次启动文件系统正确,第二次启动文件系统失败

文件系统编译方式:

通过BuildRoot编译生成rootfs.ubifs

配置如下

x x (0x1f000) logical eraseblock size x x
x x (0x800) minimum I/O unit size x x
x x (2048) maximum logical eraseblock count x x
x x ubifs runtime compression (lzo) —> x x
x x Compression method (no compression) —> x x
x x () Additional mkfs.ubifs options x x
x x [*] Embed into an UBI image x x
x x (0x20000) physical eraseblock size x x
x x (512) sub-page size x x
x x [ ] Use custom config file x x
x x () Additional ubinize options

ubinize.cfg配置如下:

[ubifs]
mode=ubi
image=rootfs.ubifs
vol_id=0
vol_size=20MiB
vol_type=dynamic
vol_alignment=1
vol_name=rootfs
vol_flags=autoresize

再通过ubinize -o rootfs.img -m 2048 -p 128KiB -s 2048 -O 2048 ubinize.cfg生成rootfs.img

BOOT启动命令如下:

ubi.mtd=4,2048 root=ubi0:rootfs rootfstype=ubifs rw ip=10.86.20.50:10.86.20.20:<NULL>:<NULL>:<NULL>:eth0:off uspflag=noerase:startversion bootver=01.00.01 console=ttyO0,115200n8 mem=512M

通过open(/dev/mtd4, ),write到mtd4起始地址,第一次加载文件系统成功,

第二次启动加载文件系统失败,错误信息如下:

IP-Config: Gateway not on directly connected network.
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096, read 126976 bytes
UBIFS: recovery needed
UBI error: ubi_io_read: error -74 (ECC error) while reading 11 bytes from PEB 10:6144, read 11 bytes
UBIFS error (pid 1): ubifs_leb_read: reading 11 bytes from LEB 8:2048 failed, error -74
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 512 mtdblock0 (driver?)
1f01 2048 mtdblock1 (driver?)
1f02 5120 mtdblock2 (driver?)
1f03 5120 mtdblock3 (driver?)
1f04 24576 mtdblock4 (driver?)
1f05 24576 mtdblock5 (driver?)
1f06 256 mtdblock6 (driver?)
1f07 256 mtdblock7 (driver?)
1f08 512 mtdblock8 (driver?)
1f09 8192 mtdblock9 (driver?)
1f0a 8192 mtdblock10 (driver?)
1f0b 6144 mtdblock11 (driver?)
1f0c 6144 mtdblock12 (driver?)
1f0d 6144 mtdblock13 (driver?)
1f0e 393216 mtdblock14 (driver?)
1f0f 1024 mtdblock15 (driver?)
1f10 30208 mtdblock16 (driver?)
Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Backtrace:[<c001876c>] (dump_backtrace+0x0/0x110) from [<c0495fe4>] (dump_stack+0x18/0x1c)
r6:df024000 r5:c06458b4 r4:c0711448 r3:c06ce188
[<c0495fcc>] (dump_stack+0x0/0x1c) from [<c0496054>] (panic+0x6c/0x1a0)
[<c0495fe8>] (panic+0x0/0x1a0) from [<c0615cb0>] (mount_block_root+0x184/0x228)
r3:c06ce188 r2:00000000 r1:df02df78 r0:c0574c70
r7:00008000
[<c0615b2c>] (mount_block_root+0x0/0x228) from [<c0615fcc>] (prepare_namespace+0xac/0x1e0)
[<c0615f20>] (prepare_namespace+0x0/0x1e0) from [<c0615908>] (kernel_init+0x120/0x12c)
r5:c06aba70 r4:c06aba70
[<c06157e8>] (kernel_init+0x0/0x12c) from [<c0046b38>] (do_exit+0x0/0x67c)
r5:c06157e8 r4:00000000

yongqing wang:

查查OOB区域的布局

yongqing wang:

回复 yongqing wang:

没处理好,每次启动后将原有烧写的布局给改动了,导致下次启动不能正确识别

Shine:

请结合您用的flash型号,仔细检查一下文件系统生成时的参数配置,具体可以参考下面的帖子,也是只能挂载一次的问题。
e2echina.ti.com/…/62011

赞(0)
未经允许不得转载:TI中文支持网 » Nand升级UBI文件系统后,第一次启动文件系统正确,第二次启动文件系统失败
分享到: 更多 (0)