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