tunefs で UFS の設定変更ができる.
$ sudo diskutil unmount /Volumes/UFS $ sudo tunefs -N /dev/disk1s2 tunefs: current settings maximum contiguous block count 32 rotational delay between contiguous blocks 0ms maximum blocks per file in a cylinder group 1024 minimum percentage of free space 0% optimization preference: space track skew 0 sectors expected average file size 16384 expexted number of files per directory 64 tunefs: no changes made
空きスペースが設定したパーセントより少なくなれば,スペース重視のファイルシステムになる.
ただ,この設定値,私が思うのと逆の感じで,
空きスペースとして設定したパーセントより空きスペースが多くなれば,
スペース重視となり,少なくなれば時間重視となるようだ.
実装が間違ってるのか,私の認識が間違っているのかは分からず.
私の認識が間違っていた. こういうことなんだよ.
通常のユーザからは保護されている領域のパーセンテージを指定します。
これは最低限の空き領域のしきい値となります。
デフォルト値は<ufs/ffs/fs.h> にて MINFREE と定義され、現在 10% です。
で,minfree を 10% より小さくするなら最適化を space に設定しておかないとならない. minfree を 10%以上に設定すれば,最適化を time にすることができる.
$ sudo tunefs -m 10 /dev/disk1s2 tunefs: minimum percentage of free space changes from 0% to 10% tunefs: should optimize for time with minfree >= 5%
っていうか次のようにして使うんだ,たぶん.
$ sudo tunefs -o time -m 10 /dev/disk1s2 tunefs: optimization preference changes from space to time tunefs: minimum percentage of free space changes from 10% to 10%
$ sudo tunefs -o space -m 90 /dev/disk1s2
tunefs: optimization preference changes from time to space
tunefs: should optimize for time with minfree >= 5%
tunefs: minimum percentage of free space changes from 10% to 90%
tunefs: should optimize for time with minfree >= 5%
いや,違うな.
tunefs: should optimize for time with minfree >= 5%
って書いてあるってことは,時間の最適化をするときのパーセンテージを 書くんだな,たぶん.
時間による最適化をしないようにできる.
$ sudo tunefs -m 0 /dev/disk1s2 tunefs: minimum percentage of free space changes from 90% to 0%
tunefs で設定したものは,デフォルトのスーパーブロックにしか書き込まれない. これを,すべてのスーパーブロックに書き込むには "-A" オプションをつける.