Ubi: cannot reserve enough PEBs for bad PEB handling

See bootlog. I don't understand that error.
Is my image too big? Router boots from the second partition. According to partition table, kernel2+rootfs2 (ubi) is 41'943'040 bytes. I wrote a factory image of 39'190'528 bytes.

Bootlog (only interesting parts):

Creating 10 MTD partitions on "pxa3xx_nand-0":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000140000 : "u_env"
0x000000140000-0x000000180000 : "s_env"
0x000000900000-0x000000a00000 : "devinfo"
0x000000a00000-0x000003200000 : "kernel1"
0x000000e00000-0x000003200000 : "rootfs1"
0x000003200000-0x000005a00000 : "kernel2"
0x000003600000-0x000005a00000 : "ubi"
0x000005a00000-0x000008000000 : "syscfg"
0x000000180000-0x000000900000 : "unused_area"

[    2.999342] UBI: auto-attach mtd7
[    3.002704] ubi0: attaching mtd7

[    3.195148] ubi0: scanning is finished
[    3.206758] ubi0 warning: 0xc06b9e2c: cannot reserve enough PEBs for bad PEB handling, reserved 15, need 20
[    3.217082] ubi0: attached mtd7 (name "ubi", size 36 MiB)
[    3.222525] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.229422] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.236246] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.243240] ubi0: good PEBs: 288, bad PEBs: 0, corrupted PEBs: 0
[    3.249264] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    3.256538] ubi0: max/mean erase counter: 1/0, WL threshold: 256, image sequence number: 1649880070
[    3.265648] ubi0: available PEBs: 0, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 15
[    3.274981] ubi0: background thread "ubi_bgt0d" started, PID 799
[    3.281285] block ubiblock0_0: created from ubi0:0(rootfs)
[    3.286820] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem

[   18.604283] UBIFS error (ubi0:1 pid 963): 0xc038fb18: too few LEBs (9), min. is 17
[   18.613264] UBIFS error (ubi0:1 pid 961): 0xc038fb18: too few LEBs (9), min. is 17
[   18.621242] mount_root: failed to mount -t ubifs /dev/ubi0_1 /tmp/overlay: Invalid argument
[   19.143201] UBIFS error (ubi0:1 pid 968): 0xc038fb18: too few LEBs (9), min. is 17
[   19.151575] mount_root: unable to set filesystem state
[   19.156847] mount_root: switching to ubifs overlay
[   19.162032] mount_root: switching to ubifs failed - fallback to ramoverlay

Seems like the flash may be bad. There may be more information much earlier in the log.

I think it was too big. After I wrote a smaller image, everything returned to normal.

1 Like

Well, if you have bad areas and you use a smaller image that can fit in the good areas - it will work.

But it's also possible that the area is too small.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.