usr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode
[dragonfly.git] / sbin / tunefs / tunefs.8
CommitLineData
984263bc
MD
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.
dc71b7ab 12.\" 3. Neither the name of the University nor the names of its contributors
984263bc
MD
13.\" may be used to endorse or promote products derived from this software
14.\" without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93
29.\" $FreeBSD: src/sbin/tunefs/tunefs.8,v 1.11.2.6 2003/01/23 11:14:02 maxim Exp $
d600454b 30.\" $DragonFly: src/sbin/tunefs/tunefs.8,v 1.3 2006/02/17 19:33:33 swildner Exp $
984263bc
MD
31.\"
32.Dd December 11, 1993
33.Dt TUNEFS 8
34.Os
35.Sh NAME
36.Nm tunefs
8895c5fa 37.Nd tune up an existing UFS filesystem
984263bc
MD
38.Sh SYNOPSIS
39.Nm
8895c5fa 40.Op Fl \&Ap
984263bc
MD
41.Op Fl a Ar maxcontig
42.Op Fl d Ar rotdelay
43.Op Fl e Ar maxbpg
44.Op Fl f Ar avgfilesize
45.Op Fl m Ar minfree
46.Bk -words
8895c5fa
TN
47.Op Fl n Cm enable | disable
48.Op Fl o Cm space | time
984263bc
MD
49.Op Fl s Ar avgfpdir
50.Ek
8895c5fa 51.Brq Ar special | filesystem
984263bc
MD
52.Sh DESCRIPTION
53.Nm Tunefs
54is designed to change the dynamic parameters of a filesystem
55which affect the layout policies.
56The parameters which are to be changed are indicated by the flags
57given below:
58.Bl -tag -width indent
59.It Fl A
8895c5fa
TN
60The filesystem has several backups of the super-block.
61Specifying
984263bc 62this option will cause all backups to be modified as well as the
8895c5fa
TN
63primary super-block.
64This is potentially dangerous - use with caution.
984263bc
MD
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 filesystems with exclusively large files,
94this parameter should be set higher.
95.It Fl f Ar avgfilezsize
96Specify the expected average file size.
97.It Fl m Ar minfree
98Specify the percentage of space held back
99from normal users; the minimum free space threshold.
100The default value used is 8%.
101This value can be set to zero, however up to a factor of three
102in throughput will be lost over the performance obtained at a 10%
103threshold.
104Settings of 5% and less force space optimization to
105always be used which will greatly increase the overhead for file
106writes.
107Note that if the value is raised above the current usage level,
108users will be unable to allocate files until enough files have
109been deleted to get under the higher threshold.
8895c5fa 110.It Fl n Cm enable | disable
984263bc 111Turn on/off soft updates.
8895c5fa 112.It Fl o Cm space | time
984263bc
MD
113The filesystem can either try to minimize the time spent
114allocating blocks, or it can attempt to minimize the space
115fragmentation on the disk.
116Optimization for space has much
117higher overhead for file writes.
118The kernel normally changes the preference automatically as
119the percent fragmentation changes on the filesystem.
120.It Fl p
121Show a summary of what the current tunable settings
8895c5fa
TN
122are on the selected filesystem.
123More detailed information can be
984263bc
MD
124obtained in the
125.Xr dumpfs 8
126manual page.
127.It Fl s Ar avgfpdir
128Specify the expected number of files per directory.
129.El
130.Sh FILES
131.Bl -tag -width /etc/fstab -compact
132.It Pa /etc/fstab
133read this to determine the device file for a
134specified mount point.
135.El
136.Sh SEE ALSO
137.Xr fs 5 ,
8895c5fa 138.Xr UFS 5 ,
984263bc
MD
139.Xr dumpfs 8 ,
140.Xr newfs 8
141.Rs
142.%A M. McKusick
143.%A W. Joy
144.%A S. Leffler
145.%A R. Fabry
146.%T "A Fast File System for UNIX"
147.%J "ACM Transactions on Computer Systems 2"
148.%N 3
149.%P pp 181-197
150.%D August 1984
151.%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
152.Re
d600454b
SW
153.Sh HISTORY
154The
155.Nm
156command appeared in
157.Bx 4.2 .
984263bc
MD
158.Sh BUGS
159This program should work on mounted and active filesystems.
160Because the super-block is not kept in the buffer cache,
161the changes will only take effect if the program
162is run on dismounted filesystems.
163To change the root filesystem, the system must be rebooted
164after the filesystem is tuned.
165.\" Take this out and a Unix Demon will dog your steps from now until
166.\" the time_t's wrap around.
167.Pp
168You can tune a filesystem, but you can't tune a fish.