[Ubi] Wrong major:minor

Gilles gilles.ganault at free.fr
Mon May 30 11:00:53 EDT 2011


On Mon, 30 May 2011 14:06:57 +0200, Gilles <gilles.ganault at free.fr>
wrote:
>> ubiupdatevol /dev/ubi0_0 /var/tmp/rootfs.ubifs
>> mount -t ubifs ubi0:ubifs0 /mnt
>UBIFS error (pid 87): validate_sb: LEB size mismatch: 204800 in
>superblock, 129024 real
>UBIFS error (pid 87): validate_sb: bad superblock, error 1
>mount: mounting ubi0:ubifs0 on /mnt failed: Invalid argument

After more googling, the issue was wrong numbers between the original
root image, the Ubi image, and the NAND partition.

But I'm a bit lost as to how to harmonize settings in mkfs.ubifs,
ubi.cf/ubinize, and ubiformat.

Things work OK until I run "ubimkvol":
==================
1. Turn rootfs.ubifs into ubi.img:

> vi ubi.cfg
[ubifs]
mode=ubi
image=./images/rootfs.ubifs
vol_id=0
#"vol_size field must be larger than UBIFS image,
#but smaller than total flash space"
;4.915.200 images/rootfs.ubifs
;
;mtd2: 0f800000 00020000 "file system(nand)"
;f800000 = 260.046.848
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

> ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubi.cfg

> mv ubi.img /var/www/

2. Download ubi.img from appliance:

> wget -c http://workstation/ubi.img

3. Format NAND mtd2 with ubi.img

> ubiformat /dev/mtd2 -s 512 -f ubi.img

4. Attach mtd2 to Ubi:
           
> ubiattach /dev/ubi_ctrl -m 2

5. Ask mdev to create ubi0 dev node:

> mdev -s
> ls -al /dev/ubi*

6. Create Ubi volume:

> ubimkvol /dev/ubi0 -m -N ubifs0
ubimkvol: error!: UBI device does not have free logical eraseblocks
==================

Thank you.




More information about the linux-mtd mailing list