ubifs相關

轉載自 https://www.toradex.com/community/questions/7077/how-to-make-partitions-on-slc-nand-flash-which-use.html

 

ubifs size問題討論

https://e2e.ti.com/support/arm/sitara_arm/f/791/t/409157?UBIFS-consumes-more-nand-memory

 

下面節錄至http://www.linux-mtd.infradead.org/faq/ubifs.html

What is the purpose of -c (--max-leb-cnt) mkfs.ubifs option?

It is a form of specifying file-system size. But instead of specifying the exact file-system size, this option defines the maximum file-system size (more strictly, maximum UBI volume size). For example, if you use --max-leb-cnt=200 mkfs.ubifs option, then it will be possible to put the resulting image to smaller UBI volume and mount it. But if the image is put to a larger UBI volume, the file-system will anyway take only first 200 LEBs, and the rest of the volume will be wasted.

Note, the --max-leb-cnt option does not affect the size of the resulting image file, which depends only on the amount of data in the file-system. mkfs.ubifs just writes the --max-leb-cnt value to the file-system superblocks.

This feature is quite handy on NAND flashes, because they have a random amount of initial bad eraseblocks (marked as bad in production). This means that different devices may have slightly different volume sizes (especially if the UBI auto-resize feature is used). So you may specify the maximum possible volume size and this will guarantee that the image will work on all devices, irrespectively on the amount of initial bad eraseblocks.

Fundamentally, mkfs.ubifs has to know file-system size because UBIFS maintains and stores per-LEB information (like amount of dirty and free space in each LEB) in so-called LPT area on the media. So obviously, the size of this area depends on the total amount of LEBs, i.e. on the volume size. Note, various characteristics of the LPT B-tree depend on the LPT area size, e.g., we use less bits in LPT tree keys of smaller LPT area. So do not use unnecessarily large --max-leb-cnt value to achieve better performance.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值