ubi image only mounts once

Douglass, Woody Woodrow.Douglass at QinetiQ-NA.com
Mon Jun 6 14:31:51 EDT 2011


Artem,

Thanks, you're correct, subpages aren't working properly! First I tried applying this patch to solve the issue: https://patchwork.kernel.org/patch/749762/

The test still fails. Next, I changed the -s argument to ubinize from 512 to 2048; I also added -s 2048 to my ubiformat arguments.

Now, on boot, this happens:

[  357.992767] UBI: attaching mtd4 to ubi0
[  357.996673] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[  358.003631] UBI: logical eraseblock size:    129024 bytes
[  358.009185] UBI: smallest flash I/O unit:    2048
[  358.013916] UBI: sub-page size:              512
[  358.018646] UBI: VID header offset:          512 (aligned 512)
[  358.024505] UBI: data offset:                2048
[  358.030639] UBI error: validate_ec_hdr: bad VID header offset 2048, expected 512
[  358.038085] UBI error: validate_ec_hdr: bad EC header
[  358.043426] UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0
[  358.050292] UBI error: ubi_init: cannot attach mtd4
[  358.057708] UBI error: ubi_init: UBI error: cannot initialize UBI, error -22

How can I re set the sub-page size?

-Woody


> -----Original Message-----
> From: Artem Bityutskiy [mailto:dedekind1 at gmail.com]
> Sent: Monday, June 06, 2011 12:08 PM 12
> To: Douglass, Woody
> Cc: Matthew L. Creech; linux-mtd at lists.infradead.org
> Subject: RE: ubi image only mounts once
> 
> On Mon, 2011-06-06 at 11:53 -0400, Douglass, Woody wrote:
> > Matt,
> >
> > Thanks for the quick reply. I have tried both ubiformat (passing -f
> with
> > my image) and nandwrite, both seem to behave the same way. The
> > filesystem mounts once, but when I reboot, it doesn't ever mount
> again.
> >
> > I cannot upgrade my kernel as my development schedule is too
> aggressive;
> > I don't have time. I'm using 2.6.32 for now; if I fail at getting UBI
> to
> > work, I can fall back on jffs2, which works, but I prefer UBIFS.
> >
> > Note that I did successfully load a ubi image with this kernel In the
> > past with a filesystem image generated from OpenEmbedded. Could my
> > mkfs.ubifs/ubinize be the issue?
> 
> I am sure the problem is your OMAP flash driver - it does not support
> sub-pages correctly. There were several discussions. I have not idea
> what is your kernel and which hacks it has.
> 
> Anyway, first try to check if I was right - run the mtd_subpagetest
> test: http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests
> 
> My prediction - it will fail. Let's check this.
> 
> If I'm right - you have 2 choices:
> 
> 1. Fix the driver.
> 2. Do not use sub-pages (means you'll waste a bit more flash space).
> 
> For the latter - assume your sub-page size = page size = 2048 bytes,
> and
> adjust your mkfs.ubifs/ubinise/ubisformat parameters accordingly. Feel
> free to ask for more help - I do not want to write much now before you
> have verified my theory.
> 
> Also, running all mtd tests is a good idea.
> 
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)



More information about the linux-mtd mailing list