public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] u-boot UBI support
@ 2013-04-29  4:41 Paul B. Henson
  2013-04-29  8:57 ` Sascha Silbe
  0 siblings, 1 reply; 13+ messages in thread
From: Paul B. Henson @ 2013-04-29  4:41 UTC (permalink / raw)
  To: u-boot

I'm trying to get u-boot to read from a ubifs volume on an mx28evk
board, and failing :(.

I've got the nand partitioned:

MX28EVK U-Boot > mtdparts  

device nand0 <gpmi-nand>, # parts = 3
 #: name                size            offset          mask_flags
 0: bootloader          0x00300000      0x00000000      0
 1: recovery            0x03200000      0x00300000      0
 2: rootfs_config       0x04b00000      0x03500000      0


and u-boot attaches the partition fine:

MX28EVK U-Boot > ubi part recovery

UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=1"
UBI: MTD device size:            50 MiB
UBI: number of good PEBs:        400
UBI: number of bad PEBs:         0
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:             16
UBI: total number of reserved PEBs: 384
UBI: number of PEBs reserved for bad PEB handling: 4
UBI: max/mean erase counter: 5/2


but it fails to mount the filesystem:

MX28EVK U-Boot > ubifsmount recovery

UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
'recovery' errno=-22!


It looks like it sees the volume:

MX28EVK U-Boot > ubi info l
UBI: volume information dump:
UBI: vol_id          0
UBI: reserved_pebs   376
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        8
UBI: usable_leb_size 126976
UBI: used_ebs        376
UBI: used_bytes      47742976
UBI: last_eb_bytes   126976
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            recovery

UBI: volume information dump:
UBI: vol_id          2147479551
UBI: reserved_pebs   2
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        13
UBI: usable_leb_size 126976
UBI: used_ebs        2
UBI: used_bytes      253952
UBI: last_eb_bytes   2
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            layout volume


but just won't mount it. The same volume mounts from linux fine:

/ # ubiattach -m 1 /dev/ubi_ctrl
[   15.837687] UBI: attaching mtd1 to ubi0
[   16.704968] UBI: scanning is finished
[   16.750187] UBI: attached mtd1 (name "recovery", size 50 MiB) to ubi0
[   16.756906] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   16.763968] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   16.770718] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   16.777781] UBI: good PEBs: 400, bad PEBs: 0, corrupted PEBs: 0
[   16.783875] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   16.791062] UBI: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 2129180187
[   16.800281] UBI: available PEBs: 0, total reserved PEBs: 400, PEBs reserved for bad PEB handling: 20
[   16.810031] UBI: background thread "ubi_bgt0d" started, PID 32

/ # mount -t ubifs ubi0:recovery /mnt
[   29.049343] UBIFS: background thread "ubifs_bgt0_0" started, PID 34
[   29.359312] UBIFS: mounted UBI device 0, volume 0, name "recovery"(null)
[   29.366343] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   29.375687] UBIFS: FS size: 46473216 bytes (44 MiB, 366 LEBs), journal size 6348800 bytes (6 MiB, 50 LEBs)
[   29.385531] UBIFS: reserved for root: 0 bytes (0 KiB)
[   29.390625] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 4058B2E3-BA45-4D0D-8A7E-B95D4DCF7E72, small LPT model

/ # ls /mnt
emdebian-rootfs.tar.gz  recovery_dtb.itb        zImage
imx28-evk.dtb           recovery_initramfs.itb
libmodules.tgz          recovery_kernel.itb

Am I missing something here? u-boot is from the git arm branch as of a
few days ago. The ubi stuff was created using linux 3.8.4. Is it too new
for the ubi code in u-boot?

Thanks for any pointers...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-04-29  4:41 [U-Boot] u-boot UBI support Paul B. Henson
@ 2013-04-29  8:57 ` Sascha Silbe
  2013-04-29 20:33   ` Paul B. Henson
  2013-04-30 20:54   ` Paul B. Henson
  0 siblings, 2 replies; 13+ messages in thread
