Whamcloud - gitweb
Adjust description line so that apropos "ext2" or "ext3" will
[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 ext2/ext3 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 \-f
23 ]
24 [
25 .B \-i
26 .I interval-between-checks
27 ]
28 [
29 .B \-j
30 ]
31 [
32 .B \-J
33 .I journal-options
34 ]
35 [
36 .B \-m
37 .I reserved-blocks-percentage
38 ]
39 [
40 .B \-o
41 .RI [^] mount-options [,...]
42 ]
43
44 [
45 .B \-r
46 .I reserved-blocks-count
47 ]
48 [
49 .B \-s
50 .I sparse-super-flag
51 ]
52 [
53 .B \-u
54 .I user
55 ]
56 [
57 .B \-g
58 .I group
59 ]
60 [
61 .B \-C
62 .I mount-count
63 ]
64 [
65 .B \-L
66 .I volume-name
67 ]
68 [
69 .B \-M
70 .I last-mounted-directory
71 ]
72 [
73 .B \-O 
74 .RI [^] feature [,...]
75 ]
76 [
77 .B \-T
78 .I time-last-checked
79 ]
80 [
81 .B \-U
82 .I UUID
83 ]
84 device
85 .SH DESCRIPTION
86 .BI tune2fs
87 allows the system administrator to adjust various tunable filesystem 
88 parameters on Linux ext2/ext3 filesystems.
89 .SH OPTIONS
90 .TP
91 .BI \-c " max-mount-counts"
92 Adjust the maximal mounts count between two filesystem checks.  If 
93 .I max-mount-counts
94 is 0 then the number of times the filesystem is mounted will be disregarded
95 by
96 .BR e2fsck (8)
97 and the kernel.
98 .sp
99 Staggering the mount-counts at which filesystems are forcibly
100 checked will avoid all filesystems being checked at one time
101 when using journaled filesystems.
102 .sp
103 You should strongly consider the consequences of disabling
104 mount-count-dependent checking entirely.  Bad disk drives, cables,
105 memory, and kernel bugs could all corrupt a filesystem without
106 marking the filesystem dirty or in error.  If you are using
107 journaling on your filesystem, your filesystem will
108 .B never
109 be marked dirty, so it will not normally be checked.  A
110 filesystem error detected by the kernel will still force
111 an fsck on the next reboot, but it may already be too late
112 to prevent data loss at that point.
113 .sp
114 See also the
115 .B \-i
116 option for time-dependent checking.
117 .TP
118 .BI \-C " mount-count"
119 Set the number of times the filesystem has been mounted.
120 Can be used in conjunction with -c to force an fsck on
121 the filesystem at the next reboot.
122 .TP
123 .BI \-e " error-behavior"
124 Change the behavior of the kernel code when errors are detected.
125 In all cases, a filesystem error will cause
126 .BR e2fsck (8)
127 to check the filesystem on the next boot.
128 .I error-behavior
129 can be one of the following:
130 .RS 1.2i
131 .TP 1.2i
132 .B continue
133 Continue normal execution.
134 .TP
135 .B remount-ro
136 Remount filesystem read-only.
137 .TP
138 .B panic
139 Cause a kernel panic.
140 .RE
141 .TP
142 .B \-f
143 Force the tune2fs operation to complete even in the face of errors.  This 
144 option is useful when removing the 
145 .B has_journal
146 filesystem feature from a filesystem which has 
147 an external journal (or is corrupted
148 such that it appears to have an external journal), but that 
149 external journal is not available.   
150 .sp
151 .B WARNING:
152 Removing an external journal from a filesystem which was not cleanly unmounted
153 without first replaying the external journal can result in
154 severe data loss and filesystem corruption.
155 .TP
156 .BI \-g " group"
157 Set the group which can use reserved filesystem blocks.
158 The 
159 .I group
160 parameter can be a numerical gid or a group name.  If a group name is given,
161 it is converted to a numerical gid before it is stored in the superblock.
162 .TP
163 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
164 Adjust the maximal time between two filesystem checks. 
165 No postfix or
166 .B d
167 result in days,
168 .B m
169 in months, and
170 .B w
171 in weeks.  A value of zero will disable the time-dependent checking.
172 .sp
173 It is strongly recommended that either
174 .B \-c
175 (mount-count-dependent) or
176 .B \-i
177 (time-dependent) checking be enabled to force periodic full
178 .BR e2fsck (8)
179 checking of the filesystem.  Failure to do so may lead to filesystem
180 corruption due to bad disks, cables, memory, or kernel bugs to go
181 unnoticed until they cause data loss or corruption.
182 .TP
183 .B \-j
184 Add an ext3 journal to the filesystem.  If the 
185 .B \-J
186 option is not specified, the default journal parameters will be used to create
187 an appropriately sized journal (given the size of the filesystem) 
188 stored within the filesystem.  Note that you must be using a kernel
189 which has ext3 support in order to actually make use of the journal.
190 .TP
191 .BR \-J " journal-options"
192 Override the default ext3 journal parameters. Journal options are comma
193 separated, and may take an argument using the equals ('=')  sign.
194 The following journal options are supported:
195 .RS 1.2i
196 .TP
197 .BI size= journal-size
198 Create a journal stored in the filesystem of size
199 .I journal-size
200 megabytes.   The size of the journal must be at least 1024 filesystem blocks
201 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
202 and may be no more than 102,400 filesystem blocks.
203 There must be enough free space in the filesystem to create a journal of
204 that size.
205 @JDEV@.TP
206 @JDEV@.BI device= external-journal
207 @JDEV@Attach the filesystem to the journal block device located on
208 @JDEV@.IR external-journal .
209 @JDEV@The external 
210 @JDEV@journal must have been already created using the command
211 @JDEV@.IP
212 @JDEV@.B mke2fs -O journal_dev 
213 @JDEV@.I external-journal
214 @JDEV@.IP
215 @JDEV@Note that
216 @JDEV@.I external-journal
217 @JDEV@must be formatted with the same block
218 @JDEV@size as filesystems which will be using it.
219 @JDEV@.IP
220 @JDEV@Instead of specifying a device name directly,
221 @JDEV@.I external-journal
222 @JDEV@can also be specified by either
223 @JDEV@.BI LABEL= label
224 @JDEV@or
225 @JDEV@.BI UUID= UUID
226 @JDEV@to locate the external journal by either the volume label or UUID
227 @JDEV@stored in the ext2 superblock at the start of the journal.  Use
228 @JDEV@.BR dumpe2fs (8)
229 @JDEV@to display a journal device's volume label and UUID.  See also the
230 @JDEV@.B -L
231 @JDEV@option of
232 @JDEV@.BR tune2fs (8).
233 .RE
234 @JDEV@.IP
235 @JDEV@Only one of the
236 @JDEV@.BR size " or " device
237 @JDEV@options can be given for a filesystem.
238 .TP
239 .B \-l
240 List the contents of the filesystem superblock.
241 .TP
242 .BI \-L " volume-label"
243 Set the volume label of the filesystem.  
244 Ext2 filesystem labels can be at most 16 characters long; if
245 .I volume-label 
246 is longer than 16 characters, 
247 .B tune2fs
248 will truncate it and print a warning.  The volume label can be used
249 by
250 .BR mount (8),
251 .BR fsck (8),
252 and
253 .BR /etc/fstab (5)
254 (and possibly others) by specifying
255 .BI LABEL= volume_label
256 instead of a block special device name like
257 .BR /dev/hda5 .
258 .TP
259 .BI \-m " reserved-blocks-percentage"
260 Set the percentage of reserved filesystem blocks.
261 .TP
262 .BI \-M " last-mounted-directory"
263 Set the last-mounted directory for the filesystem.
264 .TP
265 .BR \-o " [^]\fImount-option\fR[,...]"
266 Set or clear the indicated default mount options in the filesystem.
267 Default mount options can be overriden by mount options specified 
268 either in 
269 .BR /etc/fstab (5)
270 or on the command line arguments to
271 .BR mount (8).   
272 Older kernels may not support this feature; in particular,
273 kernels which predate 2.4.20 will almost certainly ignore the
274 default mount options field in the superblock.
275 .IP
276 More than one mount option can be cleared or set by separating
277 features with commas.  Mount options prefixed with a 
278 caret character ('^') will be cleared in the filesystem's superblock; 
279 mount options without a prefix character or prefixed with a plus 
280 character ('+') will be added to the filesystem.
281 .IP
282 The following mount options can be set or cleared using
283 .BR tune2fs :
284 .RS 1.2i
285 .TP
286 .B debug
287 Enable debugging code for this filesystem.
288 .TP
289 .B bsdgroups
290 Emulate BSD behaviour when creating new files: they will take the group-id
291 of the directory in which they were created.  The standard System V behaviour
292 is the default, where newly created files take on the fsgid of the current
293 process, unless the directry has the setgid bit set, in which case it takes 
294 the gid from the parent directory, and also gets the setgid bit set if it is 
295 directory itself.
296 .TP
297 .B user_xattr
298 Enable user-specified extended attributes.
299 .TP
300 .B acl
301 Enable Posix Access Control Lists.
302 .TP
303 .B uid16
304 Disables 32-bit UIDs and GIDs.  This is for interoperability with
305 older kernels which only store and expect 16-bit values.
306 .TP
307 .B journal_data
308 When the filesystem is mounted with journalling enabled, all data
309 (not just metadata) is committed into the journal prior to being written
310 into the main filesystem.
311 .TP
312 .B journal_data_ordered
313 When the filesystem is mounted with journalling enabled, all data is forced
314 directly out to the main file system prior to its metadata being commutted 
315 to the journal.
316 .TP
317 .B journal_data_writeback
318 When the filesystem is mounted with journalling enabled, data may be
319 written into the main filesystem after its metadata has been commutted
320 to the journal.  This may increase throughput, however, it may allow old
321 data to appear in files after a crash and journal recovery.
322 .RE
323 .TP
324 .BR \-O " [^]\fIfeature\fR[,...]"
325 Set or clear the indicated filesystem features (options) in the filesystem.
326 More than one filesystem feature can be cleared or set by separating
327 features with commas.  Filesystem features prefixed with a 
328 caret character ('^') will be cleared in the filesystem's superblock; 
329 filesystem features without a prefix character or prefixed with a plus 
330 character ('+') will be added to the filesystem.
331 .IP
332 The following filesystem features can be set or cleared using
333 .BR tune2fs :
334 .RS 1.2i
335 .TP
336 .B dir_index
337 Use hashed b-trees to speed up lookups in large directories.
338 .TP
339 .B filetype
340 Store file type information in directory entries.
341 .TP
342 .B has_journal
343 Use a journal to ensure filesystem consistency even across unclean shutdowns.
344 Setting the filesystem feature is equivalent to using the 
345 .B \-j
346 option.
347 .TP
348 .B sparse_super
349 Limit the number of backup superblocks to save space on large filesystems.
350 .RE
351 .IP
352 After setting or clearing 
353 .B sparse_super
354 and 
355 .B filetype 
356 filesystem features,
357 .BR e2fsck (8)
358 must be run on the filesystem to return the filesystem to a consistent state.
359 .B Tune2fs
360 will print a message requesting that the system administrator run
361 .BR e2fsck (8)
362 if necessary.
363 .IP
364 .B Warning:
365 Linux kernels before 2.0.39 and many 2.1 series kernels do not support
366 the filesystems that use any of these features.
367 Enabling certain filesystem features may prevent the filesystem from
368 being mounted by kernels which do not support those features.
369 .TP
370 .BI \-r " reserved-blocks-count"
371 Set the number of reserved filesystem blocks.
372 .TP
373 .BR \-s " [" 0 | 1 ]
374 Turn the sparse super feature off or on.  Turning this feature on
375 saves space on really big filesystems.  This is the same as using the
376 .B "\-O sparse_super"
377 option.
378 .IP
379 .B Warning:
380 Linux kernels before 2.0.39 do not support this feature.  Neither do
381 all Linux 2.1 kernels; please don't use this unless you know what you're
382 doing!  You need to run
383 .BR e2fsck (8)
384 on the filesystem after changing this feature in order to have a valid
385 filesystem.
386 .TP
387 .BI \-T " time-last-checked"
388 Set the time the filesystem was last checked using
389 .BR  e2fsck .
390 This can be useful in scripts which use a Logical Volume Manager to make
391 a consistent snapshot of a filesystem, and then check the filesystem 
392 during off hours to make sure it hasn't been corrupted due to 
393 hardware problems, etc.  If the filesystem was clean, then this option can 
394 be used to set the last checked time on the original filesystem.  The format 
395 of 
396 .I time-last-checked
397 is the international date format, with an optional time specifier, i.e.
398 YYYYMMDD[[HHMM]SS].   The keyword 
399 .B now
400 is also accepted, in which case the last checked time will be set to the 
401 current time.
402 .TP
403 .BI \-u " user"
404 Set the user who can use the reserved filesystem blocks.
405 .I user
406 can be a numerical uid or a user name.  If a user name is given, it 
407 is converted to a numerical uid before it is stored in the superblock.
408 .TP
409 .BI \-U " UUID"
410 Set the universally unique identifier (UUID) of the filesystem to
411 .IR UUID .
412 The format of the UUID is a series of hex digits separated by hyphens, 
413 like this: 
414 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  
415 The 
416 .I UUID
417 parameter may also be one of the following:
418 .RS 1.2i
419 .TP
420 .I clear
421 clear the filesystem UUID
422 .TP
423 .I random
424 generate a new randomly-generated UUID
425 .TP
426 .I time
427 generate a new time-based UUID
428 .RE
429 .IP
430 The UUID may be used by
431 .BR mount (8),
432 .BR fsck (8),
433 and
434 .BR /etc/fstab (5)
435 (and possibly others) by specifying
436 .BI UUID= uuid
437 instead of a block special device name like
438 .BR /dev/hda1 .
439 .IP
440 See
441 .BR uuidgen (8)
442 for more information.
443 If the system does not have a good random number generator such as
444 .I /dev/random
445 or
446 .IR /dev/urandom ,
447 .B tune2fs
448 will automatically use a time-based UUID instead of a randomly-generated UUID.
449 .SH BUGS
450 We haven't found any bugs yet.  That doesn't mean there aren't any...
451 .SH AUTHOR
452 .B tune2fs 
453 was written by Remy Card <Remy.Card@linux.org>.
454 .B tune2fs
455 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
456 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
457 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
458 .SH AVAILABILITY
459 .B tune2fs
460 is part of the e2fsprogs package and is available from 
461 http://e2fsprogs.sourceforge.net.
462 .SH SEE ALSO
463 .BR dumpe2fs (8),
464 .BR e2fsck (8),
465 .BR mke2fs (8)