ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter. Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"
I create the UBI volume using the autosize options.
Does anyone have an idea about what is it and what can I do to fix this and make sure my UBI volumes work fine.
Best regards,
Alex
Here is the whole log:
UBI: attaching mtd7 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20
UBI: attached mtd7 to ubi0
UBI: MTD device name: "UserData"
UBI: MTD device size: 256 MiB
UBI: number of good PEBs: 2036
UBI: number of bad PEBs: 12
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 2036
UBI: number of PEBs reserved for bad PEB handling: 0
UBI: max/mean erase counter: 2/1
UBI: image sequence number: 0
UBI: background thread "ubi_bgt0d" started, PID 1207
UBI volume: ubi0
Volume name: userdata
UBIFS: mounted UBI device 0, volume 1, name "userdata"
UBIFS: file system size: 260757504 bytes (254646 KiB, 248 MiB, 2021 LEBs)
UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root: 0 bytes (0 KiB)
Signature · 4 lines
Best regards. Alexandre Gambier Fte Maximal France SAS
Quoted 8 lines · Alexandre Gambier
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter.
Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning:ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"
Looks like the pool of reserved PEBs is fully used. Fo how long have you been using this flash?
Quoted 1 line
UBI: attaching mtd7 to ubi0
When I see things like mtd7 - I get worried. Do you have 7 partitions on one chip? Even on old good and reliable chips this was not very good idea, let alone modern NANDs with all these unstable bits, "radiation" effects, low eraseblock max. erase count, etc...
BTW, be aware of this problem:
http://linux-mtd.infradead.org/doc/ubifs.html#L_unstable_bits
which has not been solved - we need a brave knight who'd spend time working on this issue.
Artem.
Quoted 10 lines
Quoted 8 lines
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter.
Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning:ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"Looks like the pool of reserved PEBs is fully used. Fo how long have you been using this flash?
This is a brand new flash...I've been using it for 2 months.
Quoted 6 lines
Quoted 2 lines
UBI: attaching mtd7 to ubi0
When I see things like mtd7 - I get worried. Do you have 7 partitions on one chip? Even on old good and reliable chips this was not very good idea, let alone modern NANDs with all these unstable bits, "radiation" effects, low eraseblock max. erase count, etc...
Here is my partition table
mtd0 -> UBoot -> 1 MiB
mtd1 -> UBootSettings -> 128 KiB
mtd2 -> SafeKernel -> 4 MiB => The linux kernel loaded in safe mode
to restore the main rootfs and perform maintenance.
mtd3 -> AppKernel -> 4 MiB => The linux kernel loaded in normal mode
when running the application.
mtd4 -> SafeFS => 64 MiB => The safe mode file-system. mtd5 -> AppFS => 128 MiB => The main application file-system. mtd6 -> Reserved => 54.875 MiB => Reserved during the development
stage, will be used in stable version.
mtd7 -> UserData => 256 MiB => User's data partition to store records
and log files (that will never be erased or formatted).
Quoted 3 lines
BTW, be aware of this problem:
http://linux-mtd.infradead.org/doc/ubifs.html#L_unstable_bits
thanks..The user's data partition will be the only one mounted in r/w mode...files in it are not crucial.
Quoted 2 lines
which has not been solved - we need a brave knight who'd spend time working on this issue.
A little bit to complicated for me otherwise I would love to help the MTD project.
Alex
Quoted 11 lines · Alexandre Gambier
Quoted 10 lines
Quoted 8 lines
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter.
Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning:ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"Looks like the pool of reserved PEBs is fully used. Fo how long have you been using this flash?
This is a brand new flash...I've been using it for 2 months.
OK, in this case this is most probably because you specified too large sizes in your ubinize.cfg. So that your volumes take all eraseblocks. Try to make some volumes smaller.
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 9 lines · Artem Bityutskiy
Quoted 8 lines · Alexandre Gambier
Quoted 8 lines
Quoted 8 lines
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter.
Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning:ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Looks like the pool of reserved PEBs is fully used. Fo how long have you been using this flash?
This is a brand new flash...I've been using it for 2 months.
OK, in this case this is most probably because you specified too large sizes in your ubinize.cfg. So that your volumes take all eraseblocks. Try to make some volumes smaller.
For example, for my 128MiB partition I specified 120MiB which is 7% smaller than the total size. What size would you specify for a 128MiB partition ?
thanks for your help.
Quoted 12 lines · Alexandre Gambier
Quoted 11 lines · Artem Bityutskiy
Quoted 10 lines · Alexandre Gambier
Quoted 10 lines
Quoted 8 lines
hi everyone,
I use UBI volume and UBIFS on top of a NAND device with an embedded video meter.
Everything works fine except that when a UBI volume is mounted the following warning is outputted :
"UBI warning:ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 0, need 20"Looks like the pool of reserved PEBs is fully used. Fo how long have you been using this flash?
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This is a brand new flash...I've been using it for 2 months.
OK, in this case this is most probably because you specified too large sizes in your ubinize.cfg. So that your volumes take all eraseblocks. Try to make some volumes smaller.
For example, for my 128MiB partition I specified 120MiB which is 7% smaller than the total size.
You should be able to find the UBI overhead formulas on the MTD web site. Try to specify less than that and see. You should leave enough PEBs reserved for bad eraseblocks handling - it is 1% by default.
Quoted 2 lines
What size would you specify for a 128MiB partition ? thanks for your help.
I do not have time to calculate and I do not remember. But the easiest is to use something small enough and put the auto-resize flag - it will then make it to be the maximum size. E.g., use 100MiB, boot and see to how much it resized.
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 7 lines · Artem Bityutskiy
Quoted 2 lines · Alexandre Gambier
For example, for my 128MiB partition I specified 120MiB which is 7% smaller than the total size.
You should be able to find the UBI overhead formulas on the MTD web site. Try to specify less than that and see. You should leave enough PEBs reserved for bad eraseblocks handling - it is 1% by default.
Quoted 6 lines
Quoted 2 lines
What size would you specify for a 128MiB partition ? thanks for your help.
I do not have time to calculate and I do not remember. But the easiest is to use something small enough and put the auto-resize flag - it will then make it to be the maximum size. E.g., use 100MiB, boot and see to how much it resized.
I already use the auto-resize flag...I will try to specify a smaller size and see if it fixes this warning.
Quoted 1 line
Quoted 10 lines · Alexandre Gambier
Quoted 9 lines · Artem Bityutskiy
Quoted 2 lines · Alexandre Gambier
For example, for my 128MiB partition I specified 120MiB which is 7% smaller than the total size.
You should be able to find the UBI overhead formulas on the MTD web site. Try to specify less than that and see. You should leave enough PEBs reserved for bad eraseblocks handling - it is 1% by default.
Quoted 2 lines
What size would you specify for a 128MiB partition ? thanks for your help.
Quoted 7 lines
Quoted 4 lines
I do not have time to calculate and I do not remember. But the easiest is to use something small enough and put the auto-resize flag - it will then make it to be the maximum size. E.g., use 100MiB, boot and see to how much it resized.
I already use the auto-resize flag...I will try to specify a smaller size and see if it fixes this warning.
You use it but it has no effect because the volumes are already very large and there is no room to enlarge them further. When you make your initial sizes small, then UBI will reserve 1% for bad blocks and the use the rest for the auto-resize volume. And it will print a message which you will see in your dmesg: something like "resizing from a to b".
Signature · 2 lines
Best Regards, Artem Bityutskiy
Quoted 3 lines · Artem Bityutskiy
Quoted 3 lines
Quoted 3 lines
You should be able to find the UBI overhead formulas on the MTD web site. Try to specify less than that and see. You should leave enough PEBs reserved for bad eraseblocks handling - it is 1% by default.
I found the formulas and my specified size was 2 MiB too big. Now it's fixed.
thanks for your help.
Best regards
alex