From: Sascha Silbe @ 2013-04-29  8:57 UTC (permalink / raw)
  To: u-boot

"Paul B. Henson" <henson@acm.org> writes:

> I'm trying to get u-boot to read from a ubifs volume on an mx28evk
> board, and failing :(.
[...]

> MX28EVK U-Boot > ubifsmount recovery
>
> UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
> UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
> 'recovery' errno=-22!

Try increasing CONFIG_SYS_MALLOC_LEN, e.g. to 4MiB. That fixed it for me
on a different board.

Sascha
-- 
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130429/4c422111/attachment.pgp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-04-29  8:57 ` Sascha Silbe
@ 2013-04-29 20:33   ` Paul B. Henson
  2013-04-30 20:54   ` Paul B. Henson
  1 sibling, 0 replies; 13+ messages in thread
From: Paul B. Henson @ 2013-04-29 20:33 UTC (permalink / raw)
  To: u-boot

On 4/29/2013 1:57 AM, Sascha Silbe wrote:
>> UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
>> UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
>> 'recovery' errno=-22!
>
> Try increasing CONFIG_SYS_MALLOC_LEN, e.g. to 4MiB. That fixed it for me
> on a different board.

I saw a couple of threads about that, but they looked like different 
problems. Couldn't hurt to try though and see what happens, thanks for 
the suggestion?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-04-29  8:57 ` Sascha Silbe
  2013-04-29 20:33   ` Paul B. Henson
@ 2013-04-30 20:54   ` Paul B. Henson
  2013-05-01 13:31     ` Tom Rini
  1 sibling, 1 reply; 13+ messages in thread
From: Paul B. Henson @ 2013-04-30 20:54 UTC (permalink / raw)
  To: u-boot

On 4/29/2013 1:57 AM, Sascha Silbe wrote:
>> MX28EVK U-Boot > ubifsmount recovery
>>
>> UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
>> UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
>> 'recovery' errno=-22!
>
> Try increasing CONFIG_SYS_MALLOC_LEN, e.g. to 4MiB. That fixed it for me
> on a different board.

It actually turned out to be something a lot simpler. Unlike Linux, 
u-boot only allows one active ubi partition. However, because it uses 
the code from Linux, when trying to access a file system you still need 
to specify which ubi partition it's on, which was neither intuitive nor 
obvious until I dug through the code.

When I specified "ubifsmount ubi0:recovery", it worked perfectly.

Thanks?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-04-30 20:54   ` Paul B. Henson
@ 2013-05-01 13:31     ` Tom Rini
  2013-05-02 21:52       ` Paul B. Henson
  2013-05-05  0:49       ` Paul B. Henson
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Rini @ 2013-05-01 13:31 UTC (permalink / raw)
  To: u-boot

On Tue, Apr 30, 2013 at 01:54:41PM -0700, Paul B. Henson wrote:

> On 4/29/2013 1:57 AM, Sascha Silbe wrote:
> >>MX28EVK U-Boot > ubifsmount recovery
> >>
> >>UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
> >>UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
> >>'recovery' errno=-22!
> >
> >Try increasing CONFIG_SYS_MALLOC_LEN, e.g. to 4MiB. That fixed it for me
> >on a different board.
> 
> It actually turned out to be something a lot simpler. Unlike Linux,
> u-boot only allows one active ubi partition. However, because it
> uses the code from Linux, when trying to access a file system you
> still need to specify which ubi partition it's on, which was neither
> intuitive nor obvious until I dug through the code.
> 
> When I specified "ubifsmount ubi0:recovery", it worked perfectly.
> 
> Thanks?

Would you mind patching doc/README.ubi ?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130501/2e8a10ec/attachment.pgp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-01 13:31     ` Tom Rini
@ 2013-05-02 21:52       ` Paul B. Henson
  2013-05-05  0:49       ` Paul B. Henson
  1 sibling, 0 replies; 13+ messages in thread
From: Paul B. Henson @ 2013-05-02 21:52 UTC (permalink / raw)
  To: u-boot

On 5/1/2013 6:31 AM, Tom Rini wrote:

>> When I specified "ubifsmount ubi0:recovery", it worked perfectly.
>>
> Would you mind patching doc/README.ubi ?

Hmm, looks like that currently does not document the ubifsmount command 
at all. I'll take a look at it over the weekend and see if I can freshen 
it up.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-01 13:31     ` Tom Rini
  2013-05-02 21:52       ` Paul B. Henson
@ 2013-05-05  0:49       ` Paul B. Henson
  2013-05-06 12:26         ` Tom Rini
  2013-05-06 13:07         ` Fabio Estevam
  1 sibling, 2 replies; 13+ messages in thread
From: Paul B. Henson @ 2013-05-05  0:49 UTC (permalink / raw)
  To: u-boot

On Wed, May 01, 2013 at 09:31:29AM -0400, Tom Rini wrote:

> Would you mind patching doc/README.ubi ?

Attached. Would you rather I send it to the list as a separate message?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-05  0:49       ` Paul B. Henson
@ 2013-05-06 12:26         ` Tom Rini
  2013-05-06 13:07         ` Fabio Estevam
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2013-05-06 12:26 UTC (permalink / raw)
  To: u-boot

On Sat, May 04, 2013 at 05:49:12PM -0700, Paul B. Henson wrote:

> On Wed, May 01, 2013 at 09:31:29AM -0400, Tom Rini wrote:
> 
> > Would you mind patching doc/README.ubi ?
> 
> Attached. Would you rather I send it to the list as a separate message?

As a rule, yes.  But patchwork picked this one up, and things look
good so:

Reviewed-by: Tom Rini <trini@ti.com>

And I'll apply it to master soon.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130506/a95f5d44/attachment.pgp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-05  0:49       ` Paul B. Henson
  2013-05-06 12:26         ` Tom Rini
@ 2013-05-06 13:07         ` Fabio Estevam
  2013-05-08  1:09           ` Paul B. Henson
  1 sibling, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2013-05-06 13:07 UTC (permalink / raw)
  To: u-boot

On Sat, May 4, 2013 at 9:49 PM, Paul B. Henson <henson@acm.org> wrote:
> On Wed, May 01, 2013 at 09:31:29AM -0400, Tom Rini wrote:
>
>> Would you mind patching doc/README.ubi ?
>
> Attached. Would you rather I send it to the list as a separate message?

You missed your Signed-off-by in this patch.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-06 13:07         ` Fabio Estevam
@ 2013-05-08  1:09           ` Paul B. Henson
  2013-05-08  3:01             ` Tom Rini
  0 siblings, 1 reply; 13+ messages in thread
From: Paul B. Henson @ 2013-05-08  1:09 UTC (permalink / raw)
  To: u-boot

On Mon, May 06, 2013 at 10:07:07AM -0300, Fabio Estevam wrote:

> You missed your Signed-off-by in this patch.

Oops; sorry, not that familiar with your development conventions and
didn't think to review them before sending in such a simple change. I
can resubmit it with that tag if you'd like.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-08  1:09           ` Paul B. Henson
@ 2013-05-08  3:01             ` Tom Rini
  2013-05-09  3:08               ` Paul B. Henson
  0 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2013-05-08  3:01 UTC (permalink / raw)
  To: u-boot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/07/2013 09:09 PM, Paul B. Henson wrote:
> On Mon, May 06, 2013 at 10:07:07AM -0300, Fabio Estevam wrote:
> 
>> You missed your Signed-off-by in this patch.
> 
> Oops; sorry, not that familiar with your development conventions 
> and didn't think to review them before sending in such a simple 
> change. I can resubmit it with that tag if you'd like.

All changes do, but you can just reply to this thread.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRicAPAAoJENk4IS6UOR1W8YoP/iLZjPjFgRoVPJ50qnDWkxYz
W/snk9D5ujDHPaPzY7d6mLHskORhRNyPJB+xpxzzDysM0eR6xqXpAXzH/LAzHpMF
xS20USjdrHjLjm2B5MtYWjov8xBGWPBYTerT5+YB0z2QgzQDYWfR+4GAYybE73Ma
YdZqI25iOreqFYkjqVHz3m2VyHFKnxT1csMEqpFV2s5gE678x5KEayAMK7TZHTjd
Ac4svt4QuMB1IXTNubDzB5z4WQ4EA0QCnPzUYEZWmT6c2Cvjo2GmGLyQou8bXoMS
jXfPbXMU3HuQtRfDodpQVuUF1Sk/+5PxAmHWJwAC3Tc3jlBh+8NQjElY4exu+AD1
l5mxM/63FUZI9E6ELh0P6jGf2S1MOnJTKoUGLq4Gox4X3ZQxoXfXB5DyJc42etXV
++vQia5mVTckUsVMUrJNEFVQu5gfpulpBhpXEAr1eEeO93Bdb8WswZO3mwlr3C9M
0vOv66AHJIQgjZr21SL5iQeqhFXuwGNntGGki+cELRQEQa2g3EJUYFhWmv9avipc
mMpGa7g2WHwNX0Lbw4lBu0HXKoqUD/VXaUMobTbkkp6Z4iMfi5gDDxaQOsQJE9CW
QILnsLMgjj33zVZrGf2doiTwnlfN+WsU0ZgemSPhXf70onHUp/JzNhUya/gNO9ms
k8TRZTUqZmydwcutOaFY
=ACVG
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-08  3:01             ` Tom Rini
@ 2013-05-09  3:08               ` Paul B. Henson
  2013-05-15 12:48                 ` Tom Rini
  0 siblings, 1 reply; 13+ messages in thread
From: Paul B. Henson @ 2013-05-09  3:08 UTC (permalink / raw)
  To: u-boot

On Tue, May 07, 2013 at 11:01:35PM -0400, Tom Rini wrote:

> All changes do, but you can just reply to this thread.

Ok, here it is again, with the tag.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] u-boot UBI support
  2013-05-09  3:08               ` Paul B. Henson
@ 2013-05-15 12:48                 ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2013-05-15 12:48 UTC (permalink / raw)
  To: u-boot

On Wed, May 08, 2013 at 05:08:10PM -0000, Paul B. Henson wrote:

> On Tue, May 07, 2013 at 11:01:35PM -0400, Tom Rini wrote:
> 
> > All changes do, but you can just reply to this thread.
> 
> Ok, here it is again, with the tag.
> 
> 
> >From 532cc340712c0542526be601c3f9f886e7054e5c Mon Sep 17 00:00:00 2001
> From: "Paul B. Henson" <henson@acm.org>
> Date: Sat, 4 May 2013 17:44:43 -0700
> Subject: [PATCH] Update doc/README.ubi to add description of accessing ubi
>  filesystems.
> 
> Signed-off-by: "Paul B. Henson" <henson@acm.org>

Reworded such that the commit message is:
doc/README.ubi: Add description of accessing ubi filesystems

and applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130515/01df6ceb/attachment.pgp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-05-15 12:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29  4:41 [U-Boot] u-boot UBI support Paul B. Henson
2013-04-29  8:57 ` Sascha Silbe
2013-04-29 20:33   ` Paul B. Henson
2013-04-30 20:54   ` Paul B. Henson
2013-05-01 13:31     ` Tom Rini
2013-05-02 21:52       ` Paul B. Henson
2013-05-05  0:49       ` Paul B. Henson
2013-05-06 12:26         ` Tom Rini
2013-05-06 13:07         ` Fabio Estevam
2013-05-08  1:09           ` Paul B. Henson
2013-05-08  3:01             ` Tom Rini
2013-05-09  3:08               ` Paul B. Henson
2013-05-15 12:48                 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox