xref: /freebsd/sbin/tunefs/tunefs.8 (revision 23f282aa31e9b6fceacd449020e936e98d6f2298)
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.
102Settings of 5% and less force space optimization to
103always be used which will greatly increase the overhead for file
104writes.
105Note that if the value is raised above the current usage level,
106users will be unable to allocate files until enough files have
107been deleted to get under the higher threshold.
108.It Fl n Ar enable | disable
109Turn on/off soft updates.
110An unmounted filesystem is required.
111.It Fl o Ar optimize_preference
112The file system can either try to minimize the time spent
113allocating blocks, or it can attempt to minimize the space
114fragmentation on the disk.
115Optimization for space has much
116higher overhead for file writes.
117The kernel normally changes the preference automatically as
118the percent fragmentation changes on the file system.
119.It Fl p
120Show a summary of what the current tunable settings
121are on the selected file system.  More detailed information can be
122obtained in the
123.Xr dumpfs 8
124manual page.
125.El
126.Sh ERRORS
127If
128.Nm
129.Fl n
130is run to enable/disable soft update on an unmounted file system
131after booting single-user then
132.Nm
133will output the warning
134.Pp
135reload\&: Invalid argument
136.Pp
137preceded by the raw device name.
138This occurs because the filesystem
139is not currently mounted read-only.
140.Nm
141is trying to reload the incore (r*) device, but it was never loaded
142to begin with.
143When you boot single user, only
144.Dq /
145is mounted, so all other filesystems will give you that warning.
146It is completely harmless.
147.Sh SEE ALSO
148.Xr fs 5 ,
149.Xr dumpfs 8 ,
150.Xr newfs 8
151.Rs
152.%A M. McKusick
153.%A W. Joy
154.%A S. Leffler
155.%A R. Fabry
156.%T "A Fast File System for UNIX"
157.%J "ACM Transactions on Computer Systems 2"
158.%N 3
159.%P pp 181-197
160.%D August 1984
161.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
162.Re
163.Sh BUGS
164This program should work on mounted and active file systems.
165Because the super-block is not kept in the buffer cache,
166the changes will only take effect if the program
167is run on dismounted file systems.
168To change the root file system, the system must be rebooted
169after the file system is tuned.
170.\" Take this out and a Unix Demon will dog your steps from now until
171.\" the time_t's wrap around.
172.Pp
173You can tune a file system, but you can't tune a fish.
174.Sh HISTORY
175The
176.Nm
177command appeared in
178.Bx 4.2 .
179