arm linux挂载ubi,挂载ubifs文件系统分区
閑著沒事玩玩ubifs
需要的資料可以到這個網站查詢:http://www.linux-mtd.infradead.org/faq/ubifs.html
1.格式化:????????????? ./ubiformat /dev/mtd4
2.創建ubi0節點:??? ubiattach /dev/ubi_ctrl -m 4
3.創建分區標識:??? ubimkvol /dev/ubi0 -N?rfs -s 81920
發現這里出錯了,I get: "init_constants_early: too few LEBs (12), min. is 17"
查了一下-s后邊是byte,81920太小了,才10k,果斷改大點?改成10m=10240*1024*8=83886080
4.掛載:???????????????? mount -t ubifs ubi0:rfs /mnt
測試:
創建測試文件:
重啟
Please press Enter to activate this console.
[root@EmbedSky /]#
[root@EmbedSky /]# mount -t ubifs ubi0:rfsaa /home/haha?(需要重新生成dev)
UBIFS error (pid 1613): ubifs_mount: cannot open "ubi0:rfsaa", error -19
mount: mounting ubi0:rfsaa on /home/haha failed: No such device
[root@EmbedSky /]#ubimkvol /dev/ubi0 -N rfsaa -s 83886080?(這一步其實不需要了)
ubimkvol: can't open '/dev/ubi0': No such file or directory
[root@EmbedSky /]# ubiattach /dev/ubi_ctrl -m 4(生成dev)
UBI: attaching mtd4 to ubi0
UBI: physical eraseblock size:?? 131072 bytes (128 KiB)
UBI: logical eraseblock size:??? 129024 bytes
UBI: smallest flash I/O unit:??? 2048
UBI: sub-page size:????????????? 512
UBI: VID header offset:????????? 512 (aligned 512)
UBI: data offset:??????????????? 2048
UBI: max. sequence number:?????? 14
UBI: attached mtd4 to ubi0
UBI: MTD device name:??????????? "USER1"
UBI: MTD device size:??????????? 384 MiB
UBI: number of good PEBs:??????? 3072
UBI: number of bad PEBs:???????? 0
UBI: number of corrupted PEBs:?? 0
UBI: max. allowed volumes:?????? 128
UBI: wear-leveling threshold:??? 4096
UBI: number of internal volumes: 1
UBI: number of user volumes:???? 3
UBI: available PEBs:???????????? 2379
UBI: total number of reserved PEBs: 693
UBI: number of PEBs reserved for bad PEB handling: 30
UBI: max/mean erase counter: 3/1
UBI: image sequence number:? 504227540
UBI: background thread "ubi_bgt0d" started, PID 1620
[root@EmbedSky /]# ubimkvol /dev/ubi0 -N rfs -s 83886080
UBI error: ubi_create_volume: cannot create volume 3, error -17
ubimkvol: UBI_IOCMKVOL: File exists
[root@EmbedSky /]# ubimkvol /dev/ubi0 -N rfsaa -s 83886080
UBI error: ubi_create_volume: cannot create volume 3, error -17
ubimkvol: UBI_IOCMKVOL: File exists
[root@EmbedSky /]# mount -t ubifs ubi0:rfsaa /home/haha
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 2, name "rfsaa"
UBIFS: file system size:?? 82575360 bytes (80640 KiB, 78 MiB, 640 LEBs)
UBIFS: journal size:?????? 4128768 bytes (4032 KiB, 3 MiB, 32 LEBs)
UBIFS: media format:?????? w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:? 3900238 bytes (3808 KiB)
[root@EmbedSky /]# cd /home
[root@EmbedSky /home]# ls
1??????????????????????????? hh
TQ210??????????????????????? hong.c
adc????????????????????????? hong.c~
adc.c??????????????????????? jpeg.tar.gz
adcs.c?????????????????????? led (copy).c~
adcs.c~????????????????????? led.c
arm-linux??????????????????? led.c~
beep???????????????????????? led1
beep.c?????????????????????? led2
beep.c~????????????????????? mjpg-streamer-r63
cap.c??????????????????????? rootfs_linux_v1.4_CoreB.bin
cap.c~?????????????????????? sky
capture01.jpg??????????????? test-mmap.jpg
ds18???????????????????????? test.bin
ds18b20????????????????????? test2
[root@EmbedSky /home]# cd haha
[root@EmbedSky haha]# ls(創建的文件還在,掛載成功)
haha.txt
[root@EmbedSky haha]#
總結
以上是生活随笔為你收集整理的arm linux挂载ubi,挂载ubifs文件系统分区的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Tensorflow 错误总结:Name
- 下一篇: 时频分析:短时傅里叶变换实现(1)