xref: /freebsd/sbin/tunefs/tunefs.8 (revision 7f3dea244c40159a41ab22da77a434d7c5b5e85a)
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.\" $FreeBSD$
34.\"
35.Dd December 11, 1993
36.Dt TUNEFS 8
37.Os BSD 4.2
38.Sh NAME
39.Nm tunefs
40.Nd tune up an existing file system
41.Sh SYNOPSIS
42.Nm tunefs
43.Op Fl A
44.Op Fl a Ar maxcontig
45.Op Fl d Ar rotdelay
46.Op Fl e Ar maxbpg
47.Op Fl m Ar minfree
48.Bk -words
49.Op Fl n Ar enable | disable
50.Op Fl o Ar optimize_preference
51.Op Fl p
52.Ek
53.Op Ar special | Ar filesystem
54.Sh DESCRIPTION
55.Nm Tunefs
56is designed to change the dynamic parameters of a file system
57which affect the layout policies.
58The parameters which are to be changed are indicated by the flags
59given below:
60.Bl -tag -width indent
61.It Fl A
62The file system has several backups of the super-block.  Specifying
63this option will cause all backups to be modified as well as the
64primary super-block.  This is potentially dangerous - use with caution.
65.It Fl a Ar maxcontig
66Specify the maximum number of contiguous blocks that will
67be laid out before forcing a rotational delay (see
68.Fl d
69below).
70The default value is one, since most device drivers require
71an interrupt per disk transfer.
72Device drivers that can chain several buffers together in a single
73transfer should set this to the maximum chain length.
74.It Fl d Ar rotdelay
75Specify the expected time (in milliseconds)
76to service a transfer completion
77interrupt and initiate a new transfer on the same disk.
78It is used to decide how much rotational spacing to place between
79successive blocks in a file.
80.It Fl e Ar maxbpg
81Indicate the maximum number of blocks any single file can
82allocate out of a cylinder group before it is forced to begin
83allocating blocks from another cylinder group.
84Typically this value is set to about one quarter of the total blocks
85in a cylinder group.
86The intent is to prevent any single file from using up all the
87blocks in a single cylinder group,
88thus degrading access times for all files subsequently allocated
89in that cylinder group.
90The effect of this limit is to cause big files to do long seeks
91more frequently than if they were allowed to allocate all the blocks
92in a cylinder group before seeking elsewhere.
93For file systems with exclusively large files,
94this parameter should be set higher.
95.It Fl m Ar minfree
96Specify the percentage of space held back
97from normal users; the minimum free space threshold.
98The default value used is 8%.
99This value can be set to zero, however up to a factor of three
100in throughput will be lost over the performance obtained at a 10%
101threshold. Settings of 5% and less force space optimization to
102always be used which will greatly increase the overhead for file
103writes.
104Note that if the value is raised above the current usage level,
105users will be unable to allocate files until enough files have
106been deleted to get under the higher threshold.
107.It Fl n Ar enable | disable
108Turn on/off soft updates. An unmounted filesystem is required.
109.It Fl o Ar optimize_preference
110The file system can either try to minimize the time spent
111allocating blocks, or it can attempt to minimize the space
112fragmentation on the disk. Optimization for space has much
113higher overhead for file writes.
114The kernel normally changes the preference automatically as
115the percent fragmentation changes on the file system.
116.It Fl p
117Show a summary of what the current tunable settings
118are on the selected file system.  More detailed information can be
119obtained in the
120.Xr dumpfs 8
121manual page.
122.El
123.Sh SEE ALSO
124.Xr fs 5 ,
125.Xr dumpfs 8 ,
126.Xr newfs 8
127.Rs
128.%A M. McKusick
129.%A W. Joy
130.%A S. Leffler
131.%A R. Fabry
132.%T "A Fast File System for UNIX"
133.%J "ACM Transactions on Computer Systems 2"
134.%N 3
135.%P pp 181-197
136.%D August 1984
137.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
138.Re
139.Sh BUGS
140This program should work on mounted and active file systems.
141Because the super-block is not kept in the buffer cache,
142the changes will only take effect if the program
143is run on dismounted file systems.
144To change the root file system, the system must be rebooted
145after the file system is tuned.
146.\" Take this out and a Unix Demon will dog your steps from now until
147.\" the time_t's wrap around.
148.Pp
149You can tune a file system, but you can't tune a fish.
150.Sh HISTORY
151The
152.Nm
153command appeared in
154.Bx 4.2 .
155