161556Sbostic.\" Copyright (c) 1983, 1991, 1993 261556Sbostic.\" The Regents of the University of California. All rights reserved. 319022Smckusick.\" 447464Scael.\" %sccs.include.redist.man% 519022Smckusick.\" 6*69182Smckusick.\" @(#)tunefs.8 8.3 (Berkeley) 05/03/95 747464Scael.\" 847464Scael.Dd 947464Scael.Dt TUNEFS 8 1047464Scael.Os BSD 4.2 1147464Scael.Sh NAME 1247464Scael.Nm tunefs 1347464Scael.Nd tune up an existing file system 1447464Scael.Sh SYNOPSIS 1547464Scael.Nm tunefs 16*69182Smckusick.Op Fl AN 1747464Scael.Op Fl a Ar maxcontig 1847464Scael.Op Fl d Ar rotdelay 1947464Scael.Op Fl e Ar maxbpg 2047464Scael.Op Fl m Ar minfree 2147464Scael.Bk -words 2247464Scael.Op Fl o Ar optimize_preference 2347464Scael.Ek 24*69182Smckusick.Op Fl t Ar trackskew 2547464Scael.Op Ar special | Ar filesys 2647464Scael.Sh DESCRIPTION 27*69182SmckusickThe 28*69182Smckusick.Nm tunefs 29*69182Smckusickprogram is designed to change the dynamic parameters of a file system 3019022Smckusickwhich affect the layout policies. 31*69182SmckusickThe 32*69182Smckusick.Fl N 33*69182Smckusickflag displays all the settable options 34*69182Smckusick(after any changes from the tuning options) 35*69182Smckusickbut does not cause any of them to be changed. 36*69182SmckusickThe 37*69182Smckusick.Fl A 38*69182Smckusickflag causes the values to be updated in all the alternate 39*69182Smckusicksuperblocks instead of just the standard superblock. 40*69182SmckusickIf this option is not used, 41*69182Smckusickthen use of a backup superblock by 42*69182Smckusick.Xr fsck 8 43*69182Smckusickwill lose anything changed by 44*69182Smckusick.Nm tunefs . 45*69182SmckusickThe 46*69182Smckusick.Fl A 47*69182Smckusickflag is ignored when the 48*69182Smckusick.Fl N 49*69182Smckusickflag is specified. 50*69182Smckusick.Pp 5119022SmckusickThe parameters which are to be changed are indicated by the flags 5219022Smckusickgiven below: 5347464Scael.Bl -tag -width Ds 5447464Scael.It Fl a Ar maxcontig 5519022SmckusickThis specifies the maximum number of contiguous blocks that will 5647464Scaelbe laid out before forcing a rotational delay (see 5747464Scael.Fl d 5847464Scaelbelow). 5919022SmckusickThe default value is one, since most device drivers require 6019022Smckusickan interrupt per disk transfer. 6119022SmckusickDevice drivers that can chain several buffers together in a single 6219022Smckusicktransfer should set this to the maximum chain length. 6347464Scael.It Fl d Ar rotdelay 6419022SmckusickThis specifies the expected time (in milliseconds) 6519022Smckusickto service a transfer completion 6619022Smckusickinterrupt and initiate a new transfer on the same disk. 6719022SmckusickIt is used to decide how much rotational spacing to place between 6819022Smckusicksuccessive blocks in a file. 6947464Scael.It Fl e Ar maxbpg 7019022SmckusickThis indicates the maximum number of blocks any single file can 7119022Smckusickallocate out of a cylinder group before it is forced to begin 7219022Smckusickallocating blocks from another cylinder group. 7319022SmckusickTypically this value is set to about one quarter of the total blocks 7419022Smckusickin a cylinder group. 7519022SmckusickThe intent is to prevent any single file from using up all the 7619022Smckusickblocks in a single cylinder group, 7747464Scaelthus degrading access times for all files subsequently allocated 7819022Smckusickin that cylinder group. 7919022SmckusickThe effect of this limit is to cause big files to do long seeks 8019022Smckusickmore frequently than if they were allowed to allocate all the blocks 8119022Smckusickin a cylinder group before seeking elsewhere. 8247464ScaelFor file systems with exclusively large files, 8319022Smckusickthis parameter should be set higher. 8447464Scael.It Fl m Ar minfree 8519022SmckusickThis value specifies the percentage of space held back 8619022Smckusickfrom normal users; the minimum free space threshold. 8719022SmckusickThe default value used is 10%. 8819022SmckusickThis value can be set to zero, however up to a factor of three 8919022Smckusickin throughput will be lost over the performance obtained at a 10% 9019022Smckusickthreshold. 9119022SmckusickNote that if the value is raised above the current usage level, 9219022Smckusickusers will be unable to allocate files until enough files have 9319022Smckusickbeen deleted to get under the higher threshold. 9447464Scael.It Fl o Ar optimize_preference 9524708SmckusickThe file system can either try to minimize the time spent 9665103Smckusickallocating blocks, or it can attempt to minimize the space 9724708Smckusickfragmentation on the disk. 9824708SmckusickIf the value of minfree (see above) is less than 10%, 9924708Smckusickthen the file system should optimize for space to avoid 10024708Smckusickrunning out of full sized blocks. 10124708SmckusickFor values of minfree greater than or equal to 10%, 10224708Smckusickfragmentation is unlikely to be problematical, and 10324708Smckusickthe file system can be optimized for time. 104*69182Smckusick.It Fl t Ar trackskew 105*69182SmckusickThis specifies the skew in sectors from one track to the next in a cylinder. 106*69182SmckusickThe default value is zero, indicating that each track in a cylinder begins at 107*69182Smckusickthe same rotational position. 10847464Scael.El 10947464Scael.Sh SEE ALSO 11047464Scael.Xr fs 5 , 11155926Sbostic.Xr dumpfs 8 , 112*69182Smckusick.Xr fsck 8 , 11347464Scael.Xr newfs 8 , 11447464Scael.Xr mkfs 8 11547464Scael.Rs 11647464Scael.%A M. McKusick 11747464Scael.%A W. Joy 11847464Scael.%A S. Leffler 11947464Scael.%A R. Fabry 12047464Scael.%T "A Fast File System for UNIX" 12147464Scael.%J "ACM Transactions on Computer Systems 2" 12247464Scael.%N 3 12347464Scael.%P pp 181-197 12447464Scael.%D August 1984 12547464Scael.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 12647464Scael.Re 12747464Scael.Sh BUGS 12819022SmckusickThis program should work on mounted and active file systems. 12919022SmckusickBecause the super-block is not kept in the buffer cache, 13028372Smckusickthe changes will only take effect if the program 13128372Smckusickis run on dismounted file systems. 13228372SmckusickTo change the root file system, the system must be rebooted 13328372Smckusickafter the file system is tuned. 13447464Scael.Pp 13519022SmckusickYou can tune a file system, but you can't tune a fish. 13647464Scael.Sh HISTORY 13747464ScaelThe 13847464Scael.Nm 13947464Scaelcommand appeared in 14047464Scael.Bx 4.2 . 141