2022年5月16日 星期一

[Linux] UBIFS filesystem

最近換了一顆比較大的nand flash,沒想到以前的指令無法使用,看起來是因為page size過大
mkfs.ubifs -r ./rootfs -m 8KiB -e 2080768 -c 200 -o rootfs.ubifs
Error: too large LEB size 2080768


這一顆nand flash的info
nand: Micron MT29F32G08CBADAWP
nand: 4096MiB, MLC, page size: 8192, OOB size: 744
brcmnand f0442800.nand: 4096MiB total, 2048KiB blocks, 8KiB pages, 46B OOB, 8-bit, BCH-40 (1KiB sector)


Organization
– Page size x8: 8936 bytes (8192 + 744 bytes)
– Block size: 256 pages (2048K + 186K bytes)
– Plane size: 2 planes x 1064 blocks per plane
– Device size: 32Gb: 2128 blocks


Logical eraseblock size: 2080768 bytes, 2.0 MiB
Total amount of logical eraseblocks: 243 (505626624 bytes, 482.2 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes 128
Count of bad physical eraseblocks: 2
Count of reserved physical eraseblocks: 38
Current maximum erase counter value: 2
Minimum input/output unit size: 8192 bytes
Character device major/minor: 249:0
Present volumes: 0


最後找到原因,因為舊版linux的ubifs不支援,需要用新版的linux,最後在fedora v21可以執行
sudo mkfs.ubifs -r ./rootfs -m 8KiB -e 2080768 -c 200 -o rootfs.ubifs
sudo ubinize -o mnt/rootfs.ubifs.img -m 8KiB -p 2048KiB -s 8KiB ubinize.cfg


ubinize.cfg:
[ubifs]
mode=ubi
image=rootfs.ubifs
vol_id=0
vol_size=400MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize


在板子上指令
ubiformat /dev/mtd0 -s 8192 -f rootfs.ubifs.img
ubiattach /dev/ubi_ctrl -m 0
mount -t ubifs ubi0_0 /tmp 

沒有留言:

張貼留言