1.\" $NetBSD: tunefs.8,v 1.40 2011/03/06 17:21:08 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. 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 December 15, 2010 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 o Ar optimize_preference 48.Op Fl q Ar quota 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.It Fl o Ar optimize_preference 120The file system can either try to minimize the time spent 121allocating blocks, or it can attempt to minimize the space 122fragmentation on the disk. 123If the value of minfree (see above) is less than 5%, 124then the file system should optimize for space to avoid 125running out of full sized blocks. 126For values of minfree greater than or equal to 5%, 127fragmentation is unlikely to be problematical, and 128the file system can be optimized for time. 129.Pp 130.Ar optimize_preference 131can be specified as either 132.Li space 133or 134.Li time . 135.It Fl q Ar quota 136enable or disable a quota. 137.Ar quota 138can be one of 139.Li user , 140.Li group , 141.Li nouser 142or 143.Li nogroup 144to enable or disable the specified quota type. 145Multiple 146.Fl q 147can be used to enable/disable all types at once. 148.Pp 149After enabling a quota, 150.Xr fsck_ffs 8 151has to be run to compute the correct quota values. 152.El 153.Sh SEE ALSO 154.Xr wapbl 4 , 155.Xr fs 5 , 156.Xr dumpfs 8 , 157.Xr fsck_ffs 8 , 158.Xr newfs 8 159.Rs 160.%A M. McKusick 161.%A W. Joy 162.%A S. Leffler 163.%A R. Fabry 164.%T "A Fast File System for UNIX" 165.%J "ACM Transactions on Computer Systems 2" 166.%N 3 167.%P pp 181-197 168.%D August 1984 169.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 170.Re 171.Sh HISTORY 172The 173.Nm 174command appeared in 175.Bx 4.2 . 176.Sh BUGS 177This program should work on mounted and active file systems. 178Because the super-block is not kept in the buffer cache, 179the changes will only take effect if the program 180is run on unmounted file systems. 181To change the root file system, the system must be rebooted 182after the file system is tuned. 183.Pp 184.\" Take this out and a Unix Demon will dog your steps from now until 185.\" the time_t's wrap around. 186You can tune a file system, but you can't tune a fish. 187