通过UBI文件系统烧写flash
2012-02-29 18:55
393 查看
appfs文件太大,虽然可以在uboot通过tftp传输来烧写。但是同样也可以通过ubi文件系统来做这件事情。
Nand分区划分如下:
device nand0 <nx_2017>, # parts = 4
#: name size offset mask_flags
0: kernel 0x00a00000 0x00100000 0
1: root 0x00f00000 0x00a00000 0
2: appfs 0x05000000 0x01900000 0
3: datac 0x01700000 0x06900000 0
板子配置nfs启动以后,先将分区格式化:
# ubiformat /dev/mtd2 -y
ubiformat: mtd2 (nand), size 83886080 bytes (80.0 MiB), 640 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 639 -- 100 % complete
ubiformat: 511 eraseblocks have valid erase counter, mean value is 0
ubiformat: 129 eraseblocks are supposedly empty
ubiformat: warning!: only 511 of 640 eraseblocks have valid erase counter
ubiformat: mean erase counter 0 will be used for the rest of eraseblock
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: formatting eraseblock 639 -- 100 % complete
然后将这个分区attach到ubi文件系统中:
# ubiattach /dev/ubi_ctrl -m 2
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd2 to ubi0
UBI: MTD device name: "appfs"
UBI: MTD device size: 80 MiB
UBI: number of good PEBs: 640
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 630
UBI: total number of reserved PEBs: 10
UBI: number of PEBs reserved for bad PEB handling: 6
UBI: max/mean erase counter: 0/0
UBI: image sequence number: 1404847517
UBI: background thread "ubi_bgt0d" started, PID 695
UBI device number 0, total 640 LEBs (81264640 bytes, 77.5 MiB), available 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB)
然后创建一个volume,名字为你的mtd分区名
# ubimkvol /dev/ubi0 -N appfs -m
Set volume size to 79994880
Volume ID 0, size 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "appfs", alignment 1
然后mount这个volume到指定位置
# mount -t ubifs ubi0:appfs /mnt/
本文出自 “叶落花开” 博客,请务必保留此出处http://wb127.blog.51cto.com/2232662/792944
Nand分区划分如下:
device nand0 <nx_2017>, # parts = 4
#: name size offset mask_flags
0: kernel 0x00a00000 0x00100000 0
1: root 0x00f00000 0x00a00000 0
2: appfs 0x05000000 0x01900000 0
3: datac 0x01700000 0x06900000 0
板子配置nfs启动以后,先将分区格式化:
# ubiformat /dev/mtd2 -y
ubiformat: mtd2 (nand), size 83886080 bytes (80.0 MiB), 640 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 639 -- 100 % complete
ubiformat: 511 eraseblocks have valid erase counter, mean value is 0
ubiformat: 129 eraseblocks are supposedly empty
ubiformat: warning!: only 511 of 640 eraseblocks have valid erase counter
ubiformat: mean erase counter 0 will be used for the rest of eraseblock
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: formatting eraseblock 639 -- 100 % complete
然后将这个分区attach到ubi文件系统中:
# ubiattach /dev/ubi_ctrl -m 2
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd2 to ubi0
UBI: MTD device name: "appfs"
UBI: MTD device size: 80 MiB
UBI: number of good PEBs: 640
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 630
UBI: total number of reserved PEBs: 10
UBI: number of PEBs reserved for bad PEB handling: 6
UBI: max/mean erase counter: 0/0
UBI: image sequence number: 1404847517
UBI: background thread "ubi_bgt0d" started, PID 695
UBI device number 0, total 640 LEBs (81264640 bytes, 77.5 MiB), available 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB)
然后创建一个volume,名字为你的mtd分区名
# ubimkvol /dev/ubi0 -N appfs -m
Set volume size to 79994880
Volume ID 0, size 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "appfs", alignment 1
然后mount这个volume到指定位置
# mount -t ubifs ubi0:appfs /mnt/
本文出自 “叶落花开” 博客,请务必保留此出处http://wb127.blog.51cto.com/2232662/792944
相关文章推荐
- 将内存中的内核烧写到nandflash中;通过串口下载内核和文件系统
- 在sdram中运行的linux内核和文件系统烧写到flash中的方法
- 通过uboot给arm开发板烧写内核,文件系统
- Hi3516A项目-烧写文件系统到开发板Flash
- 嵌入式 烧写flash的文件系统为jffs2的时出现的校验
- 解决“向FLASH烧写cramfs文件系统出错:Image not a multiple of 528 bytes
- 一种新型FLASH文件系统UBI/UBIFS—-很不错的开源项目
- 通过uboot给arm开发板烧写内核,文件系统
- 通过mount将自制根文件系统烧写进n…
- Linux下通过系统调用(API)和C语言库函数对文件进行访问
- 通过Nginx訪问FastDFS文件系统并进行图片文件裁剪的性能測试和分析
- 17101101_Windows系统通过FillZilla上传文件到linux系统方法
- linux flash、分区、文件系统点滴
- Android中通过代码改变系统文件都写权限
- uboot烧写yaffs文件系统的原理
- Web系统通过EXE文件实现读取客户电脑MAC等硬件信息且兼容非IE浏览器
- ARM flash文件系统分区
- Tiny6410 通过 NFS 起根文件系统
- ubifs[ubi文件系统]
- ssh服务器安装及通过ssh实现linux系统间的文件复制