1*301058f1Sschwarze.\" $OpenBSD: tunefs.8,v 1.27 2019/04/23 18:13:11 schwarze Exp $ 290a6fb0fSotto.\" $NetBSD: tunefs.8,v 1.36 2004/12/20 10:28:47 hubertf Exp $ 3df930be7Sderaadt.\" 4df930be7Sderaadt.\" Copyright (c) 1983, 1991, 1993 5df930be7Sderaadt.\" The Regents of the University of California. All rights reserved. 6df930be7Sderaadt.\" 7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 8df930be7Sderaadt.\" modification, are permitted provided that the following conditions 9df930be7Sderaadt.\" are met: 10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 11df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 13df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 14df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 151ef0d710Smillert.\" 3. Neither the name of the University nor the names of its contributors 16df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 17df930be7Sderaadt.\" without specific prior written permission. 18df930be7Sderaadt.\" 19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29df930be7Sderaadt.\" SUCH DAMAGE. 30df930be7Sderaadt.\" 3190a6fb0fSotto.\" @(#)tunefs.8 8.3 (Berkeley) 5/3/95 32df930be7Sderaadt.\" 33*301058f1Sschwarze.Dd $Mdocdate: April 23 2019 $ 34df930be7Sderaadt.Dt TUNEFS 8 35fc8533a3Saaron.Os 36df930be7Sderaadt.Sh NAME 37df930be7Sderaadt.Nm tunefs 38df930be7Sderaadt.Nd tune up an existing file system 39df930be7Sderaadt.Sh SYNOPSIS 4090a6fb0fSotto.Nm 416d62e39fSotto.Bk -words 4290a6fb0fSotto.Op Fl AFN 43df930be7Sderaadt.Op Fl e Ar maxbpg 4490a6fb0fSotto.Op Fl g Ar avgfilesize 4590a6fb0fSotto.Op Fl h Ar avgfpdir 46df930be7Sderaadt.Op Fl m Ar minfree 4790a6fb0fSotto.\" .Op Fl n Ar soft_dependency_enabling 48df930be7Sderaadt.Op Fl o Ar optimize_preference 496d62e39fSotto.Ar special | filesys 50df930be7Sderaadt.Ek 51df930be7Sderaadt.Sh DESCRIPTION 5258aefd4bSaaron.Nm 53df930be7Sderaadtis designed to change the dynamic parameters of a file system 54df930be7Sderaadtwhich affect the layout policies. 5590a6fb0fSotto.Pp 566d62e39fSottoThe options are as follows: 57df930be7Sderaadt.Bl -tag -width Ds 58f53698bbSderaadt.It Fl A 5990a6fb0fSottoCause the values to be updated in all the alternate 6090a6fb0fSottosuperblocks instead of just the standard superblock. 6190a6fb0fSottoIf this option is not used, 6290a6fb0fSottothen use of a backup superblock by 6390a6fb0fSotto.Xr fsck 8 6490a6fb0fSottowill lose anything changed by 6590a6fb0fSotto.Nm . 6690a6fb0fSotto.Fl A 6790a6fb0fSottois ignored when 6890a6fb0fSotto.Fl N 6990a6fb0fSottois specified. 70df930be7Sderaadt.It Fl e Ar maxbpg 71df930be7SderaadtThis indicates the maximum number of blocks any single file can 72df930be7Sderaadtallocate out of a cylinder group before it is forced to begin 73df930be7Sderaadtallocating blocks from another cylinder group. 74df930be7SderaadtTypically this value is set to about one quarter of the total blocks 75df930be7Sderaadtin a cylinder group. 76df930be7SderaadtThe intent is to prevent any single file from using up all the 77df930be7Sderaadtblocks in a single cylinder group, 78df930be7Sderaadtthus degrading access times for all files subsequently allocated 79df930be7Sderaadtin that cylinder group. 80df930be7SderaadtThe effect of this limit is to cause big files to do long seeks 81df930be7Sderaadtmore frequently than if they were allowed to allocate all the blocks 82df930be7Sderaadtin a cylinder group before seeking elsewhere. 83df930be7SderaadtFor file systems with exclusively large files, 84df930be7Sderaadtthis parameter should be set higher. 856d62e39fSotto.It Fl F 866d62e39fSottoIndicates that 876d62e39fSotto.Ar special 886d62e39fSottois a file system image, rather than a device name or file system mount point. 896d62e39fSotto.Ar special 906d62e39fSottowill be accessed 916d62e39fSotto.Sq as-is . 9290a6fb0fSotto.It Fl g Ar avgfilesize 9390a6fb0fSottoThis specifies the expected average file size. 9490a6fb0fSotto.It Fl h Ar avgfpdir 9590a6fb0fSottoThis specifies the expected number of files per directory. 96df930be7Sderaadt.It Fl m Ar minfree 97df930be7SderaadtThis value specifies the percentage of space held back 98df930be7Sderaadtfrom normal users; the minimum free space threshold. 996d62e39fSottoThe default value is set during creation of the filesystem; see 10090a6fb0fSotto.Xr newfs 8 . 10190a6fb0fSottoThis value can be set to zero, however up to a factor of three 102265c49e7Sderaadtin throughput will be lost over the performance obtained at a 5% 103df930be7Sderaadtthreshold. 104df930be7SderaadtNote that if the value is raised above the current usage level, 105df930be7Sderaadtusers will be unable to allocate files until enough files have 106df930be7Sderaadtbeen deleted to get under the higher threshold. 1076d62e39fSotto.It Fl N 1086d62e39fSottoDisplay all the settable options 1096d62e39fSotto(after any changes from the tuning options) 1106d62e39fSottobut do not cause any of them to be changed. 111df930be7Sderaadt.It Fl o Ar optimize_preference 112df930be7SderaadtThe file system can either try to minimize the time spent 113df930be7Sderaadtallocating blocks, or it can attempt to minimize the space 114df930be7Sderaadtfragmentation on the disk. 1156d62e39fSottoIf the value of 1166d62e39fSotto.Ar minfree 1176d62e39fSotto(see above) is less than 5%, 118df930be7Sderaadtthen the file system should optimize for space to avoid 119df930be7Sderaadtrunning out of full sized blocks. 1206d62e39fSottoFor values of 1216d62e39fSotto.Ar minfree 1226d62e39fSottogreater than or equal to 5%, 123df930be7Sderaadtfragmentation is unlikely to be problematical, and 124df930be7Sderaadtthe file system can be optimized for time. 12590a6fb0fSotto.Pp 12690a6fb0fSotto.Ar optimize_preference 12790a6fb0fSottocan be specified as either 12890a6fb0fSotto.Li space 12990a6fb0fSottoor 13090a6fb0fSotto.Li time . 131df930be7Sderaadt.El 132df930be7Sderaadt.Sh SEE ALSO 133df930be7Sderaadt.Xr fs 5 , 134df930be7Sderaadt.Xr dumpfs 8 , 13590a6fb0fSotto.Xr fsck_ffs 8 , 136cfd956ddSjmc.Xr growfs 8 , 1377acc01d2Saaron.Xr newfs 8 138df930be7Sderaadt.Rs 139df930be7Sderaadt.%A M. McKusick 140df930be7Sderaadt.%A W. Joy 141df930be7Sderaadt.%A S. Leffler 142df930be7Sderaadt.%A R. Fabry 143df930be7Sderaadt.%T "A Fast File System for UNIX" 144df930be7Sderaadt.%J "ACM Transactions on Computer Systems 2" 145df930be7Sderaadt.%N 3 146*301058f1Sschwarze.%P pp. 181\(en197 147df930be7Sderaadt.%D August 1984 148df930be7Sderaadt.Re 149295cda82Saaron.Sh HISTORY 150295cda82SaaronThe 151295cda82Saaron.Nm 152295cda82Saaroncommand appeared in 153295cda82Saaron.Bx 4.2 . 154df930be7Sderaadt.Sh BUGS 155df930be7SderaadtThis program should work on mounted and active file systems. 156df930be7SderaadtBecause the super-block is not kept in the buffer cache, 157df930be7Sderaadtthe changes will only take effect if the program 15890a6fb0fSottois run on unmounted file systems. 159df930be7SderaadtTo change the root file system, the system must be rebooted 160df930be7Sderaadtafter the file system is tuned. 161df930be7Sderaadt.Pp 162f53698bbSderaadt.\" Take this out and a Unix Demon will dog your steps from now until 163f53698bbSderaadt.\" the time_t's wrap around. 164df930be7SderaadtYou can tune a file system, but you can't tune a fish. 165