Whamcloud - gitweb
mke2fs.c (PRS): Handle -O and -s options in line in the getopt
[tools/e2fsprogs.git] / misc / tune2fs.8.in
1 .\" Revision 1.0 93/06/3 23:00  chk
2 .\" Initial revision
3 .\"
4 .\"
5 .TH TUNE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 tune2fs \- adjust tunable filesystem parameters on second extended filesystems
8 .SH SYNOPSIS
9 .B tune2fs
10 [
11 .B \-l
12 ]
13 [
14 .B \-c
15 .I max-mount-counts
16 ]
17 [
18 .B \-e
19 .I errors-behavior
20 ]
21 [
22 .B \-i
23 .I interval-between-checks
24 ]
25 [
26 .B \-j
27 ]
28 [
29 .B \-J
30 .I journal-options
31 ]
32 [
33 .B \-m
34 .I reserved-blocks-percentage
35 ]
36 [
37 .B \-r
38 .I reserved-blocks-count
39 ]
40 [
41 .B \-s
42 .I sparse-super-flag
43 ]
44 [
45 .B \-u
46 .I user
47 ]
48 [
49 .B \-g
50 .I group
51 ]
52 [
53 .B \-C
54 .I mount-count
55 ]
56 [
57 .B \-L
58 .I volume-name
59 ]
60 [
61 .B \-M
62 .I last-mounted-directory
63 ]
64 [
65 .B \-O 
66 .RI [^] feature [,...]
67 ]
68 [
69 .B \-U
70 .I UUID
71 ]
72 device
73 .SH DESCRIPTION
74 .BI tune2fs
75 adjusts tunable filesystem parameters on a Linux second extended filesystem.
76 .SH OPTIONS
77 .TP
78 .BI \-c " max-mount-counts"
79 Adjust the maximal mounts count between two filesystem checks.  If 
80 .I max-mount-counts
81 is 0 then the number of times the filesystem is mounted will be disregarded
82 by
83 .BR e2fsck (8)
84 and the kernel.
85 .sp
86 Staggering the mount-counts at which filesystems are forcibly
87 checked will avoid all filesystems being checked at one time
88 when using journaled filesystems.
89 .sp
90 You should strongly consider the consequences of disabling
91 mount-count-dependent checking entirely.  Bad disk drives, cables,
92 memory, and kernel bugs could all corrupt a filesystem without
93 marking the filesystem dirty or in error.  If you are using
94 journaling on your filesystem, your filesystem will
95 .B never
96 be marked dirty, so it will not normally be checked.  A
97 filesystem error detected by the kernel will still force
98 an fsck on the next reboot, but it may already be too late
99 to prevent data loss at that point.
100 .sp
101 See also the
102 .B \-i
103 option for time-dependent checking.
104 .TP
105 .BI \-C " mount-count"
106 Set the number of times the filesystem has been mounted.
107 Can be used in conjunction with -c to force an fsck on
108 the filesystem at the next reboot.
109 .TP
110 .BI \-e " error-behavior"
111 Change the behavior of the kernel code when errors are detected.
112 In all cases, a filesystem error will cause
113 .BR e2fsck (8)
114 to check the filesystem on the next boot.
115 .I error-behavior
116 can be one of the following:
117 .RS 1.2i
118 .TP 1.2i
119 .B continue
120 Continue normal execution.
121 .TP
122 .B remount-ro
123 Remount filesystem read-only.
124 .TP
125 .B panic
126 Cause a kernel panic.
127 .RE
128 .TP
129 .BI \-g " group"
130 Set the group which can use reserved filesystem blocks.
131 The 
132 .I group
133 parameter can be a numerical gid or a group name.  If a group name is given,
134 it is converted to a numerical gid before it is stored in the superblock.
135 .TP
136 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
137 Adjust the maximal time between two filesystem checks. 
138 No postfix or
139 .B d
140 result in days,
141 .B m
142 in months, and
143 .B w
144 in weeks.  A value of zero will disable the time-dependent checking.
145 .sp
146 It is strongly recommended that either
147 .B \-c
148 (mount-count-dependent) or
149 .B \-i
150 (time-dependent) checking be enabled to force periodic full
151 .BR e2fsck (8)
152 checking of the filesystem.  Failure to do so may lead to filesystem
153 corruption due to bad disks, cables, memory, or kernel bugs to go
154 unnoticed until they cause data loss or corruption.
155 .TP
156 .B \-j
157 Add an ext3 journal to the filesystem.  If the 
158 .B \-J
159 option is not specified, the default journal parameters will be used to create
160 an appropriately sized journal (given the size of the filesystem) 
161 stored within the filesystem.  Note that you must be using a kernel
162 which has ext3 support in order to actually make use of the journal.
163 .TP
164 .BR \-J " journal-options"
165 Override the default ext3 journal parameters. Journal options are comma
166 separated, and may take an argument using the equals ('=')  sign.
167 The following journal options are supported:
168 .RS 1.2i
169 .TP
170 .BI size= journal-size
171 Create a journal stored in the filesystem of size
172 .I journal-size
173 megabytes.   The size of the journal must be at least 1024 filesystem blocks
174 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
175 and may be no more than 102,400 filesystem blocks.
176 There must be enough free space in the filesystem to create a journal of
177 that size.
178 @JDEV@.TP
179 @JDEV@.BI device= external-journal
180 @JDEV@Attach the filesystem to the journal block device located on
181 @JDEV@.IR external-journal .
182 @JDEV@The external 
183 @JDEV@journal must have been already created using the command
184 @JDEV@.IP
185 @JDEV@.B mke2fs -O journal_dev 
186 @JDEV@.I external-journal
187 @JDEV@.IP
188 @JDEV@Note that
189 @JDEV@.I external-journal
190 @JDEV@must be formatted with the same block
191 @JDEV@size as filesystems which will be using it.
192 .RE
193 @JDEV@.IP
194 @JDEV@Only one of the
195 @JDEV@.BR size " or " device
196 @JDEV@options can be given for a filesystem.
197 .TP
198 .B \-l
199 List the contents of the filesystem superblock.
200 .TP
201 .BI \-L " volume-label"
202 Set the volume label of the filesystem.  
203 Ext2 filesystem labels can be at most 16 characters long; if
204 .I volume-label 
205 is longer than 16 characters, 
206 .B tune2fs
207 will truncate it and print a warning.  
208 .TP
209 .BI \-m " reserved-blocks-percentage"
210 Set the percentage of reserved filesystem blocks.
211 .TP
212 .BI \-M " last-mounted-directory"
213 Set the last-mounted directory for the filesystem.
214 .TP
215 .BR \-O " [^]\fIfeature\fR[,...]"
216 Set or clear the indicated filesystem features (options) in the filesystem.
217 More than one filesystem feature can be cleared or set by separating
218 features with commas.  Filesystem features prefixed with a 
219 caret character ('^') will be cleared in the filesystem's superblock; 
220 filesystem features without a prefix character or prefixed with a plus 
221 character ('+') will be added to the filesystem.
222 .IP
223 The following filesystem features can be set or cleared using
224 .BR tune2fs :
225 .RS 1.2i
226 .TP
227 .B sparse_super
228 Limit the number of backup superblocks to save space on large filesystems.
229 .TP
230 .B filetype
231 Store file type information in directory entries.
232 .TP
233 .B has_journal
234 Create an ext3 journal (as if using the
235 .B \-j
236 option).
237 .RE
238 .IP
239 After setting or clearing any filesystem feature,
240 .BR e2fsck (8)
241 must be run on the filesystem to return the filesystem to a consistent state.
242 .IP
243 .B Warning:
244 Linux kernels before 2.0.39 and many 2.1 series kernels do not support
245 the filesystems that use any of these features.
246 Enabling certain filesystem features may prevent the filesystem from
247 being mounted by kernels which do not support those features.
248 .TP
249 .BI \-r " reserved-blocks-count"
250 Set the number of reserved filesystem blocks.
251 .TP
252 .BR \-s " [" 0 | 1 ]
253 Turn the sparse super feature off or on.  Turning this feature on
254 saves space on really big filesystems.  This is the same as using the
255 .B "\-O sparse_super"
256 option.
257 .IP
258 .B Warning:
259 Linux kernels before 2.0.39 do not support this feature.  Neither do
260 all Linux 2.1 kernels; please don't use this unless you know what you're
261 doing!  You need to run
262 .BR e2fsck (8)
263 on the filesystem after changing this feature in order to have a valid
264 filesystem.
265 .TP
266 .BI \-u " user"
267 Set the user who can use the reserved filesystem blocks.
268 .I user
269 can be a numerical uid or a user name.  If a user name is given, it 
270 is converted to a numerical uid before it is stored in the superblock.
271 .TP
272 .BI \-U " UUID"
273 Set the universally unique identifier (UUID) of the filesystem to
274 .IR UUID .
275 The format of the UUID is a series of hex digits separated by hypthens, 
276 like this: 
277 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  
278 The 
279 .I UUID
280 parameter may also be one of the following:
281 .RS 1.2i
282 .TP
283 .I clear
284 clear the filesystem UUID
285 .TP
286 .I random
287 generate a new randomly-generated UUID
288 .TP
289 .I time
290 generate a new time-based UUID
291 .RE
292 .IP
293 See
294 .BR uuidgen (8)
295 for more information.
296 If the system does not have a good random number generator such as
297 .I /dev/random
298 or
299 .IR /dev/urandom ,
300 .B tune2fs
301 will automatically use a time-based UUID instead of a randomly-generated UUID.
302 .SH BUGS
303 We haven't found any bugs yet.  That doesn't mean there aren't any...
304 .SH AUTHOR
305 .B tune2fs 
306 was written by Remy Card <Remy.Card@linux.org>.
307 .B tune2fs
308 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
309 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
310 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
311 .SH AVAILABILITY
312 .B tune2fs
313 is part of the e2fsprogs package and is available from 
314 http://e2fsprogs.sourceforge.net.
315 .SH SEE ALSO
316 .BR dumpe2fs (8),
317 .BR e2fsck (8),
318 .BR mke2fs (8)