xref: /freebsd/sbin/tunefs/tunefs.8 (revision a3e8fd0b7f663db7eafff527d5c3ca3bcfa8a537)
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 May 18, 2002
36.Dt TUNEFS 8
37.Os
38.Sh NAME
39.Nm tunefs
40.Nd tune up an existing file system
41.Sh SYNOPSIS
42.Nm
43.Op Fl A
44.Op Fl a Cm enable | disable
45.Op Fl e Ar maxbpg
46.Op Fl f Ar avgfilesize
47.Op Fl l Cm enable | disable
48.Op Fl m Ar minfree
49.Op Fl n Cm enable | disable
50.Op Fl o Cm space | time
51.Op Fl p
52.Op Fl s Ar avgfpdir
53.Ar special | filesystem
54.Sh DESCRIPTION
55The
56.Nm
57utility is designed to change the dynamic parameters of a file system
58which affect the layout policies.
59The
60.Nm
61utility cannot be run on an active file system.
62To change an active file system,
63it must be downgraded to read-only or unmounted.
64.Pp
65The parameters which are to be changed are indicated by the flags
66given below:
67.Bl -tag -width indent
68.It Fl A
69The file system has several backups of the super-block.
70Specifying
71this option will cause all backups to be modified as well as the
72primary super-block.
73This is potentially dangerous - use with caution.
74.It Fl a Cm enable | disable
75Turn on/off the administrative ACL enable flag.
76.It Fl e Ar maxbpg
77Indicate the maximum number of blocks any single file can
78allocate out of a cylinder group before it is forced to begin
79allocating blocks from another cylinder group.
80Typically this value is set to about one quarter of the total blocks
81in a cylinder group.
82The intent is to prevent any single file from using up all the
83blocks in a single cylinder group,
84thus degrading access times for all files subsequently allocated
85in that cylinder group.
86The effect of this limit is to cause big files to do long seeks
87more frequently than if they were allowed to allocate all the blocks
88in a cylinder group before seeking elsewhere.
89For file systems with exclusively large files,
90this parameter should be set higher.
91.It Fl f Ar avgfilesize
92Specify the expected average file size.
93.It Fl l Cm enable | disable
94Turn on/off MAC multilabel flag.
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%.
99Note that lowering the threshold can adversely affect performance:
100.Bl -bullet
101.It
102Settings of 5% and less force space optimization to
103always be used which will greatly increase the overhead for file
104writes.
105.It
106The file system's ability to avoid fragmentation will be reduced
107when the total free space, including the reserve, drops below 15%.
108As free space approaches zero, throughput can degrade by up to a
109factor of three over the performance obtained at a 10% threshold.
110.El
111.Pp
112If the value is raised above the current usage level,
113users will be unable to allocate files until enough files have
114been deleted to get under the higher threshold.
115.It Fl n Cm enable | disable
116Turn on/off soft updates.
117.It Fl o Cm space | time
118The file system can either try to minimize the time spent
119allocating blocks, or it can attempt to minimize the space
120fragmentation on the disk.
121Optimization for space has much
122higher overhead for file writes.
123The kernel normally changes the preference automatically as
124the percent fragmentation changes on the file system.
125.It Fl p
126Show a summary of what the current tunable settings
127are on the selected file system.
128More detailed information can be
129obtained from the
130.Xr dumpfs 8
131or
132.Xr ffsinfo 8
133utilities.
134.It Fl s Ar avgfpdir
135Specify the expected number of files per directory.
136.El
137.Pp
138At least one of the above flags is required.
139.Sh FILES
140.Bl -tag -width ".Pa /etc/fstab"
141.It Pa /etc/fstab
142read this to determine the device file for a
143specified mount point.
144.El
145.Sh SEE ALSO
146.Xr fs 5 ,
147.Xr dumpfs 8 ,
148.Xr ffsinfo 8 ,
149.Xr newfs 8
150.Rs
151.%A M. McKusick
152.%A W. Joy
153.%A S. Leffler
154.%A R. Fabry
155.%T "A Fast File System for UNIX"
156.%J "ACM Transactions on Computer Systems 2"
157.%N 3
158.%P pp 181-197
159.%D August 1984
160.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
161.Re
162.Sh BUGS
163This utility should work on active file systems.
164.\" Take this out and a Unix Daemon will dog your steps from now until
165.\" the time_t's wrap around.
166.Pp
167You can tune a file system, but you can't tune a fish.
168.Sh HISTORY
169The
170.Nm
171utility appeared in
172.Bx 4.2 .
173