xref: /freebsd/sbin/tunefs/tunefs.8 (revision 8e6b01171e30297084bb0b4457c4183c2746aacc)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)tunefs.8	8.2 (Berkeley) 12/11/93
33.\"
34.Dd December 11, 1993
35.Dt TUNEFS 8
36.Os BSD 4.2
37.Sh NAME
38.Nm tunefs
39.Nd tune up an existing file system
40.Sh SYNOPSIS
41.Nm tunefs
42.Op Fl A
43.Op Fl a Ar maxcontig
44.Op Fl d Ar rotdelay
45.Op Fl e Ar maxbpg
46.Op Fl m Ar minfree
47.Op Fl p
48.Bk -words
49.Op Fl o Ar optimize_preference
50.Ek
51.Op Ar special | Ar filesys
52.Sh DESCRIPTION
53.Nm Tunefs
54is designed to change the dynamic parameters of a file system
55which affect the layout policies.
56The parameters which are to be changed are indicated by the flags
57given below:
58.Bl -tag -width Ds
59.It Fl A
60The file system has several backups of the super-block.  Specifying
61this option will cause all backups to be modified as well as the
62primary super-block.  This is potentially dangerous - use with caution.
63.It Fl a Ar maxcontig
64This specifies the maximum number of contiguous blocks that will
65be laid out before forcing a rotational delay (see
66.Fl d
67below).
68The default value is one, since most device drivers require
69an interrupt per disk transfer.
70Device drivers that can chain several buffers together in a single
71transfer should set this to the maximum chain length.
72.It Fl d Ar rotdelay
73This specifies the expected time (in milliseconds)
74to service a transfer completion
75interrupt and initiate a new transfer on the same disk.
76It is used to decide how much rotational spacing to place between
77successive blocks in a file.
78.It Fl e Ar maxbpg
79This indicates the maximum number of blocks any single file can
80allocate out of a cylinder group before it is forced to begin
81allocating blocks from another cylinder group.
82Typically this value is set to about one quarter of the total blocks
83in a cylinder group.
84The intent is to prevent any single file from using up all the
85blocks in a single cylinder group,
86thus degrading access times for all files subsequently allocated
87in that cylinder group.
88The effect of this limit is to cause big files to do long seeks
89more frequently than if they were allowed to allocate all the blocks
90in a cylinder group before seeking elsewhere.
91For file systems with exclusively large files,
92this parameter should be set higher.
93.It Fl m Ar minfree
94This value specifies the percentage of space held back
95from normal users; the minimum free space threshold.
96The default value used is 8%.
97This value can be set to zero, however up to a factor of three
98in throughput will be lost over the performance obtained at a 10%
99threshold. Settings of 5% and less force space optimization to
100always be used which will greatly increase the overhead for file
101writes.
102Note that if the value is raised above the current usage level,
103users will be unable to allocate files until enough files have
104been deleted to get under the higher threshold.
105.It Fl o Ar optimize_preference
106The file system can either try to minimize the time spent
107allocating blocks, or it can attempt to minimize the space
108fragmentation on the disk. Optimization for space has much
109higher overhead for file writes.
110The kernel normally changes the preference automatically as
111the percent fragmentation changes on the file system.
112.It Fl p
113This option shows a summary of what the current tuneable settings
114are on the selected file system.  More detailed information can be
115obtained in the
116.Xr dumpfs 8
117manual page.
118.El
119.Sh SEE ALSO
120.Xr fs 5 ,
121.Xr dumpfs 8 ,
122.Xr newfs 8 ,
123.Xr mkfs 8
124.Rs
125.%A M. McKusick
126.%A W. Joy
127.%A S. Leffler
128.%A R. Fabry
129.%T "A Fast File System for UNIX"
130.%J "ACM Transactions on Computer Systems 2"
131.%N 3
132.%P pp 181-197
133.%D August 1984
134.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
135.Re
136.Sh BUGS
137This program should work on mounted and active file systems.
138Because the super-block is not kept in the buffer cache,
139the changes will only take effect if the program
140is run on dismounted file systems.
141To change the root file system, the system must be rebooted
142after the file system is tuned.
143.\" Take this out and a Unix Demon will dog your steps from now until
144.\" the time_t's wrap around.
145.Pp
146You can tune a file system, but you can't tune a fish.
147.Sh HISTORY
148The
149.Nm
150command appeared in
151.Bx 4.2 .
152