当前位置: 首页>>技术教程>>正文


非操作系统磁盘的“文件系统保留块”的合理大小?

,

问题描述

创建文件系统 ( mkfs ... ) 时,文件系统会保留 5% 的空间供自己使用,因为根据 man tune2fs

\\n

Reserving some number of filesystem\\n blocks for use by privileged processes\\n is done to avoid filesystem \\n fragmentation, and to allow system \\n daemons, such as syslogd(8), to\\n continue to function correctly after\\n non-privileged processes are prevented\\n from writing to the filesystem.

\\n

但对于大型驱动器来说,5% 的空间就相当大了。

我有 4×1.5 TB 驱动器用于数据存储(操作系统在单独的磁盘上运行),因此默认设置将保留 300 GB,这比整个操作系统驱动器大一个数量级。

预留空间是可以调整的,但是数据盘的合理大小是多少呢?我可以将其设置为零吗,或者这会导致碎片问题吗?

最佳回答

我从 ext4 开发人员 Theodore Tso 那里找到了以下答案 https://www.redhat.com/archives/ext3-users/2009-January/msg00026.html

\\n

If you set the reserved block count to\\n zero, it won’t affect performance much\\n except if you run for long periods of\\n time (with lots of file creates and\\n deletes) while the filesystem is\\n almost full (i.e., say above 95%), at\\n which point you’ll be subject to\\n fragmentation problems. Ext4’s\\n multi-block allocator is much more\\n fragmentation resistant, because it\\n tries much harder to find contiguous\\n blocks, so even if you don’t enable\\n the other ext4 features, you’ll see\\n better results simply mounting an ext3\\n filesystem using ext4 before the\\n filesystem gets completely full.

\\n

If you are just using the filesystem\\n for long-term archive, where files\\n aren’t changing very often (i.e., a\\n huge mp3 or video store), it obviously\\n won’t matter.

\\n

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/14303.html,未经允许,请勿转载。