public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Wagner <david.wagner@free-electrons.com>
To: Gilles Ganault <gilles.ganault@free.fr>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [Ubiattach] "vtbl_check: too large reserved_pebs"
Date: Thu, 09 Jun 2011 14:42:08 +0200	[thread overview]
Message-ID: <4DF0BFA0.4030402@free-electrons.com> (raw)
In-Reply-To: <7.0.1.0.2.20110609135430.06967d28@free.fr>

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

  parent reply	other threads:[~2011-06-09 12:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 10:24 [Ubiattach] "vtbl_check: too large reserved_pebs" Gilles
2011-06-09 12:20 ` Artem Bityutskiy
2011-06-09 12:31   ` Gilles
2011-06-09 12:38 ` Artem Bityutskiy
2011-06-09 15:18   ` Gilles
2011-06-10  4:03     ` Artem Bityutskiy
2011-06-10  9:25       ` Gilles
     [not found] ` <4DF0B36E.2020605@free-electrons.com>
     [not found]   ` <7.0.1.0.2.20110609135430.06967d28@free.fr>
2011-06-09 12:42     ` David Wagner [this message]
2011-06-09 15:19       ` Gilles
2011-06-09 15:50         ` David Wagner
2011-06-09 15:51           ` Artem Bityutskiy
2011-06-09 16:15           ` Gilles
2011-06-09 16:17 ` Gilles
2011-06-09 23:05   ` Gilles
2011-06-10  0:45     ` Gilles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DF0BFA0.4030402@free-electrons.com \
    --to=david.wagner@free-electrons.com \
    --cc=gilles.ganault@free.fr \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox