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.\" from: @(#)tunefs.8 8.2 (Berkeley) 12/11/93 33.\" $Id: tunefs.8,v 1.7 1994/06/08 19:36:12 mycroft Exp $ 34.\" 35.Dd December 11, 1993 36.Dt TUNEFS 8 37.Os BSD 4.2 38.Sh NAME 39.Nm tunefs 40.Nd tune up an existing file system 41.Sh SYNOPSIS 42.Nm tunefs 43.Op Fl a Ar maxcontig 44.Op Fl d Ar rotdelay 45.Op Fl e Ar maxbpg 46.Op Fl m Ar minfree 47.Bk -words 48.Op Fl o Ar optimize_preference 49.Ek 50.Op Ar special | Ar filesys 51.Sh DESCRIPTION 52.Nm Tunefs 53is designed to change the dynamic parameters of a file system 54which affect the layout policies. 55The parameters which are to be changed are indicated by the flags 56given below: 57.Bl -tag -width Ds 58.It Fl a Ar maxcontig 59This specifies the maximum number of contiguous blocks that will 60be laid out before forcing a rotational delay (see 61.Fl d 62below). 63The default value is one, since most device drivers require 64an interrupt per disk transfer. 65Device drivers that can chain several buffers together in a single 66transfer should set this to the maximum chain length. 67.It Fl d Ar rotdelay 68This specifies the expected time (in milliseconds) 69to service a transfer completion 70interrupt and initiate a new transfer on the same disk. 71It is used to decide how much rotational spacing to place between 72successive blocks in a file. 73.It Fl e Ar maxbpg 74This indicates the maximum number of blocks any single file can 75allocate out of a cylinder group before it is forced to begin 76allocating blocks from another cylinder group. 77Typically this value is set to about one quarter of the total blocks 78in a cylinder group. 79The intent is to prevent any single file from using up all the 80blocks in a single cylinder group, 81thus degrading access times for all files subsequently allocated 82in that cylinder group. 83The effect of this limit is to cause big files to do long seeks 84more frequently than if they were allowed to allocate all the blocks 85in a cylinder group before seeking elsewhere. 86For file systems with exclusively large files, 87this parameter should be set higher. 88.It Fl m Ar minfree 89This value specifies the percentage of space held back 90from normal users; the minimum free space threshold. 91The default value used is 10%. 92This value can be set to zero, however up to a factor of three 93in throughput will be lost over the performance obtained at a 10% 94threshold. 95Note that if the value is raised above the current usage level, 96users will be unable to allocate files until enough files have 97been deleted to get under the higher threshold. 98.It Fl o Ar optimize_preference 99The file system can either try to minimize the time spent 100allocating blocks, or it can attempt to minimize the space 101fragmentation on the disk. 102If the value of minfree (see above) is less than 10%, 103then the file system should optimize for space to avoid 104running out of full sized blocks. 105For values of minfree greater than or equal to 10%, 106fragmentation is unlikely to be problematical, and 107the file system can be optimized for time. 108.El 109.Sh SEE ALSO 110.Xr fs 5 , 111.Xr dumpfs 8 , 112.Xr newfs 8 , 113.Xr mkfs 8 114.Rs 115.%A M. McKusick 116.%A W. Joy 117.%A S. Leffler 118.%A R. Fabry 119.%T "A Fast File System for UNIX" 120.%J "ACM Transactions on Computer Systems 2" 121.%N 3 122.%P pp 181-197 123.%D August 1984 124.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 125.Re 126.Sh BUGS 127This program should work on mounted and active file systems. 128Because the super-block is not kept in the buffer cache, 129the changes will only take effect if the program 130is run on dismounted file systems. 131To change the root file system, the system must be rebooted 132after the file system is tuned. 133.Pp 134You can tune a file system, but you can't tune a fish. 135.Sh HISTORY 136The 137.Nm 138command appeared in 139.Bx 4.2 . 140