ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8

Aras Vaichas arasv at magellan-technology.com
Thu Aug 20 22:05:00 EDT 2009


On Thu, Aug 20, 2009 at 9:10 PM, Adrian Hunter<adrian.hunter at nokia.com> wrote:
> Aras Vaichas wrote:
>
>> /root # mount -t ubifs ubi1:spareubi /mnt
>> UBIFS error (pid 823): validate_sb: bad superblock, error 8
>> mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
>
> The journal is too big for the partition - see below where it
> says:
>
> UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
>
> You will need to force the journal smaller using mkfs.ubifs -j
> option.

Yes, that works.

I see my problem now. From mkfs.ubifs.c:

        /* Make the journal about 12.5% of main area lebs */
        c->max_bud_bytes = (lebs / 8) * (long long)c->leb_size;
        /* Make the max journal size 8MiB */
        if (c->max_bud_bytes > 8 * 1024 * 1024)
            c->max_bud_bytes = 8 * 1024 * 1024;
        if (c->max_bud_bytes < 4 * c->leb_size)
            c->max_bud_bytes = 4 * c->leb_size;

The journal size is calculated based on the maximum FS size.

This means that the *minimum" ubifs size is a function of the
*maximum* UBIFS size.  Interesting.

I chose an 8MB partition because I'm doing a lot of testing for a
factory/production flashing system, so I don't want to wait long while
I go through lots of erase/write/attach/mount cycles. Since this is
unusual, I won't worry too much about it.

Would there be a benefit to set a small fixed journal size, regardless
of UBIFS maximum size, for embedded systems?

Aras



More information about the linux-mtd mailing list