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