xref: /original-bsd/sbin/tunefs/tunefs.8 (revision a998a48a)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)tunefs.8	8.3 (Berkeley) 05/03/95
7.\"
8.Dd
9.Dt TUNEFS 8
10.Os BSD 4.2
11.Sh NAME
12.Nm tunefs
13.Nd tune up an existing file system
14.Sh SYNOPSIS
15.Nm tunefs
16.Op Fl AN
17.Op Fl a Ar maxcontig
18.Op Fl d Ar rotdelay
19.Op Fl e Ar maxbpg
20.Op Fl m Ar minfree
21.Bk -words
22.Op Fl o Ar optimize_preference
23.Ek
24.Op Fl t Ar trackskew
25.Op Ar special | Ar filesys
26.Sh DESCRIPTION
27The
28.Nm tunefs
29program is designed to change the dynamic parameters of a file system
30which affect the layout policies.
31The
32.Fl N
33flag displays all the settable options
34(after any changes from the tuning options)
35but does not cause any of them to be changed.
36The
37.Fl A
38flag causes the values to be updated in all the alternate
39superblocks instead of just the standard superblock.
40If this option is not used,
41then use of a backup superblock by
42.Xr fsck 8
43will lose anything changed by
44.Nm tunefs .
45The
46.Fl A
47flag is ignored when the
48.Fl N
49flag is specified.
50.Pp
51The parameters which are to be changed are indicated by the flags
52given below:
53.Bl -tag -width Ds
54.It Fl a Ar maxcontig
55This specifies the maximum number of contiguous blocks that will
56be laid out before forcing a rotational delay (see
57.Fl d
58below).
59The default value is one, since most device drivers require
60an interrupt per disk transfer.
61Device drivers that can chain several buffers together in a single
62transfer should set this to the maximum chain length.
63.It Fl d Ar rotdelay
64This specifies the expected time (in milliseconds)
65to service a transfer completion
66interrupt and initiate a new transfer on the same disk.
67It is used to decide how much rotational spacing to place between
68successive blocks in a file.
69.It Fl e Ar maxbpg
70This indicates the maximum number of blocks any single file can
71allocate out of a cylinder group before it is forced to begin
72allocating blocks from another cylinder group.
73Typically this value is set to about one quarter of the total blocks
74in a cylinder group.
75The intent is to prevent any single file from using up all the
76blocks in a single cylinder group,
77thus degrading access times for all files subsequently allocated
78in that cylinder group.
79The effect of this limit is to cause big files to do long seeks
80more frequently than if they were allowed to allocate all the blocks
81in a cylinder group before seeking elsewhere.
82For file systems with exclusively large files,
83this parameter should be set higher.
84.It Fl m Ar minfree
85This value specifies the percentage of space held back
86from normal users; the minimum free space threshold.
87The default value used is 10%.
88This value can be set to zero, however up to a factor of three
89in throughput will be lost over the performance obtained at a 10%
90threshold.
91Note that if the value is raised above the current usage level,
92users will be unable to allocate files until enough files have
93been deleted to get under the higher threshold.
94.It Fl o Ar optimize_preference
95The file system can either try to minimize the time spent
96allocating blocks, or it can attempt to minimize the space
97fragmentation on the disk.
98If the value of minfree (see above) is less than 10%,
99then the file system should optimize for space to avoid
100running out of full sized blocks.
101For values of minfree greater than or equal to 10%,
102fragmentation is unlikely to be problematical, and
103the file system can be optimized for time.
104.It Fl t Ar trackskew
105This specifies the skew in sectors from one track to the next in a cylinder.
106The default value is zero, indicating that each track in a cylinder begins at
107the same rotational position.
108.El
109.Sh SEE ALSO
110.Xr fs 5 ,
111.Xr dumpfs 8 ,
112.Xr fsck 8 ,
113.Xr newfs 8 ,
114.Xr mkfs 8
115.Rs
116.%A M. McKusick
117.%A W. Joy
118.%A S. Leffler
119.%A R. Fabry
120.%T "A Fast File System for UNIX"
121.%J "ACM Transactions on Computer Systems 2"
122.%N 3
123.%P pp 181-197
124.%D August 1984
125.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
126.Re
127.Sh BUGS
128This program should work on mounted and active file systems.
129Because the super-block is not kept in the buffer cache,
130the changes will only take effect if the program
131is run on dismounted file systems.
132To change the root file system, the system must be rebooted
133after the file system is tuned.
134.Pp
135You can tune a file system, but you can't tune a fish.
136.Sh HISTORY
137The
138.Nm
139command appeared in
140.Bx 4.2 .
141