永发信息网

如何使用大于16TB的ext4文件系统

答案:1  悬赏:0  手机版
解决时间 2021-11-16 00:51
如何使用大于16TB的ext4文件系统
最佳答案
很多人用mkfs.ext4尝试不通之后,就改用xfs了。
而实际上,这个问题早有人解决了,解决方法起始也比较简单。
http //blog ronnyegner-consulting de/2011/08/18/ext4-and-the-16-tb-limit-now-solved/
http //rritw com/a/JAVAbiancheng/ANT/20101003/43604 html

原来EXT4是真的支持1EiB的文件系统的,只是mkfs无法支持大于16T的文件系统,所以只需要升级一下格式化工具即可。
关于为什么mkfs.ext4不能格式化大于16T的Ext4文件系统以及其解决方法,原文解释如下:
To be specific: Even with the most recent e2fsprogs 1.41.14 there is no way to create file systems larger than 16 TB.

But: According to this post it should work since June:

It’s taken way too long, but I’ve finally finished integrating the 64-bit patches into e2fsprogs’s mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs. The big change from before is that I replaced Val’s changes for fixing up how mke2fs picked the correct fs-type profile from mke2fs.conf with something that I think works much better and leaves the code much cleaner. With this change you need to add the following to your /etc/mke2fs.conf file if you want to enable the 64-bit feature flag automatically for a big disk:

[fs_types] ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
auto_64-bit_support = 1 # <—- add this line
inode_size = 256
}

Alternatively you can change the features line to include the feature “64bit”; this will force the use of the 64-bit fields, and double the size of the block group descriptors, even for smaller file systems that don’t require the 64-bit support. (This was one of my problems with Val’s implementation; it forced the mke2fs.conf file to always enable the 64-bit feature flag, which would cause backwards compatibility issues.) This might be a good thing to do for debugging purposes, though, so this is an option which I left open, but the better way of doing things is to use the auto_64-bit-support flag.

所以,只需要升级下工具即可,升级方式如下:
git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
cd e2fsprogs
./configure
make && make install

完毕之后还是不能用mkfs.ext4来格式化,而要用“mke2fs”进行格式化,命令参考如下:
mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -i 4194304 /dev/md0

需要注意的是,这是一个还在开发中的工具,使用请个人承担风险:
This are *development* tools – use at your OWN RISK

格式化完毕后就挂载了,来看看你的超大EXT4文件系统吧:
mount -t ext4 /dev/md0 /mnt

mount|grep md0
/dev/md0 on /cache/data type ext4 (rw)

df -h
/dev/md0 19T 229M 18T 1% /mnt

最后,E文作者总结了这么几点,Conclusion:
With the most recent e2fstools (1.42-WIP) it is possible to create ext4 file system larger than 16 TB.

If you do so remember the following:

the tool is still in development – use at your own risk!
tune the values for autocheck (after x mounts / after y days)
adjust the “-i” switch which defines the bytes/inode ratio; in the example above one inode is created for every 8 MB
the more inodes you create the longer fsck takes and the more memory it needs
Resizing the file system (growing / shrinking) is NOT possible at the moment
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
单纤接入和双纤接入有什么区别和作用,如电信
东明镇张麻小学地址有知道的么?有点事想过去
从临沧市到清水河有多远?
网络硬盘录像机32路接入,支持8个sata接口什
绿地集团房地产业务已经覆盖多少个城市
关于公路两边放置广告牌 国家有什么规定吗?
喷绘机白色的地方会不会喷白墨呢
泡瑶浴后前胸后背长疙瘩是往外排毒吗
张家界包大人旅游官网
本市内社保怎样转移?
影驰狙击手gf210pcl-e 128mb tc512mbddr3w
banand英语怎么读
厦门免税店可以买到赫拉气垫吗?
小女不才下一句
那个省内2048M流量是怎么回事?
推荐资讯
临沧市人力资源市场地址在什么地方,想过去办
初至天目双清庄记 作者刻画有人的目的是什么
每一年的下半年都是()天。a,182。b,183。
自热米饭加热好了,要把加热袋拿掉吗
口字组组词大全
这个跟真崎航搭档的小受叫什么?
菜鸟驿站(潍坊安丘慈埠社区店)地址在哪,我要
中山市亿迅达网络科技有限公司怎么样?
德国汉高中国公司官网
这个机子弄好双通道内存性能可以提升多少
BS EN 10025 S355JR对应的GB应该是什么材料
16V 47UF 4*7是什么意思
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?