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