Learning

C J ccs_dba at hotmail.com
Fri Dec 20 18:56:50 EST 2013


Hi, newbie here (sorry).. trying to read and learn but haven't found 
everything I'm looking for yet.  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:

# df
Filesystem       1K-blocks      Used Available Use% Mounted on
/dev/mtdblock11     246664    246664         0 100% /
ubi1_0                6648       100      6548   2% /.profile

There
 are other /dev/mtd devices but I don't know how to mount/view them to 
see what is there.  I've been reading the mtd and ubi/ubifs info on the 
web site, and feel like I am dangerous enough to do damage :)  but don't
 want to.. (initially just want to backup what is there and be able to 
modify the roots, and understand how it all works in the process (boot 
process, possibly replacing kernel, etc))

I've tried to use the 
ubiattach command to attach to the other mtd devices but only mtd0 so 
far will attach but I don't see a volume there so don't know what to 
do..  Looking for a little help to know how to see what is on these 
other volumes/devices.  Here is some info about my system:

# /usr/sbin/mtdinfo -a
Count of MTD devices:           12
Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8, mtd9, mtd10, mtd11
Sysfs interface supported:      yes

mtd0
Name:                           mlo
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          4 (524288 bytes, 512.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:0
Bad blocks are allowed:         true
Device is writable:             true

mtd1
Name:                           uboot-1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:2
Bad blocks are allowed:         true
Device is writable:             true

mtd2
Name:                           uboot-2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:4
Bad blocks are allowed:         true
Device is writable:             true

mtd3
Name:                           u-boot-env
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:6
Bad blocks are allowed:         true
Device is writable:             true

mtd4
Name:                           kernel
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          96 (12582912 bytes, 12.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:8
Bad blocks are allowed:         true
Device is writable:             true

mtd5
Name:                           initrd
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          96 (12582912 bytes, 12.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true

mtd6
Name:                           miniinitrd
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          80 (10485760 bytes, 10.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:12
Bad blocks are allowed:         true
Device is writable:             true

mtd7
Name:                           atb-1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          160 (20971520 bytes, 20.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:14
Bad blocks are allowed:         true
Device is writable:             true

mtd8
Name:                           atb-2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          160 (20971520 bytes, 20.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:16
Bad blocks are allowed:         true
Device is writable:             true

mtd9
Name:                           profile
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          80 (10485760 bytes, 10.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:18
Bad blocks are allowed:         true
Device is writable:             true

mtd10
Name:                           backup
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          320 (41943040 bytes, 40.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:20
Bad blocks are allowed:         true
Device is writable:             true

mtd11
Name:                           root-fs
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          3068 (402128896 bytes, 383.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:22
Bad blocks are allowed:         true
Device is writable:             true


# /usr/sbin/ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:63
Present UBI devices:            ubi1

ubi1
Volumes count:                           1
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     80 (10158080 bytes, 9.7 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:  2
Current maximum erase counter value:     14
Minimum input/output unit size:          2048 bytes
Character device major/minor:            251:0
Present volumes:                         0

Volume ID:   0 (on ubi1)
Type:        dynamic
Alignment:   1
Size:        74 LEBs (9396224 bytes, 9.0 MiB)
State:       OK
Name:        profile
Character device major/minor: 251:1


# ls -l /dev | egrep "mtd|ubi"
crw-rw---- 1 root root     90,   0 Jan  1  2000 mtd0
crw-rw---- 1 root root     90,   1 Jan  1  2000 mtd0ro
crw-rw---- 1 root root     90,   2 Jan  1  2000 mtd1
crw-rw---- 1 root root     90,  20 Jan  1  2000 mtd10
crw-rw---- 1 root root     90,  21 Jan  1  2000 mtd10ro
crw-rw---- 1 root root     90,  22 Jan  1  2000 mtd11
crw-rw---- 1 root root     90,  23 Jan  1  2000 mtd11ro
crw-rw---- 1 root root     90,   3 Jan  1  2000 mtd1ro
crw-rw---- 1 root root     90,   4 Jan  1  2000 mtd2
crw-rw---- 1 root root     90,   5 Jan  1  2000 mtd2ro
crw-rw---- 1 root root     90,   6 Jan  1  2000 mtd3
crw-rw---- 1 root root     90,   7 Jan  1  2000 mtd3ro
crw-rw---- 1 root root     90,   8 Jan  1  2000 mtd4
crw-rw---- 1 root root     90,   9 Jan  1  2000 mtd4ro
crw-rw---- 1 root root     90,  10 Jan  1  2000 mtd5
crw-rw---- 1 root root     90,  11 Jan  1  2000 mtd5ro
crw-rw---- 1 root root     90,  12 Jan  1  2000 mtd6
crw-rw---- 1 root root     90,  13 Jan  1  2000 mtd6ro
crw-rw---- 1 root root     90,  14 Jan  1  2000 mtd7
crw-rw---- 1 root root     90,  15 Jan  1  2000 mtd7ro
crw-rw---- 1 root root     90,  16 Jan  1  2000 mtd8
crw-rw---- 1 root root     90,  17 Jan  1  2000 mtd8ro
crw-rw---- 1 root root     90,  18 Jan  1  2000 mtd9
crw-rw---- 1 root root     90,  19 Jan  1  2000 mtd9ro
brw-rw---- 1 root disk     31,   0 Jan  1  2000 mtdblock0
brw-rw---- 1 root disk     31,   1 Jan  1  2000 mtdblock1
brw-rw---- 1 root disk     31,  10 Jan  1  2000 mtdblock10
brw-rw---- 1 root disk     31,  11 Jan  1  2000 mtdblock11
brw-rw---- 1 root disk     31,   2 Jan  1  2000 mtdblock2
brw-rw---- 1 root disk     31,   3 Jan  1  2000 mtdblock3
brw-rw---- 1 root disk     31,   4 Jan  1  2000 mtdblock4
brw-rw---- 1 root disk     31,   5 Jan  1  2000 mtdblock5
brw-rw---- 1 root disk     31,   6 Jan  1  2000 mtdblock6
brw-rw---- 1 root disk     31,   7 Jan  1  2000 mtdblock7
brw-rw---- 1 root disk     31,   8 Jan  1  2000 mtdblock8
brw-rw---- 1 root disk     31,   9 Jan  1  2000 mtdblock9
lrwxrwxrwx 1 root root          10 Jan  1  2000 root -> mtdblock11
crw-rw---- 1 root root    251,   0 Jan  1  2000 ubi1
crw-rw---- 1 root root    251,   1 Jan  1  2000 ubi1_0
crw-rw---- 1 root root     10,  63 Jan  1  2000 ubi_ctrl

any help is greatly appreciated.. 		 	   		  


More information about the linux-mtd mailing list