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*65103Smckusick.\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 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 1647464Scael.Op Fl a Ar maxcontig 1747464Scael.Op Fl d Ar rotdelay 1847464Scael.Op Fl e Ar maxbpg 1947464Scael.Op Fl m Ar minfree 2047464Scael.Bk -words 2147464Scael.Op Fl o Ar optimize_preference 2247464Scael.Ek 2347464Scael.Op Ar special | Ar filesys 2447464Scael.Sh DESCRIPTION 2547464Scael.Nm Tunefs 2619022Smckusickis designed to change the dynamic parameters of a file system 2719022Smckusickwhich affect the layout policies. 2819022SmckusickThe parameters which are to be changed are indicated by the flags 2919022Smckusickgiven below: 3047464Scael.Bl -tag -width Ds 3147464Scael.It Fl a Ar maxcontig 3219022SmckusickThis specifies the maximum number of contiguous blocks that will 3347464Scaelbe laid out before forcing a rotational delay (see 3447464Scael.Fl d 3547464Scaelbelow). 3619022SmckusickThe default value is one, since most device drivers require 3719022Smckusickan interrupt per disk transfer. 3819022SmckusickDevice drivers that can chain several buffers together in a single 3919022Smckusicktransfer should set this to the maximum chain length. 4047464Scael.It Fl d Ar rotdelay 4119022SmckusickThis specifies the expected time (in milliseconds) 4219022Smckusickto service a transfer completion 4319022Smckusickinterrupt and initiate a new transfer on the same disk. 4419022SmckusickIt is used to decide how much rotational spacing to place between 4519022Smckusicksuccessive blocks in a file. 4647464Scael.It Fl e Ar maxbpg 4719022SmckusickThis indicates the maximum number of blocks any single file can 4819022Smckusickallocate out of a cylinder group before it is forced to begin 4919022Smckusickallocating blocks from another cylinder group. 5019022SmckusickTypically this value is set to about one quarter of the total blocks 5119022Smckusickin a cylinder group. 5219022SmckusickThe intent is to prevent any single file from using up all the 5319022Smckusickblocks in a single cylinder group, 5447464Scaelthus degrading access times for all files subsequently allocated 5519022Smckusickin that cylinder group. 5619022SmckusickThe effect of this limit is to cause big files to do long seeks 5719022Smckusickmore frequently than if they were allowed to allocate all the blocks 5819022Smckusickin a cylinder group before seeking elsewhere. 5947464ScaelFor file systems with exclusively large files, 6019022Smckusickthis parameter should be set higher. 6147464Scael.It Fl m Ar minfree 6219022SmckusickThis value specifies the percentage of space held back 6319022Smckusickfrom normal users; the minimum free space threshold. 6419022SmckusickThe default value used is 10%. 6519022SmckusickThis value can be set to zero, however up to a factor of three 6619022Smckusickin throughput will be lost over the performance obtained at a 10% 6719022Smckusickthreshold. 6819022SmckusickNote that if the value is raised above the current usage level, 6919022Smckusickusers will be unable to allocate files until enough files have 7019022Smckusickbeen deleted to get under the higher threshold. 7147464Scael.It Fl o Ar optimize_preference 7224708SmckusickThe file system can either try to minimize the time spent 73*65103Smckusickallocating blocks, or it can attempt to minimize the space 7424708Smckusickfragmentation on the disk. 7524708SmckusickIf the value of minfree (see above) is less than 10%, 7624708Smckusickthen the file system should optimize for space to avoid 7724708Smckusickrunning out of full sized blocks. 7824708SmckusickFor values of minfree greater than or equal to 10%, 7924708Smckusickfragmentation is unlikely to be problematical, and 8024708Smckusickthe file system can be optimized for time. 8147464Scael.El 8247464Scael.Sh SEE ALSO 8347464Scael.Xr fs 5 , 8455926Sbostic.Xr dumpfs 8 , 8547464Scael.Xr newfs 8 , 8647464Scael.Xr mkfs 8 8747464Scael.Rs 8847464Scael.%A M. McKusick 8947464Scael.%A W. Joy 9047464Scael.%A S. Leffler 9147464Scael.%A R. Fabry 9247464Scael.%T "A Fast File System for UNIX" 9347464Scael.%J "ACM Transactions on Computer Systems 2" 9447464Scael.%N 3 9547464Scael.%P pp 181-197 9647464Scael.%D August 1984 9747464Scael.%O "(reprinted in the BSD System Manager's Manual, SMM:5)" 9847464Scael.Re 9947464Scael.Sh BUGS 10019022SmckusickThis program should work on mounted and active file systems. 10119022SmckusickBecause the super-block is not kept in the buffer cache, 10228372Smckusickthe changes will only take effect if the program 10328372Smckusickis run on dismounted file systems. 10428372SmckusickTo change the root file system, the system must be rebooted 10528372Smckusickafter the file system is tuned. 10647464Scael.Pp 10719022SmckusickYou can tune a file system, but you can't tune a fish. 10847464Scael.Sh HISTORY 10947464ScaelThe 11047464Scael.Nm 11147464Scaelcommand appeared in 11247464Scael.Bx 4.2 . 113