]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - sbin/tunefs/tunefs.8
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / sbin / tunefs / tunefs.8
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 .\" 4. Neither the name of the University nor the names of its contributors
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$
30 .\"
31 .Dd June 22, 2011
32 .Dt TUNEFS 8
33 .Os
34 .Sh NAME
35 .Nm tunefs
36 .Nd tune up an existing UFS file system
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl A
40 .Op Fl a Cm enable | disable
41 .Op Fl e Ar maxbpg
42 .Op Fl f Ar avgfilesize
43 .Op Fl j Cm enable | disable
44 .Op Fl J Cm enable | disable
45 .Op Fl L Ar volname
46 .Op Fl l Cm enable | disable
47 .Op Fl m Ar minfree
48 .Op Fl N Cm enable | disable
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 .Op Fl S Ar size
54 .Op Fl t Cm enable | disable
55 .Ar special | filesystem
56 .Sh DESCRIPTION
57 The
58 .Nm
59 utility is designed to change the dynamic parameters of a UFS file system
60 which affect the layout policies.
61 The
62 .Nm
63 utility cannot be run on an active file system.
64 To change an active file system,
65 it must be downgraded to read-only or unmounted.
66 .Pp
67 The parameters which are to be changed are indicated by the flags
68 given below:
69 .Bl -tag -width indent
70 .It Fl A
71 The file system has several backups of the super-block.
72 Specifying
73 this option will cause all backups to be modified as well as the
74 primary super-block.
75 This is potentially dangerous - use with caution.
76 .It Fl a Cm enable | disable
77 Turn on/off the administrative POSIX.1e ACL enable flag.
78 .It Fl e Ar maxbpg
79 Indicate the maximum number of blocks any single file can
80 allocate out of a cylinder group before it is forced to begin
81 allocating blocks from another cylinder group.
82 Typically this value is set to about one quarter of the total blocks
83 in a cylinder group.
84 The intent is to prevent any single file from using up all the
85 blocks in a single cylinder group,
86 thus degrading access times for all files subsequently allocated
87 in that cylinder group.
88 The effect of this limit is to cause big files to do long seeks
89 more frequently than if they were allowed to allocate all the blocks
90 in a cylinder group before seeking elsewhere.
91 For file systems with exclusively large files,
92 this parameter should be set higher.
93 .It Fl f Ar avgfilesize
94 Specify the expected average file size.
95 .It Fl j Cm enable | disable
96 Turn on/off soft updates journaling.
97 .It Fl J Cm enable | disable
98 Turn on/off gjournal flag.
99 .It Fl L Ar volname
100 Add/modify an optional file system volume label.
101 .It Fl l Cm enable | disable
102 Turn on/off MAC multilabel flag.
103 .It Fl m Ar minfree
104 Specify the percentage of space held back
105 from normal users; the minimum free space threshold.
106 The default value used is 8%.
107 Note that lowering the threshold can adversely affect performance:
108 .Bl -bullet
109 .It
110 Settings of 5% and less force space optimization to
111 always be used which will greatly increase the overhead for file
112 writes.
113 .It
114 The file system's ability to avoid fragmentation will be reduced
115 when the total free space, including the reserve, drops below 15%.
116 As free space approaches zero, throughput can degrade by up to a
117 factor of three over the performance obtained at a 10% threshold.
118 .El
119 .Pp
120 If the value is raised above the current usage level,
121 users will be unable to allocate files until enough files have
122 been deleted to get under the higher threshold.
123 .It Fl N Cm enable | disable
124 Turn on/off the administrative NFSv4 ACL enable flag.
125 .It Fl n Cm enable | disable
126 Turn on/off soft updates.
127 .It Fl o Cm space | time
128 The file system can either try to minimize the time spent
129 allocating blocks, or it can attempt to minimize the space
130 fragmentation on the disk.
131 Optimization for space has much
132 higher overhead for file writes.
133 The kernel normally changes the preference automatically as
134 the percent fragmentation changes on the file system.
135 .It Fl p
136 Show a summary of what the current tunable settings
137 are on the selected file system.
138 More detailed information can be
139 obtained from the
140 .Xr dumpfs 8
141 utility.
142 .It Fl s Ar avgfpdir
143 Specify the expected number of files per directory.
144 .It Fl S Ar size
145 Specify the softdep journal size in bytes.
146 The minimum is 4M.
147 .It Fl t Cm enable | disable
148 Turn on/off the TRIM enable flag.
149 If enabled, and if the underlying device supports the BIO_DELETE
150 command, the file system will send a delete request to the underlying
151 device for each freed block.
152 The trim enable flag is typically set when the underlying device
153 uses flash-memory as the device can use the delete command to
154 pre-zero or at least avoid copying blocks that have been deleted.
155 .El
156 .Pp
157 At least one of the above flags is required.
158 .Sh FILES
159 .Bl -tag -width ".Pa /etc/fstab"
160 .It Pa /etc/fstab
161 read this to determine the device file for a
162 specified mount point.
163 .El
164 .Sh SEE ALSO
165 .Xr fs 5 ,
166 .Xr dumpfs 8 ,
167 .Xr gjournal 8 ,
168 .Xr growfs 8 ,
169 .Xr newfs 8
170 .Rs
171 .%A M. McKusick
172 .%A W. Joy
173 .%A S. Leffler
174 .%A R. Fabry
175 .%T "A Fast File System for UNIX"
176 .%J "ACM Transactions on Computer Systems 2"
177 .%N 3
178 .%P pp 181-197
179 .%D August 1984
180 .%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
181 .Re
182 .Sh HISTORY
183 The
184 .Nm
185 utility appeared in
186 .Bx 4.2 .
187 .Sh BUGS
188 This utility does not work on active file systems.
189 To change the root file system, the system must be rebooted
190 after the file system is tuned.
191 .\" Take this out and a Unix Daemon will dog your steps from now until
192 .\" the time_t's wrap around.
193 .Pp
194 You can tune a file system, but you cannot tune a fish.