[U-Boot] ubifsmount reports "Error reading superblock", but linux can mount FS

Alex Zeffertt azeffertt at cambridgesys.com
Thu Mar 8 17:36:38 CET 2012


On 7 March 2012 14:42, Alex Zeffertt <azeffertt at cambridgesys.com> wrote:
> Hi u-booters,
>
> I have a short script in my u-boot environment which chooses which of
> two ubifs partitions to boot
> by attempting to read a release file in each one.
>
> Unfortunately, after an unclean shutdown sometimes the ubifsmount
> fails.  (By "unclean shutdown"
> I mean that the board was power cycled while doing some low bandwidth logging.)
>
> The strange thing is that Linux has no problem mounting the partition
> as its root filesystem.  This is
> very confusing because it looks like the ubifs implementation in
> u-boot is just a copy of the one in Linux.
>
> Has anyone else seen this problem?
>
>

I've now managed to repro this problem and add some debug.  It looks
like u-boot is simply running out of memory whilst trying to mount a
filesystem that "needs recovery".  (Error -12 is -ENOMEM.)  The
partition it is mounting is 240MB, but only about 40MB full.

The debug output is below after the "ubifsmount" command:



U-Boot 2011.06-00009-g3b6754e-dirty (Mar 08 2012 - 16:30:13)
OpenRD-Base

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
NAND:  512 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E6351 Initialized on egiga0
Marvell>> ubi part rootfs 2048
Creating 1 MTD partitions on "nand0":
0x000001000000-0x000010000000 : "mtd=2"
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: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=2"
UBI: MTD device size:            240 MiB
UBI: number of good PEBs:        1913
UBI: number of bad PEBs:         7
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:             0
UBI: total number of reserved PEBs: 1913
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 7/1
Marvell>> ubifsmount rootfs
UBIFS: recovery needed
UBIFS error (pid 0): replay_bud: insert_node failed: err=-12
UBIFS error (pid 0): replay_buds: replay_bud failed: err=-12
UBIFS error (pid 0): ubifs_replay_journal: replay_buds failed: err=-12
UBIFS error (pid 0): mount_ubifs: ubifs_replay_journal failed: err=-12
UBIFS error (pid 0): ubifs_fill_super: mount_ubifs failed: err=-12
UBIFS error (pid 0): ubifs_get_sb: ubifs_fill_super failed: err=-12
Error reading superblock on volume 'ubi:rootfs'!
Marvell>>



Does this help explain the issue?

Regards,

Alex


More information about the U-Boot mailing list