tunefs

tune up an existing file system

tunefs [-AN] [-a maxcontig] [-d rotdelay] [-e maxbpg] [-m minfree] [-o optimize_preference] [-t trackskew] [special | filesys]

Changes the dynamic parameters of a file system which affect the layout policies. cannot be run on an active file system, it must be downgraded to read-only or unmounted.
‑N displays settable options (after any changes from the tuning options)
ommiting -A update only standard superblock
-A Alternate superblocks are also updated.
If a run of fsck uses an alternate superblock, which has not been updated, parameters will be those previosly written to that alternate.
-m minFree percentage of space held back from normal users(i.e.non root); the minimum free space threshold.
Default 10%. If set to zero, up to a factor of three in throughput will be lost over the performance obtained at a 10% threshold.
If space is allocated above the threshold, users will be unable to allocate files until enough files have been deleted to get under the higher threshold.

This reserves space for root in the event of a rogue process or syslog logs (local or remote) attempting to consume all the space on the file system.

-d rotatDelay expected time (in ms ) to service a transfer completion interrupt and initiate a new transfer on the same disk. Used to decide how much rotational spacing to place between successive blocks in a file.
-a maxContig maximum number of contiguous blocks before forcing a rotational delay .
default is one Device drivers that can chain several buffers together in a single transfer should set this to the maximum chain length.
-e maxBpG maximum number of blocks out of a cylinder group before being forced to change to another group.
Use one quarter of the blocks in a cylinder group.
preventing any file from using up all the blocks in a single cylinder group, thus degrading access times for all files subsequently allocated in that cylinder group. The effect of this limit is to cause big files to do long seeks more frequently than if they were allowed to allocate all the blocks in a cylinder group before seeking elsewhere. For file systems with exclusively large files, this parameter should be set higher.
-f avgFileSize expected average file size.
-s avgFpDirexpected number of files per directory.
-o
space | time
Optimize for minimum space fragmentation or time spent allocating blocks.
Optimization for space has high overhead for file writes.
If minFree is less than 10%, then optimize for space to avoid running out of full sized blocks.
For of minFree greater than 10%, optimized for time.
-t trackSkew the skew, in sectors, from one track to the next in a cylinder.
Default zero, meaining that each track in a cylinder begins at the same rotational position.

/bin/df
cat /etc/fstab
sudo umount /dev/disk0s14 
sudo tunefs -N   /dev/disk0s14

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 5%
	optimization preference: time
	track skew 0 sectors
	expected average file size 16384
	expexted number of files per directory 64
tunefs: no changes made

At least one of the above flags is required.

SEE tune2fs,fs, dumpfs, fsck, newfs

You can tune a file system, but you can't tune a fish.

4.2 Berkeley Distribution May 3, 1995 4.2 Berkeley Distribution

Usage: tunefs [-AN] tuneup-options special-device
where tuneup-options are:
	-d rotational delay between contiguous blocks
	-a maximum contiguous blocks
	-e maximum blocks per file in a cylinder group
	-m minimum percentage of free space
	-o optimization preference (`space' or `time')
	-t track skew in sectors
	-f expected average file size
	-s expected number of files per directory