[Ubi] Wrong major:minor

Gilles gilles.ganault at free.fr
Mon May 30 08:06:57 EDT 2011


On Mon, 30 May 2011 11:53:44 +0200, Gilles <gilles.ganault at free.fr>
wrote:
>Any idea why mdev doesn't create /dev/ubi0?

Made some progress: To get /dev/ubi0, it's required to attach, and
_then_ rerun "mdev":
=================
> ubiattach /dev/ubi_ctrl -m 2

> mdev -s
mdev: /sys/class/block/mtdblock0/bdi: No such file or directory
mdev: /sys/class/block/mtdblock1/bdi: No such file or directory
mdev: /sys/class/block/mtdblock2/bdi: No such file or directory

> ls -al /dev/ubi*
crw-rw----    1 root     root      251,   0 Dec 31 16:14 /dev/ubi0
crw-rw----    1 root     root      251,   1 Dec 31 16:14 /dev/ubi0_0
crw-rw----    1 root     root       10,  63 Dec 31 16:00 /dev/ubi_ctrl

> ubimkvol /dev/ubi0 -m -N ubifs0
Set volume size to 253016064
mtd: Giving out device 3 to ubifs0
Volume ID 0, size 1961 LEBs (253016064 bytes, 241.3 MiB), LEB size
129024 bytes (126.0 KiB), dynamic, name "ubifs0", alignment 1

> cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00001000 "ROMfs"
mtd1: 00800000 00020000 "linux kernel(nand)"
mtd2: 0f800000 00020000 "file system(nand)"
mtd3: 0f14b800 0001f800 "ubifs0"
=================

I have a couple of questions:

1. I tried populating the mtd2/ubifs0 partition with rootfs.ubifs from
the workstation, which failed:

> cd /var/tmp ; wget -c http://workstation/roots.ubifs
> 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

So I reformated the partition, and tried with rootfs.ext2:

> ubidetach /dev/ubi_ctrl -m 2
> ubiformat /dev/mtd2 -s 512 -O 512
> ubiattach /dev/ubi_ctrl -m 2
> ubimkvol /dev/ubi0 -m -N ubifs0
> ubiupdatevol /dev/ubi0_0 /var/tmp/rootfs.ext2
> mount -t ubifs ubi0:ubifs0 /mnt
UBIFS error (pid 108): ubifs_read_node: bad node type (0 but expected
6)
UBIFS error (pid 108): ubifs_read_node: bad node at LEB 0:0
mount: mounting ubi0:ubifs0 on /mnt failed: Invalid argument

2. Since the appliance is a closed-box, users can't plug anything
anyway: In this case, besides taking more time to detect devices and
creating the relevant dev nodes, are there drawbacks about using mdev
+ dynamic dev nods over a static list of dev nodes?

3. Since the root file system lives in mtd2, which is now formatted as
Ubifs, why does ubimkvol create a third mtd partition (mtd3)? Will
writing to mtd3 write actually data to mtd2 (for persistence)?

Thank you.




More information about the linux-mtd mailing list