1 .\" $NetBSD: tunefs.8,v 1.37 2008/07/31 05:38:04 simonb Exp $
3 .\" Copyright (c) 1983, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)tunefs.8 8.3 (Berkeley) 5/3/95
37 .Nd tune up an existing file system
42 .Op Fl g Ar avgfilesize
47 .Op Fl o Ar optimize_preference
49 .Ar special | Ar filesys
52 is designed to change the dynamic parameters of a file system
53 which affect the layout policies.
55 The following options are supported by
59 Cause the values to be updated in all the alternate
60 superblocks instead of just the standard superblock.
61 If this option is not used,
62 then use of a backup superblock by
64 will lose anything changed by
73 is a file system image, rather than a device name or file system mount point.
78 Display all the settable options
79 (after any changes from the tuning options)
80 but do not cause any of them to be changed.
82 This indicates the maximum number of blocks any single file can
83 allocate out of a cylinder group before it is forced to begin
84 allocating blocks from another cylinder group.
85 Typically this value is set to about one quarter of the total blocks
87 The intent is to prevent any single file from using up all the
88 blocks in a single cylinder group,
89 thus degrading access times for all files subsequently allocated
90 in that cylinder group.
91 The effect of this limit is to cause big files to do long seeks
92 more frequently than if they were allowed to allocate all the blocks
93 in a cylinder group before seeking elsewhere.
94 For file systems with exclusively large files,
95 this parameter should be set higher.
96 .It Fl g Ar avgfilesize
97 This specifies the expected average file size.
99 This specifies the expected number of files per directory.
101 This value specifies the size of the in-filesystem journaling log file.
102 The default journaling log file size is described in
104 Specifying a size of zero will cause the in-filesystem journaling log file
105 to be removed the next time the filesystem is mounted.
106 The size of an existing in-filesystem journaling log file can not be changed.
108 This value specifies the percentage of space held back
109 from normal users; the minimum free space threshold.
110 The default value is set during creation of the filesystem, see
112 This value can be set to zero, however up to a factor of three
113 in throughput will be lost over the performance obtained at a 5%
115 Note that if the value is raised above the current usage level,
116 users will be unable to allocate files until enough files have
117 been deleted to get under the higher threshold.
118 .It Fl o Ar optimize_preference
119 The file system can either try to minimize the time spent
120 allocating blocks, or it can attempt to minimize the space
121 fragmentation on the disk.
122 If the value of minfree (see above) is less than 5%,
123 then the file system should optimize for space to avoid
124 running out of full sized blocks.
125 For values of minfree greater than or equal to 5%,
126 fragmentation is unlikely to be problematical, and
127 the file system can be optimized for time.
129 .Ar optimize_preference
130 can be specified as either
146 .%T "A Fast File System for UNIX"
147 .%J "ACM Transactions on Computer Systems 2"
151 .%O "(reprinted in the BSD System Manager's Manual, SMM:5)"
159 This program should work on mounted and active file systems.
160 Because the super-block is not kept in the buffer cache,
161 the changes will only take effect if the program
162 is run on unmounted file systems.
163 To change the root file system, the system must be rebooted
164 after the file system is tuned.
166 .\" Take this out and a Unix Demon will dog your steps from now until
167 .\" the time_t's wrap around.
168 You can tune a file system, but you can't tune a fish.