[Ubiattach] "vtbl_check: too large reserved_pebs"

David Wagner david.wagner at free-electrons.com
Thu Jun 9 08:42:08 EDT 2011


On 06/09/2011 02:26 PM, Gilles Ganault wrote:
> Hello
> 
> At 13:50 09/06/2011, you wrote:
>> > Eraseblock size:                131072 bytes, 128.0 KiB
>> >  [...]
>> > Default UBI LEB size:           129024 bytes, 126.0 KiB
>> > Maximum UBI volumes count:      128
>> > ==============
>> > #Create root filesystem
>> > ubuntu:/> mkfs.ubifs --squash-uids -m 2048 -e 131072 -c 1984 -d
>> > ./romfs -D device_table-min.txt -o ./images/rootfs.ubifs
>> >
>>
>> The -e option of mkfs.ubifs takes the logical eraseblock size.
>> But you specified 131072, the physical eraseblock size.
>> So here, you should have -e 129024
>> The details for computing the LEB size are at
>> http://git.infradead.org/mtd-utils.git/blob/HEAD:/ubi-utils/src/libubigen.c#l40
>>
>> In most cases, the formula for the offset boils down to:
>> LEB_size = PEB_size - (((Subpage_size + Page_size) * Page_size) /
>> Page_size)
> 
> Thanks for the tip, but after recompiling a new root filesystem, I'm
> still getting the same error:
[...]
> BTW, using the formula above, I find this: 131.072 - ((( 512 + 2.048) *
> 2.048 ) / 2.048 ) = 128.512
> 
> I wonder if maybe I should leave some room in the NAND partition for the
> Ubifs journal + error log? I used vol_size=248MiB in ubi.cfg, but maybe
> this is toot big?

(I forgot to reply to all in my first answer)

Oops, sorry, the formula is
((Subpage_size + Page_size)) / Page_size) * Page_size
That is, subpage+page truncated to page.

Maybe you have to take the reserved LEBs into account: 1% of the PEBs.
I'm not sure if they are already included in what mtdinfo displays, though.

-- 
David Wagner, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the linux-mtd mailing list