Skip to contentSkip to conversation

ubifsmount problems

U-Boot Simon Kagstrom 1 participant 2 messages Jul 7, 2009

lore
Share & tools
lore
#0 lore raw

Hi!

I'm trying to get ubifs working in U-boot on a ARM-based board (OpenRD base). I first encountered a number of build problems, and I'll send a set of patches to fix those later today, but I still can't get it to mount my filesystem. This is what I've done.

0. The board uses a Marvell 88f6281 and has a 512MB Hynix NAND flash

     http://www.hynix.com/datasheet/pdf/flash/HY27UF084G2M%20Series(Rev.0.7).pdf

which works fine with normal accesses (nand read/write etc)

1. I've created a small 4MB ubifs image with the upstream git head of mtd-utils:

     mkfs.ubifs -r vobb -m 2KiB -e 126976 -c 30 -o /tmp/ubifs.img -x zlib 
     ubinize -o /tmp/ubi.img -m 2KiB -p 128KiB -s 2KiB /tmp/ubinize.cfg -O 2048

/tmp/ubinize.cfg is below, and the rest of the options are the same as the normal OpenRD base filesystem is built with. The filesystem just contains a single file with some text in.

Linux can properly mount it (2.6.30). I've also tried with various other options, but it all fails in some way.

2. I have the following U-boot environment:

     mtdids=nand0=nand_mtd
     mtdparts=mtdparts=nand_mtd:0x100000 at 0x000000(uboot),0x400000 at 0x100000(uImage),0x1fb00000 at 0x500000(rootfs)

and I've written my filesystem image to (confusingly enough) the uImage partition using U-boots nand write command.

3. I setup the UBI partition with

Marvell>> ubi part uImage 2048
Creating 1 MTD partitions on "nand0":
0x000000100000-0x000000500000 : "mtd=1"
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=1"
UBI: MTD device size: 4 MiB
UBI: number of good PEBs: 32
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: 0
UBI: total number of reserved PEBs: 32
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 1/0

which seemingly works fine (the extra paramenter to ubi part is for the VID header offset, it's part of the coming patch set).

4. I try to mount the image with (the name is from ubinize.cfg below):

Marvell>> ubifsmount rootfs
name ubi:rootfs, flags 0x1
UBIFS: recovery needed
UBIFS error (pid 0): check_lpt_crc: invalid crc in LPT node: crc 3e1 calc 2105 UBIFS error (pid 0): ubifs_read_nnode: error -22 reading nnode at 7:29 Error reading superblock on volume 'ubi:rootfs'!

and here is where I'm stuck.

Anyone has any clue as to why this fails?

Thanks,
// Simon

[ubifs]
mode=ubi
image=/tmp/ubifs.img
vol_id=0
vol_size=2MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

#1 lore raw
Quoted 4 lines · On Tue, 7 Jul 2009 11:16:54 +0200 Simon Kagstrom…

I'm trying to get ubifs working in U-boot on a ARM-based board (OpenRD base). I first encountered a number of build problems, and I'll send a set of patches to fix those later today, but I still can't get it to mount my filesystem.

Never mind - error was on my side.

// Simon