1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 33.\" 34.Dd December 11, 1993 35.Dt TUNEFS 8 36.Os BSD 4.2 37.Sh NAME 38.Nm tunefs 39.Nd tune up an existing file system 40.Sh SYNOPSIS 41.Nm tunefs 42.Op Fl a Ar maxcontig 43.Op Fl d Ar rotdelay 44.Op Fl e Ar maxbpg 45.Op Fl m Ar minfree 46.Bk -words 47.Op Fl o Ar optimize_preference 48.Ek 49.Op Ar special | Ar filesys 50.Sh DESCRIPTION 51.Nm Tunefs 52is designed to change the dynamic parameters of a file system 53which affect the layout policies. 54The parameters which are to be changed are indicated by the flags 55given below: 56.Bl -tag -width Ds 57.It Fl a Ar maxcontig 58This specifies the maximum number of contiguous blocks that will 59be laid out before forcing a rotational delay (see 60.Fl d 61below). 62The default value is one, since most device drivers require 63an interrupt per disk transfer. 64Device drivers that can chain several buffers together in a single 65transfer should set this to the maximum chain length. 66.It Fl d Ar rotdelay 67This specifies the expected time (in milliseconds) 68to service a transfer completion 69interrupt and initiate a new transfer on the same disk. 70It is used to decide how much rotational spacing to place between 71successive blocks in a file. 72.It Fl e Ar maxbpg 73This indicates the maximum number of blocks any single file can 74allocate out of a cylinder group before it is forced to begin 75allocating blocks from another cylinder group. 76Typically this value is set to about one quarter of the total blocks 77in a cylinder group. 78The intent is to prevent any single file from using up all the 79blocks in a single cylinder group, 80thus degrading access times for all files subsequently allocated 81in that cylinder group. 82The effect of this limit is to cause big files to do long seeks 83more frequently than if they were allowed to allocate all the blocks 84in a cylinder group before seeking elsewhere. 85For file systems with exclusively large files, 86this parameter should be set higher. 87.It Fl m Ar minfree 88This value specifies the percentage of space held back 89from normal users; the minimum free space threshold. 90The default value used is 10%. 91This value can be set to zero, however up to a factor of three 92in throughput will be lost over the performance obtained at a 10% 93threshold. 94Note that if the value is raised above the current usage level, 95users will be unable to allocate files until enough files have 96been deleted to get under the higher threshold. 97.It Fl o Ar optimize_preference 98The file system can either try to minimize the time spent 99allocating blocks, or it can attempt to minimize the space 100fragmentation on the disk. 101If the value of minfree (see above) is less than 10%, 102then the file system should optimize for space to avoid 103running out of full sized blocks. 104For values of minfree greater than or equal to 10%, 105fragmentation is unlikely to be problematical, and 106the file system can be optimized for time. 107.El 108.Sh SEE ALSO 109.Xr fs 5 , 110.Xr dumpfs 8 , 111.Xr newfs 8 , 112.Xr mkfs 8 113.Rs 114.%A M. McKusick 115.%A W. Joy 116.%A S. Leffler 117.%A R. Fabry 118.%T "A Fast File System for UNIX" 119.%J "ACM Transactions on Computer Systems 2" 120.%N 3 121.%P pp 181-197 122.%D August 1984 123.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 124.Re 125.Sh BUGS 126This program should work on mounted and active file systems. 127Because the super-block is not kept in the buffer cache, 128the changes will only take effect if the program 129is run on dismounted file systems. 130To change the root file system, the system must be rebooted 131after the file system is tuned. 132.Pp 133You can tune a file system, but you can't tune a fish. 134.Sh HISTORY 135The 136.Nm 137command appeared in 138.Bx 4.2 . 139