1.\" $NetBSD: tunefs.8,v 1.33 2003/08/07 10:04:40 agc Exp $ 2.\" 3.\" Copyright (c) 1983, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)tunefs.8 8.3 (Berkeley) 5/3/95 31.\" 32.Dd November 9, 2001 33.Dt TUNEFS 8 34.Os 35.Sh NAME 36.Nm tunefs 37.Nd tune up an existing file system 38.Sh SYNOPSIS 39.Nm 40.Op Fl AFN 41.Op Fl e Ar maxbpg 42.Op Fl g Ar avgfilesize 43.Op Fl h Ar avgfpdir 44.Op Fl m Ar minfree 45.Bk -words 46.\" .Op Fl n Ar soft_dependency_enabling 47.Op Fl o Ar optimize_preference 48.Ek 49.Ar special | Ar filesys 50.Sh DESCRIPTION 51.Nm 52is designed to change the dynamic parameters of a file system 53which affect the layout policies. 54.Pp 55The following options are supported by 56.Nm : 57.Bl -tag -width Ds 58.It Fl A 59Cause the values to be updated in all the alternate 60superblocks instead of just the standard superblock. 61If this option is not used, 62then use of a backup superblock by 63.Xr fsck 8 64will lose anything changed by 65.Nm . 66.Fl A 67is ignored when 68.Fl N 69is specified. 70.It Fl F 71Indicates that 72.Ar special 73is a file system image, rather than a device name or file system mount point. 74.Ar special 75will be accessed 76.Sq as-is . 77.It Fl N 78Display all the settable options 79(after any changes from the tuning options) 80but do not cause any of them to be changed. 81.It Fl e Ar maxbpg 82This indicates the maximum number of blocks any single file can 83allocate out of a cylinder group before it is forced to begin 84allocating blocks from another cylinder group. 85Typically this value is set to about one quarter of the total blocks 86in a cylinder group. 87The intent is to prevent any single file from using up all the 88blocks in a single cylinder group, 89thus degrading access times for all files subsequently allocated 90in that cylinder group. 91The effect of this limit is to cause big files to do long seeks 92more frequently than if they were allowed to allocate all the blocks 93in a cylinder group before seeking elsewhere. 94For file systems with exclusively large files, 95this parameter should be set higher. 96.It Fl g Ar avgfilesize 97This specifies the expected average file size. 98.It Fl h Ar avgfpdir 99This specifies the expected number of files per directory. 100.It Fl m Ar minfree 101This value specifies the percentage of space held back 102from normal users; the minimum free space threshold. 103The default value used is 10%. 104This value can be set to zero, however up to a factor of three 105in throughput will be lost over the performance obtained at a 10% 106threshold. 107Note that if the value is raised above the current usage level, 108users will be unable to allocate files until enough files have 109been deleted to get under the higher threshold. 110.\" 111.\" comment out -n, since softdeps are now a mount option 112.ig 113.It Fl n Ar soft_dependency_enabling 114The soft dependency code allows most file system I/O to be done 115asynchronously by reordering dependent writes to ensure that the 116on-disk metadata is self-consistent even when updates are deferred. 117Additionally, metadata updates are aggregated, reducing the total 118number of writes performed. 119Use of this facility does not require any changes to the file system, 120so it can be enabled or disabled any time that the file system is unmounted. 121This experimental facility is turned off by default. 122It is turned on by using 123.Fl n 124enable; 125it is turned off by using 126.Fl n 127disable. 128.. 129.It Fl o Ar optimize_preference 130The file system can either try to minimize the time spent 131allocating blocks, or it can attempt to minimize the space 132fragmentation on the disk. 133If the value of minfree (see above) is less than 10%, 134then the file system should optimize for space to avoid 135running out of full sized blocks. 136For values of minfree greater than or equal to 10%, 137fragmentation is unlikely to be problematical, and 138the file system can be optimized for time. 139.Pp 140.Ar optimize_preference 141can be specified as either 142.Li space 143or 144.Li time . 145.El 146.Sh SEE ALSO 147.Xr fs 5 , 148.Xr dumpfs 8 , 149.Xr fsck_ffs 8 , 150.Xr newfs 8 151.Rs 152.%A M. McKusick 153.%A W. Joy 154.%A S. Leffler 155.%A R. Fabry 156.%T "A Fast File System for UNIX" 157.%J "ACM Transactions on Computer Systems 2" 158.%N 3 159.%P pp 181-197 160.%D August 1984 161.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 162.Re 163.Sh HISTORY 164The 165.Nm 166command appeared in 167.Bx 4.2 . 168.Sh BUGS 169This program should work on mounted and active file systems. 170Because the super-block is not kept in the buffer cache, 171the changes will only take effect if the program 172is run on unmounted file systems. 173To change the root file system, the system must be rebooted 174after the file system is tuned. 175.Pp 176You can tune a file system, but you can't tune a fish. 177