严格的答案
像-E lazy_itable_init这样的解决方案不会改变结果,只会加快进程.这是明确要求的,在许多情况下人们需要更多.
额外奖励
在大多数情况下,您实际上需要一些与您的使用模式匹配的选项,不仅可以加快文件系统的创建速度,还可以加快使用速度并增加可用空间.
我刚做了一个测试.即使不使用-E lazy_itable_init,下面的选项也可以将2TB文件系统的创建时间从16分2秒加速到1分21秒(英特尔i7 2.2GHz上的内核3.5.0 64位,USB2连接上的2TB磁盘 – SATA可能更快).
对于将保存大文件的文件系统,我使用此组合:
mkfs.ext3 / dev / sdXX -O sparse_super,large_file -m 0 -T largefile4
其中-T largefile4选择/etc/mke2fs.conf中的选项,它们通常包含以下内容:
inode_ratio = 4194304
blocksize = -1
有关这些选项的详细信息,请使用mke2fs.
以下是相关摘录:
sparse_super
Create a filesystem with fewer superblock backup copies (saves space on large filesystems).
large_file
Filesystem can contain files that are greater than 2GB. (Modern kernels set this feature automatically
when a file > 2GB is created.)
-i bytes-per-inode
Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode bytes of space on the disk. The
larger the bytes-per-inode ratio, the fewer inodes will be created. This value generally shouldn't be smaller than
the blocksize of the filesystem, since in that case more inodes would be made than can ever be used. Be warned that
it is not possible to expand the number of inodes on a filesystem after it is created, so be careful deciding the
correct value for this parameter.
-m 0只表示不为root保留5%,这对于数据(不是启动/根)文件系统是可以的. 5T的2TB磁盘意味着100Gb.这是一个非常显着的差异.