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