TUNEFS(8)
β¨ TUNEFS(8) β¨ β tune up an existing UFS file system
okay bestie, so this is tunefs, from the System Manager's Manual, and it's literally the glow-up artist for your file system π
π¦ SYNOPSIS π¦
tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]
[-j enable | disable] [-J enable | disable]
[-k held-for-metadata-blocks] [-L volname] [-l enable | disable]
[-m minfree] [-N enable | disable] [-n enable | disable]
[-o space | time] [-p] [-s avgfpdir] [-S size]
[-t enable | disable] special | filesystem
πΈ DESCRIPTION πΈ
So tunefs is this little utility whose whole thing is changing the dynamic parameters of a UFS file system β the ones that affect the layout policies. Think of it as editing your filesystem's personality settings β¨
But β and this is the big one, no cap β tunefs cannot be run on an active file system. Like, it literally can't. If you wanna change an active file system you have to either downgrade it to read-only or unmount it first. Periodt. π
The parameters you want to change are indicated by the flags below, and they're all iconic in their own way:
π The flags
-Aβ so the file system has several backups of the super-block, right? Specifying this option makes all the backups get modified, plus the primary super-block. > Heads up bestie: this is potentially dangerous β use with caution. π-a enable | disableβ turns on/off the administrative POSIX.1e ACL enable flag.-e maxbpgβ sets the maximum number of blocks any single file can allocate out of a cylinder group before it's forced to start allocating blocks from another cylinder group. Typically you set this to about one quarter of the total blocks in a cylinder group. The whole intent? Stopping any single file from eating up all the blocks in one cylinder group, which would degrade access times for every file allocated in that cylinder group afterwards. The catch is that this limit makes big files do long seeks more often than if they were allowed to just take all the blocks in a cylinder group before seeking elsewhere. So for file systems with exclusively large files, you should set this parameter higher. π₯-f avgfilesizeβ specify the expected average file size.-j enable | disableβ turns on/off soft updates journaling. Enabling soft updates journaling implies enabling soft updates, and it's incompatible with GEOM journaling.
Enabling journaling drops the time fsck_ffs(8) spends cleaning up a filesystem after a crash from minutes-to-hours down to a few seconds. Without journaling, recovery time after a crash is a function of the number of files in the filesystem and the size of the filesystem. With journaling, recovery time is a function of the amount of activity in the filesystem in the minute before the crash. Journaled recovery time is usually only a few seconds and never exceeds a minute. slay. β
The drawback? The writes to its log add an extra write load to the media containing the filesystem. So a write-intensive workload will have reduced throughput on a filesystem running with journaling. π₯²
And like all journaling filesystems, the journal recovery will only fix issues known to the journal. Specifically, if a media error occurs, the journal won't know about it and hence won't fix it. So when you're using journaling it's still necessary to run a full fsck every few months, or after a filesystem panic, to check for and fix any errors brought on by media failure. You can do a full fsck by running a background fsck on a live filesystem, or by running with the -f flag on an unmounted filesystem. When running fsck_ffs(8) in background on a live filesystem, filesystem performance will be about half of normal during the time that the background fsck_ffs(8) is running. And running a full fsck on a UFS filesystem is the equivalent of running a scrub on a ZFS filesystem. iykyk π
-J enable | disableβ turns on/off GEOM journaling. GEOM journaling is incompatible with soft updates. π«Ά-k held-for-metadata-blocksβ set the amount of space to be held for metadata blocks. When set, the file system preference routines try to save the specified amount of space immediately following the inode blocks in each cylinder group, for use by metadata blocks. Clustering the metadata blocks speeds up random file access and decreases the running time offsck(8). You can set this option at any time, but it's most effective if set before any data is loaded into the file system. By defaultnewfs(8)sets it to half of the space reserved tominfree. π-L volnameβ add/modify an optional file system volume label. Legal characters are alphanumerics, dashes, and underscores.-l enable | disableβ turns on/off the MAC multilabel flag.-m minfreeβ specify the percentage of space held back from normal users, i.e. the minimum free space threshold. The default value used is 8%. Note that lowering the threshold can adversely affect performance:- Settings of 5% and less force space optimization to always be used, which will greatly increase the overhead for file writes.
- The file system's ability to avoid fragmentation will be reduced when the total free space, including the reserve, drops below 15%. As free space approaches zero, throughput can degrade by up to a factor of three over the performance obtained at a 10% threshold.
And if the value is raised above the current usage level, users will be unable to allocate files until enough files have been deleted to get under the higher threshold. π
-N enable | disableβ turns on/off the administrative NFSv4 ACL enable flag.-n enable | disableβ turns on/off soft updates. Soft updates are incompatible with GEOM journaling.-o space | timeβ the file system can either try to minimize the time spent allocating blocks, or it can attempt to minimize the space fragmentation on the disk. Optimization for space has much higher overhead for file writes. The kernel normally changes the preference automatically as the percent fragmentation changes on the file system. π¦-pβ show a summary of what the current tunable settings are on the selected file system. Want more detailed info? That's adumpfs(8)job.-s avgfpdirβ specify the expected number of files per directory.-S sizeβ specify the softdep journal size in bytes. The minimum is4M.-t enable | disableβ turns on/off the TRIM enable flag. If enabled, and if the underlying device supports theBIO_DELETEcommand, the file system will send a delete request to the underlying device for each freed block. The trim enable flag is typically set when the underlying device uses flash-memory, since the device can use the delete command to pre-zero or at least avoid copying blocks that have been deleted. π
Note: this does not trim blocks that are already free. See thefsck_ffs(8)-Eflag.
At least one of these flags is required. (not optional, bestie β pick one π)
π FILES π
/etc/fstabβ read this to determine the device file for a specified mount point.
π SEE ALSO π
ffs(4), fs(5), tuning(7), dumpfs(8), gjournal(8), growfs(8), newfs(8)
M. McKusick, W. Joy, S. Leffler, and R. Fabry, βA Fast File System for UNIXβ, ACM Transactions on Computer Systems 2, 3, pp 181-197, August 1984, (reprinted in the BSD System Manager's Manual, SMM:5).
π HISTORY π
The tunefs utility appeared in 4.2BSD. a whole legend honestly β¨
π BUGS π
This utility does not work on active file systems. To change the root file system, the system must be rebooted after the file system is tuned. no shortcuts, sorry π₯²
You can tune a file system, but you cannot tune a fish. π
and that's the whole page, bestie β this one came from Debian, dated March 20, 2026, TUNEFS(8) and all. go tune something (that isn't mounted) π«Άπ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms