UBIFS bad superblock error
Artem Bityutskiy
dedekind1 at gmail.com
Tue Feb 2 11:46:05 EST 2010
On Wed, 2010-01-20 at 09:51 +0100, dballman wrote:
> Hello,
>
> By generating a busybox image with these commands:
>
> mkfs.ubifs -U -x favor_lzo -m 1 -e 130944 -c 100 -r _install/ -o
> busybox-ubifs.img
> ubinize -o busybox-ubiimg.bin -p 128KiB -m 1 ubinize.ini
>
> ubinize.ini content:
>
> [rootfs-volume]
> mode=ubi
> image=busybox-ubifs.img
> vol_id=0
> vol_size=50MiB
> vol_type=dynamic
> vol_name=rootfs
> vol_alignment=1
> vol_flags=autoresize
>
> Then I put the .bin file on the address for the second mtd partition
> on a custom made board with NOR flash and it gives the following
> error:
> (Only relevant information is shown)
Strange. I have just tried to reproduce this on mtdram and cannot.
May be endiannes issues? Is your target platform big-endian?
If you take a look at the 'validate_sb()', you'll see it dumps the
superblock. I'd like to see this dump. You can find instructions here:
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_how_send_bugreport
Here is what I did to test:
[dedekind at eru tmp]$ pwd
/home/dedekind/tmp
[dedekind at eru tmp]$ ls
_install ubinize.ini
[dedekind at eru tmp]$ ls _install/
bin
[dedekind at eru tmp]$ mkfs.ubifs -U -x favor_lzo -m 1 -e 130944 -c 100 -r _install/ -obusybox-ubifs.img
[dedekind at eru tmp]$ ubinize -o busybox-ubiimg.bin -p 128KiB -m 1 ubinize.ini
[dedekind at eru tmp]$ sudo modprobe mtdram total_size=65536
[dedekind at eru tmp]$ sudo dd if=busybox-ubiimg.bin of=/dev/mtd0
7680+0 records in
7680+0 records out
3932160 bytes (3.9 MB) copied, 0.0120106 s, 327 MB/s
[dedekind at eru tmp]$ sudo modprobe ubi mtd=0
[dedekind at eru tmp]$ cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00020000 "mtdram test device"
[dedekind at eru tmp]$ ubinfo -a
UBI version: 1
Count of UBI devices: 1
UBI control device major/minor: 10:59
Present UBI devices: ubi0
ubi0:
Volumes count: 1
Logical eraseblock size: 130944
Total amount of logical eraseblocks: 512 (67043328 bytes, 63.9 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes 128
Count of bad physical eraseblocks: 0
Count of reserved physical eraseblocks: 0
Current maximum erase counter value: 1
Minimum input/output unit size: 1 bytes
Character device major/minor: 251:0
Present volumes: 0
Volume ID: 0 (on ubi0)
Type: dynamic
Alignment: 1
Size: 508 LEBs (66519552 bytes, 63.4 MiB)
State: OK
Name: rootfs
Character device major/minor: 251:1
[dedekind at eru tmp]$ sudo mount -t ubifs ubi0:rootfs /mnt/ubifs/
[dedekind at eru tmp]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 51403396 1629960 47162236 4% /
tmpfs 8132484 160 8132324 1% /dev/shm
/dev/sda5 73560060 38458804 31364540 56% /home
ubi0:rootfs 9952 1836 8116 19% /mnt/ubifs
[dedekind at eru tmp]$ ls /mnt/ubifs/
bin
[dedekind at eru tmp]$
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd
mailing list