1.\" $NetBSD: tunefs.8,v 1.37 2008/07/31 05:38:04 simonb 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 April 26, 2004 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 l Ar logsize 45.Op Fl m Ar minfree 46.Bk -words 47.\" .Op Fl n Ar soft_dependency_enabling 48.Op Fl o Ar optimize_preference 49.Ek 50.Ar special | Ar filesys 51.Sh DESCRIPTION 52.Nm 53is designed to change the dynamic parameters of a file system 54which affect the layout policies. 55.Pp 56The following options are supported by 57.Nm : 58.Bl -tag -width Ds 59.It Fl A 60Cause the values to be updated in all the alternate 61superblocks instead of just the standard superblock. 62If this option is not used, 63then use of a backup superblock by 64.Xr fsck 8 65will lose anything changed by 66.Nm . 67.Fl A 68is ignored when 69.Fl N 70is specified. 71.It Fl F 72Indicates that 73.Ar special 74is a file system image, rather than a device name or file system mount point. 75.Ar special 76will be accessed 77.Sq as-is . 78.It Fl N 79Display all the settable options 80(after any changes from the tuning options) 81but do not cause any of them to be changed. 82.It Fl e Ar maxbpg 83This indicates the maximum number of blocks any single file can 84allocate out of a cylinder group before it is forced to begin 85allocating blocks from another cylinder group. 86Typically this value is set to about one quarter of the total blocks 87in a cylinder group. 88The intent is to prevent any single file from using up all the 89blocks in a single cylinder group, 90thus degrading access times for all files subsequently allocated 91in that cylinder group. 92The effect of this limit is to cause big files to do long seeks 93more frequently than if they were allowed to allocate all the blocks 94in a cylinder group before seeking elsewhere. 95For file systems with exclusively large files, 96this parameter should be set higher. 97.It Fl g Ar avgfilesize 98This specifies the expected average file size. 99.It Fl h Ar avgfpdir 100This specifies the expected number of files per directory. 101.It Fl l Ar logsize 102This value specifies the size of the in-filesystem journaling log file. 103The default journaling log file size is described in 104.Xr wapbl 4 . 105Specifying a size of zero will cause the in-filesystem journaling log file 106to be removed the next time the filesystem is mounted. 107The size of an existing in-filesystem journaling log file can not be changed. 108.It Fl m Ar minfree 109This value specifies the percentage of space held back 110from normal users; the minimum free space threshold. 111The default value is set during creation of the filesystem, see 112.Xr newfs 8 . 113This value can be set to zero, however up to a factor of three 114in throughput will be lost over the performance obtained at a 5% 115threshold. 116Note that if the value is raised above the current usage level, 117users will be unable to allocate files until enough files have 118been deleted to get under the higher threshold. 119.\" 120.\" comment out -n, since softdeps are now a mount option 121.ig 122.It Fl n Ar soft_dependency_enabling 123The soft dependency code allows most file system I/O to be done 124asynchronously by reordering dependent writes to ensure that the 125on-disk metadata is self-consistent even when updates are deferred. 126Additionally, metadata updates are aggregated, reducing the total 127number of writes performed. 128Use of this facility does not require any changes to the file system, 129so it can be enabled or disabled any time that the file system is unmounted. 130This experimental facility is turned off by default. 131It is turned on by using 132.Fl n 133enable; 134it is turned off by using 135.Fl n 136disable. 137.. 138.It Fl o Ar optimize_preference 139The file system can either try to minimize the time spent 140allocating blocks, or it can attempt to minimize the space 141fragmentation on the disk. 142If the value of minfree (see above) is less than 5%, 143then the file system should optimize for space to avoid 144running out of full sized blocks. 145For values of minfree greater than or equal to 5%, 146fragmentation is unlikely to be problematical, and 147the file system can be optimized for time. 148.Pp 149.Ar optimize_preference 150can be specified as either 151.Li space 152or 153.Li time . 154.El 155.Sh SEE ALSO 156.Xr wapbl 4 , 157.Xr fs 5 , 158.Xr dumpfs 8 , 159.Xr fsck_ffs 8 , 160.Xr newfs 8 161.Rs 162.%A M. McKusick 163.%A W. Joy 164.%A S. Leffler 165.%A R. Fabry 166.%T "A Fast File System for UNIX" 167.%J "ACM Transactions on Computer Systems 2" 168.%N 3 169.%P pp 181-197 170.%D August 1984 171.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 172.Re 173.Sh HISTORY 174The 175.Nm 176command appeared in 177.Bx 4.2 . 178.Sh BUGS 179This program should work on mounted and active file systems. 180Because the super-block is not kept in the buffer cache, 181the changes will only take effect if the program 182is run on unmounted file systems. 183To change the root file system, the system must be rebooted 184after the file system is tuned. 185.Pp 186.\" Take this out and a Unix Demon will dog your steps from now until 187.\" the time_t's wrap around. 188You can tune a file system, but you can't tune a fish. 189