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