I have a small 'ARMv7 Processor rev 2 (v7l)' powered box running Ubuntu 10.04 LTS with kernel 2.6.37 The environment is a squashfs rootfs with a small RW config area:
# dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mtdblock11 246664 246664 0 100% /ubi1_0 6648 100 6548 2% /.profile
The box boots and operates without problems, however I am trying to access some of the /dev/mtd devices but receive errors when trying to attach:
# /usr/sbin/ubiattach /dev/ubi_ctrl -m 3ubiattach: error!: cannot attach mtd3 error 22 (Invalid argument)[2335587.812500] UBI: attaching mtd3 to ubi2[2335587.812500] UBI: physical eraseblock size: 131072 bytes (128 KiB)[2335587.812500] UBI: logical eraseblock size: 129024 bytes[2335587.812500] UBI: smallest flash I/O unit: 2048[2335587.812500] UBI: sub-page size: 512[2335587.812500] UBI: VID header offset: 512 (aligned 512)[2335587.812500] UBI: data offset: 2048[2335587.820312] UBI: max. sequence number: 0[2335587.820312] UBI error: ubi_read_volume_table: the layout volume was not found
Some devices I can access, but most I cannot. Example: /dev/mtd10 I can attach to but not /dev/mtd5
# /usr/sbin/mtdinfo /dev/mtd10 -umtd10Name: backupType: nandEraseblock size: 131072 bytes, 128.0 KiBAmount of eraseblocks: 320 (41943040 bytes, 40.0 MiB)Minimum input/output unit size: 2048 bytesSub-page size: 512 bytesOOB size: 64 bytesCharacter device major/minor: 90:20Bad blocks are allowed: trueDevice is writable: trueDefault UBI VID header offset: 512Default UBI data offset: 2048Default UBI LEB size: 129024 bytes, 126.0 KiBMaximum UBI volumes count: 128# /usr/sbin/mtdinfo /dev/mtd5 -umtd5Name: initrdType: nandEraseblock size: 131072 bytes, 128.0 KiBAmount of eraseblocks: 96 (12582912 bytes, 12.0 MiB)Minimum input/output unit size: 2048 bytesSub-page size: 512 bytesOOB size: 64 bytesCharacter device major/minor: 90:10Bad blocks are allowed: trueDevice is writable: trueDefault UBI VID header offset: 512Default UBI data offset: 2048Default UBI LEB size: 129024 bytes, 126.0 KiBMaximum UBI volumes count: 128
Added /proc/mtd output:
# cat /proc/mtd dev: size erasesize namemtd0: 00080000 00020000 "mlo"mtd1: 00100000 00020000 "uboot-1"mtd2: 00100000 00020000 "uboot-2"mtd3: 00200000 00020000 "u-boot-env"mtd4: 00c00000 00020000 "kernel"mtd5: 00c00000 00020000 "initrd"mtd6: 00a00000 00020000 "miniinitrd"mtd7: 01400000 00020000 "atb-1"mtd8: 01400000 00020000 "atb-2"mtd9: 00a00000 00020000 "profile"mtd10: 02800000 00020000 "backup"mtd11: 17f80000 00020000 "root-fs"
Installed utilities are version 1.4.5
So, I'm looking for the answer to: why can't I attach?
I later was able to get the initrd partition from /dev/mtdblock5 with dd:
initrd.dd: u-boot legacy uImage, ATB:b35e7, Linux/ARM, RAMDisk Image (gzip), 3204472 bytes, Fri Nov 16 04:33:52 2012, Load Address: 0x00000000, Entry Point: 0x00000000, Header CRC: 0x19467C60, Data CRC: 0x04C77189
But have not been able to extract its contents:
$ gunzip -l - < initrd.ddgzip: stdin: not in gzip format