Specifications

Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:8
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 2048
Default UBI data offset: 4096
Default UBI LEB size: 126976 bytes, 124.0 KiB
Maximum UBI volumes count: 128
root@generic-armv5te:~# ubinfo /dev/ubi0
ubi0
Volumes count: 1
Logical eraseblock size: 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks: 1984 (251920384 bytes, 240.2 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: 4
Current maximum erase counter value: 2
Minimum input/output unit size: 2048 bytes
Character device major/minor: 247:0
Present volumes: 0
root@generic-armv5te:~#
The interesting parameters are:
- min-io-size: corresponds to "Minimum input/output unit size"
- max-leb-cnt: corresponds to "Amount of eraseblocks"
One more needed parameter from the "ubinfo -a" command:
- leb-size: corresponds to "Logical eraseblock size"
9.1.5.3.2. Create some Test File System Hierarchy
[marex@pollux]$ cd /tmp/duts-${pid}
[marex@pollux]$ mkdir fs
[marex@pollux]$ chmod 777 fs
[marex@pollux]$ echo Just an example >fs/README
[marex@pollux]$ date >fs/date_of_creation
[marex@pollux]$ ls -l fs
total 8
-rw-rw-r-- 1 marex marex 16 Oct 2 17:01 README
-rw-rw-r-- 1 marex marex 30 Oct 2 17:01 date_of_creation
[marex@pollux]$
Create UBIFS Images for ""userfs"" (NAND)
[marex@pollux]$ mkfs.ubifs --root=fs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=1984 -o image-filesystem.ubifs
WARNING: setting root UBIFS inode UID=GID=0 (root) and permissions to u+rwx,go+rx; use --squash-rino-perm or --nosquash-rino-perm to suppress this warning
[marex@pollux]$ ls -lh image-filesystem.ubifs
-rw-rw-r-- 1 marex marex 1.7M Oct 2 17:01 image-filesystem.ubifs
[marex@pollux]$ cp image-filesystem.ubifs /opt/eldk-5.2.1/armv5te/rootfs-lsb-sdk//home/duts/
[marex@pollux]$
9.1.5.3.3. Installing UBIFS images into existing UBI Volume:
root@generic-armv5te:~# ubiattach /dev/ubi_ctrl -m 4 -O 2048
[ 158.760000] UBI: attaching mtd4 to ubi0
[ 161.500000] UBI: scanning is finished
[ 161.530000] UBI: attached mtd4 (name "filesystem", size 248 MiB) to ubi0
[ 161.530000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
9.1.5.3.1. Determining the Parameters of the used Flash Types: 104