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]#







  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值