Whamcloud - gitweb
Add ext4 man page and update and clean up the other man pages
[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/ext4 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 \-Q
81 .I quota-options
82 ]
83 [
84 .B \-T
85 .I time-last-checked
86 ]
87 [
88 .B \-U
89 .I UUID
90 ]
91 device
92 .SH DESCRIPTION
93 .BI tune2fs
94 allows the system administrator to adjust various tunable filesystem 
95 parameters on Linux ext2, ext3, or ext4 filesystems.  The current values 
96 of these options can be displayed by using the
97 .B -l
98 option to
99 .BR tune2fs (8)
100 program, or by using the
101 .BR dumpe2fs (8)
102 program.
103 .PP
104 The
105 .I device
106 specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
107 specifier: "\fBLABEL=\fIvolume-name\fR" or "\fBUUID=\fIuuid\fR".  (i.e.,
108 LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
109 .SH OPTIONS
110 .TP
111 .BI \-c " max-mount-counts"
112 Adjust the number of mounts after which the filesystem will be checked by 
113 .BR e2fsck (8).  
114 If
115 .I max-mount-counts
116 is 0 or \-1, the number of times the filesystem is mounted will be disregarded 
117 by
118 .BR e2fsck (8)
119 and the kernel.
120 .sp
121 Staggering the mount-counts at which filesystems are forcibly
122 checked will avoid all filesystems being checked at one time
123 when using journaled filesystems.
124 .sp
125 You should strongly consider the consequences of disabling
126 mount-count-dependent checking entirely.  Bad disk drives, cables,
127 memory, and kernel bugs could all corrupt a filesystem without
128 marking the filesystem dirty or in error.  If you are using
129 journaling on your filesystem, your filesystem will
130 .B never
131 be marked dirty, so it will not normally be checked.  A
132 filesystem error detected by the kernel will still force
133 an fsck on the next reboot, but it may already be too late
134 to prevent data loss at that point.
135 .sp
136 See also the
137 .B \-i
138 option for time-dependent checking.
139 .TP
140 .BI \-C " mount-count"
141 Set the number of times the filesystem has been mounted.
142 If set to a greater value than the max-mount-counts parameter
143 set by the 
144 .B \-c
145 option,
146 .BR e2fsck (8) 
147 will check the filesystem at the next reboot.
148 .TP
149 .BI \-e " error-behavior"
150 Change the behavior of the kernel code when errors are detected.
151 In all cases, a filesystem error will cause
152 .BR e2fsck (8)
153 to check the filesystem on the next boot.
154 .I error-behavior
155 can be one of the following:
156 .RS 1.2i
157 .TP 1.2i
158 .B continue
159 Continue normal execution.
160 .TP
161 .B remount-ro
162 Remount filesystem read-only.
163 .TP
164 .B panic
165 Cause a kernel panic.
166 .RE
167 .TP
168 .BI \-E " extended-options"
169 Set extended options for the filesystem.  Extended options are comma
170 separated, and may take an argument using the equals ('=') sign.
171 The following extended options are supported:
172 .RS 1.2i
173 .TP
174 .B clear_mmp
175 Reset the MMP block (if any) back to the clean state.  Use only if
176 absolutely certain the device is not currently mounted or being
177 fscked, or major filesystem corruption can result.  Needs '-f'.
178 .TP
179 .BI mmp_update_interval= interval
180 Adjust the initial MMP update interval to
181 .I interval
182 seconds.  Specifying an
183 .I interval
184 of 0 means to use the default interval.  The specified interval must
185 be less than 300 seconds.  Requires that the
186 .B mmp
187 feature be enabled.
188 .TP
189 .BI stride= stride-size
190 Configure the filesystem for a RAID array with
191 .I stride-size
192 filesystem blocks. This is the number of blocks read or written to disk
193 before moving to next disk. This mostly affects placement of filesystem
194 metadata like bitmaps at
195 .BR mke2fs (2)
196 time to avoid placing them on a single disk, which can hurt the performance.
197 It may also be used by block allocator.
198 .TP
199 .BI stripe_width= stripe-width
200 Configure the filesystem for a RAID array with
201 .I stripe-width
202 filesystem blocks per stripe. This is typically be stride-size * N, where
203 N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
204 This allows the block allocator to prevent read-modify-write of the
205 parity in a RAID stripe if possible when the data is written.
206 .TP
207 .BI hash_alg= hash-alg
208 Set the default hash algorithm used for filesystems with hashed b-tree
209 directories.  Valid algorithms accepted are:
210 .IR legacy ,
211 .IR half_md4 ,
212 and
213 .IR tea .
214 .TP
215 .BI mount_opts= mount_option_string
216 Set a set of default mount options which will be used when the file
217 system is mounted.  Unlike the bitmask-based default mount options which
218 can be specified with the
219 .B -o
220 option,
221 .I mount_option_string
222 is an arbitrary string with a maximum length of 63 bytes, which is
223 stored in the superblock.
224 .IP
225 The ext4 file system driver will first apply
226 the bitmask-based default options, and then parse the
227 .IR mount_option_string ,
228 before parsing the mount options passed from the
229 .BR mount (8)
230 program.
231 .IP
232 This superblock setting is only honored in 2.6.35+ kernels;
233 and not at all by the ext2 and ext3 file system drivers.
234 .TP
235 .B test_fs
236 Set a flag in the filesystem superblock indicating that it may be
237 mounted using experimental kernel code, such as the ext4dev filesystem.
238 .TP
239 .B ^test_fs
240 Clear the test_fs flag, indicating the filesystem should only be mounted
241 using production-level filesystem code.
242 .RE
243 .TP
244 .B \-f
245 Force the tune2fs operation to complete even in the face of errors.  This 
246 option is useful when removing the 
247 .B has_journal
248 filesystem feature from a filesystem which has 
249 an external journal (or is corrupted
250 such that it appears to have an external journal), but that 
251 external journal is not available.   
252 .sp
253 .B WARNING:
254 Removing an external journal from a filesystem which was not cleanly unmounted
255 without first replaying the external journal can result in
256 severe data loss and filesystem corruption.
257 .TP
258 .BI \-g " group"
259 Set the group which can use the reserved filesystem blocks.
260 The 
261 .I group
262 parameter can be a numerical gid or a group name.  If a group name is given,
263 it is converted to a numerical gid before it is stored in the superblock.
264 .TP
265 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
266 Adjust the maximal time between two filesystem checks. 
267 No suffix or
268 .B d
269 will interpret the number
270 .I interval-between-checks
271 as days,
272 .B m
273 as months, and
274 .B w
275 as weeks.  A value of zero will disable the time-dependent checking.
276 .sp
277 It is strongly recommended that either
278 .B \-c
279 (mount-count-dependent) or
280 .B \-i
281 (time-dependent) checking be enabled to force periodic full
282 .BR e2fsck (8)
283 checking of the filesystem.  Failure to do so may lead to filesystem
284 corruption (due to bad disks, cables, memory, or kernel bugs) going
285 unnoticed, ultimately resulting in data loss or corruption.
286 .TP
287 .B \-j
288 Add an ext3 journal to the filesystem.  If the 
289 .B \-J
290 option is not specified, the default journal parameters will be used to create
291 an appropriately sized journal (given the size of the filesystem) 
292 stored within the filesystem.  Note that you must be using a kernel
293 which has ext3 support in order to actually make use of the journal.
294 .IP
295 If this option is used to create a journal on a mounted filesystem, an
296 immutable file,
297 .BR .journal ,
298 will be created in the top-level directory of the filesystem, as it is
299 the only safe way to create the journal inode while the filesystem is
300 mounted.  While the ext3 journal is visible, it is not safe to
301 delete it, or modify it while the filesystem is mounted; for this
302 reason the file is marked immutable.
303 While checking unmounted filesystems, 
304 .BR e2fsck (8)
305 will automatically move 
306 .B .journal
307 files to the invisible, reserved journal inode.  For all filesystems
308 except for the root filesystem,  this should happen automatically and
309 naturally during the next reboot cycle.  Since the root filesystem is
310 mounted read-only,
311 .BR e2fsck (8)
312 must be run from a rescue floppy in order to effect this transition.
313 .IP
314 On some distributions, such as Debian, if an initial ramdisk is used,
315 the initrd scripts will automatically convert an ext2 root filesystem
316 to ext3 if the  
317 .BR /etc/fstab
318 file specifies the ext3 filesystem for the root filesystem in order to
319 avoid requiring the use of a rescue floppy to add an ext3 journal to
320 the root filesystem.
321 .TP
322 .BR \-J " journal-options"
323 Override the default ext3 journal parameters. Journal options are comma
324 separated, and may take an argument using the equals ('=')  sign.
325 The following journal options are supported:
326 .RS 1.2i
327 .TP
328 .BI size= journal-size
329 Create a journal stored in the filesystem of size
330 .I journal-size
331 megabytes.   The size of the journal must be at least 1024 filesystem blocks
332 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
333 and may be no more than 102,400 filesystem blocks.
334 There must be enough free space in the filesystem to create a journal of
335 that size.
336 @JDEV@.TP
337 @JDEV@.BI device= external-journal
338 @JDEV@Attach the filesystem to the journal block device located on
339 @JDEV@.IR external-journal .
340 @JDEV@The external 
341 @JDEV@journal must have been already created using the command
342 @JDEV@.IP
343 @JDEV@.B mke2fs -O journal_dev 
344 @JDEV@.I external-journal
345 @JDEV@.IP
346 @JDEV@Note that
347 @JDEV@.I external-journal
348 @JDEV@must be formatted with the same block
349 @JDEV@size as filesystems which will be using it.
350 @JDEV@In addition, while there is support for attaching
351 @JDEV@multiple filesystems to a single external journal,
352 @JDEV@the Linux kernel and 
353 @JDEV@.BR e2fsck (8)
354 @JDEV@do not currently support shared external journals yet.
355 @JDEV@.IP
356 @JDEV@Instead of specifying a device name directly,
357 @JDEV@.I external-journal
358 @JDEV@can also be specified by either
359 @JDEV@.BI LABEL= label
360 @JDEV@or
361 @JDEV@.BI UUID= UUID
362 @JDEV@to locate the external journal by either the volume label or UUID
363 @JDEV@stored in the ext2 superblock at the start of the journal.  Use
364 @JDEV@.BR dumpe2fs (8)
365 @JDEV@to display a journal device's volume label and UUID.  See also the
366 @JDEV@.B -L
367 @JDEV@option of
368 @JDEV@.BR tune2fs (8).
369 .RE
370 @JDEV@.IP
371 @JDEV@Only one of the
372 @JDEV@.BR size " or " device
373 @JDEV@options can be given for a filesystem.
374 .TP
375 .B \-l
376 List the contents of the filesystem superblock, including the current
377 values of the parameters that can be set via this program.
378 .TP
379 .BI \-L " volume-label"
380 Set the volume label of the filesystem.  
381 Ext2 filesystem labels can be at most 16 characters long; if
382 .I volume-label 
383 is longer than 16 characters, 
384 .B tune2fs
385 will truncate it and print a warning.  The volume label can be used
386 by
387 .BR mount (8),
388 .BR fsck (8),
389 and
390 .BR /etc/fstab (5)
391 (and possibly others) by specifying
392 .BI LABEL= volume_label
393 instead of a block special device name like
394 .BR /dev/hda5 .
395 .TP
396 .BI \-m " reserved-blocks-percentage"
397 Set the percentage of the filesystem which may only be allocated
398 by privileged processes.   Reserving some number of filesystem blocks 
399 for use by privileged processes is done 
400 to avoid filesystem fragmentation, and to allow system
401 daemons, such as 
402 .BR syslogd (8),
403 to continue to function correctly after non-privileged processes are 
404 prevented from writing to the filesystem.  Normally, the default percentage 
405 of reserved blocks is 5%.
406 .TP
407 .BI \-M " last-mounted-directory"
408 Set the last-mounted directory for the filesystem.
409 .TP
410 .BR \-o " [^]\fImount-option\fR[,...]"
411 Set or clear the indicated default mount options in the filesystem.
412 Default mount options can be overridden by mount options specified 
413 either in 
414 .BR /etc/fstab (5)
415 or on the command line arguments to
416 .BR mount (8).   
417 Older kernels may not support this feature; in particular,
418 kernels which predate 2.4.20 will almost certainly ignore the
419 default mount options field in the superblock.
420 .IP
421 More than one mount option can be cleared or set by separating
422 features with commas.  Mount options prefixed with a 
423 caret character ('^') will be cleared in the filesystem's superblock; 
424 mount options without a prefix character or prefixed with a plus 
425 character ('+') will be added to the filesystem.
426 .IP
427 The following mount options can be set or cleared using
428 .BR tune2fs :
429 .RS 1.2i
430 .TP
431 .B debug
432 Enable debugging code for this filesystem.
433 .TP
434 .B bsdgroups
435 Emulate BSD behavior when creating new files: they will take the group-id
436 of the directory in which they were created.  The standard System V behavior
437 is the default, where newly created files take on the fsgid of the current
438 process, unless the directory has the setgid bit set, in which case it takes 
439 the gid from the parent directory, and also gets the setgid bit set if it is 
440 a directory itself.
441 .TP
442 .B user_xattr
443 Enable user-specified extended attributes.
444 .TP
445 .B acl
446 Enable Posix Access Control Lists.
447 .TP
448 .B uid16
449 Disables 32-bit UIDs and GIDs.  This is for interoperability with
450 older kernels which only store and expect 16-bit values.
451 .TP
452 .B journal_data
453 When the filesystem is mounted with journalling enabled, all data
454 (not just metadata) is committed into the journal prior to being written
455 into the main filesystem.
456 .TP
457 .B journal_data_ordered
458 When the filesystem is mounted with journalling enabled, all data is forced
459 directly out to the main file system prior to its metadata being committed 
460 to the journal.
461 .TP
462 .B journal_data_writeback
463 When the filesystem is mounted with journalling enabled, data may be
464 written into the main filesystem after its metadata has been committed
465 to the journal.  This may increase throughput, however, it may allow old
466 data to appear in files after a crash and journal recovery.
467 .TP
468 .B nobarrier
469 The file system will be mounted with barrier operations in the journal
470 disabled.  (This option is currently only supported by the ext4 file
471 system driver in 2.6.35+ kernels.)
472 .TP
473 .B block_validity
474 The file system will be mounted with the block_validity option enabled,
475 which causes extra checks to be performed after reading or writing from
476 the file system.  This prevents corrupted metadata blocks from causing
477 file system damage by overwriting parts of the inode table or block
478 group descriptors.  This comes at the cost of increased memory and CPU
479 overhead, so it is enabled only for debugging purposes.  (This option is
480 currently only supported by the ext4 file system driver in 2.6.35+
481 kernels.)
482 .TP
483 .B discard
484 The file system will be mounted with the discard mount option.  This will
485 cause the file system driver to attempt to use the trim/discard feature
486 of some storage devices (such as SSD's and thin-provisioned drives
487 available in some enterprise storage arrays) to inform the storage
488 device that blocks belonging to deleted files can be reused for other
489 purposes.  (This option is currently only supported by the ext4 file
490 system driver in 2.6.35+ kernels.)
491 .TP
492 .B nodelalloc
493 The file system will be mounted with the nodelalloc mount option.  This
494 will disable the delayed allocation feature.  (This option is currently
495 only supported by the ext4 file system driver in 2.6.35+ kernels.)
496 .RE
497 .TP
498 .BR \-O " [^]\fIfeature\fR[,...]"
499 Set or clear the indicated filesystem features (options) in the filesystem.
500 More than one filesystem feature can be cleared or set by separating
501 features with commas.  Filesystem features prefixed with a 
502 caret character ('^') will be cleared in the filesystem's superblock; 
503 filesystem features without a prefix character or prefixed with a plus 
504 character ('+') will be added to the filesystem.  For a detailed
505 description of the file system features, please see the man page
506 .BR ext4 (5).
507 .IP
508 The following filesystem features can be set or cleared using
509 .BR tune2fs :
510 .RS 1.2i
511 .TP
512 .B dir_index
513 Use hashed b-trees to speed up lookups for large directories.
514 .TP
515 .B dir_nlink
516 Allow more than 65000 subdirectories per directory.
517 .TP
518 .B extent
519 Enable the use of extent trees to store the location of data blocks in inodes.
520 .TP
521 .B extra_isize
522 Enable the extended inode fields used by ext4.
523 .TP
524 .B filetype
525 Store file type information in directory entries.
526 .TP
527 .B flex_bg
528 Allow bitmaps and inode tables for a block group to be placed
529 anywhere on the storage media.  \fBTune2fs\fR will not reorganize
530 the location of the inode tables and allocation bitmaps, as
531 .BR mke2fs (8)
532 will do when it creates a freshly formatted file system with
533 .B flex_bg
534 enabled.
535 .TP
536 .B has_journal
537 Use a journal to ensure filesystem consistency even across unclean shutdowns.
538 Setting the filesystem feature is equivalent to using the 
539 .B \-j
540 option.
541 .TP
542 .B huge_file
543 Support files larger than 2 terabytes in size.
544 .TP
545 .B large_file
546 Filesystem can contain files that are greater than 2GB.
547 .TP
548 .B resize_inode
549 Reserve space so the block group descriptor table may grow in the
550 future.
551 .B Tune2fs 
552 only supports clearing this filesystem feature.
553 .TP
554 .B mmp
555 Enable or disable multiple mount protection (MMP) feature.
556 @QUOTA_MAN_COMMENT@.TP
557 @QUOTA_MAN_COMMENT@.B quota
558 @QUOTA_MAN_COMMENT@Enable internal file system quota inodes.
559 .TP
560 .B sparse_super
561 Limit the number of backup superblocks to save space on large filesystems.
562 .TP
563 .B uninit_bg
564 Allow the kernel to initialize bitmaps and inode tables lazily, and to
565 keep a high watermark for the unused inodes in a filesystem, to reduce
566 .BR e2fsck (8)
567 time.  This first e2fsck run after enabling this feature will take the
568 full time, but subsequent e2fsck runs will take only a fraction of the
569 original time, depending on how full the file system is.
570 .RE
571 .IP
572 After setting or clearing 
573 .BR sparse_super ,
574 .BR uninit_bg ,
575 .BR filetype ,
576 or
577 .B resize_inode
578 filesystem features,
579 .BR e2fsck (8)
580 must be run on the filesystem to return the filesystem to a consistent state.
581 .B Tune2fs
582 will print a message requesting that the system administrator run
583 .BR e2fsck (8)
584 if necessary.  After setting the 
585 .B dir_index
586 feature, 
587 .B e2fsck -D
588 can be run to convert existing directories to the hashed B-tree format.
589 Enabling certain filesystem features may prevent the filesystem from being
590 mounted by kernels which do not support those features.  In particular, the
591 .BR uninit_bg
592 and
593 .BR flex_bg
594 features are only supported by the ext4 filesystem.
595 .TP
596 .BI \-p " mmp_check_interval"
597 Set the desired MMP check interval in seconds. It is 5 seconds by default.
598 .TP
599 .BI \-r " reserved-blocks-count"
600 Set the number of reserved filesystem blocks.
601 .TP
602 .BI \-Q " quota-options"
603 Sets 'quota' feature on the superblock and works on the quota files for the
604 given quota type. Quota options could be one or more of the following:
605 .RS 1.2i
606 .TP
607 .BR [^]usrquota
608 Sets/clears user quota inode in the superblock.
609 .TP
610 .BR [^]grpquota
611 Sets/clears group quota inode in the superblock.
612 .RE
613 .TP
614 .BI \-T " time-last-checked"
615 Set the time the filesystem was last checked using
616 .BR  e2fsck .
617 The time is interpreted using the current (local) timezone.
618 This can be useful in scripts which use a Logical Volume Manager to make
619 a consistent snapshot of a filesystem, and then check the filesystem 
620 during off hours to make sure it hasn't been corrupted due to 
621 hardware problems, etc.  If the filesystem was clean, then this option can 
622 be used to set the last checked time on the original filesystem.  The format 
623 of 
624 .I time-last-checked
625 is the international date format, with an optional time specifier, i.e.
626 YYYYMMDD[HH[MM[SS]]].   The keyword 
627 .B now
628 is also accepted, in which case the last checked time will be set to the 
629 current time.
630 .TP
631 .BI \-u " user"
632 Set the user who can use the reserved filesystem blocks.
633 .I user
634 can be a numerical uid or a user name.  If a user name is given, it 
635 is converted to a numerical uid before it is stored in the superblock.
636 .TP
637 .BI \-U " UUID"
638 Set the universally unique identifier (UUID) of the filesystem to
639 .IR UUID .
640 The format of the UUID is a series of hex digits separated by hyphens, 
641 like this: 
642 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  
643 The 
644 .I UUID
645 parameter may also be one of the following:
646 .RS 1.2i
647 .TP
648 .I clear
649 clear the filesystem UUID
650 .TP
651 .I random
652 generate a new randomly-generated UUID
653 .TP
654 .I time
655 generate a new time-based UUID
656 .RE
657 .IP
658 The UUID may be used by
659 .BR mount (8),
660 .BR fsck (8),
661 and
662 .BR /etc/fstab (5)
663 (and possibly others) by specifying
664 .BI UUID= uuid
665 instead of a block special device name like
666 .BR /dev/hda1 .
667 .IP
668 See
669 .BR uuidgen (8)
670 for more information.
671 If the system does not have a good random number generator such as
672 .I /dev/random
673 or
674 .IR /dev/urandom ,
675 .B tune2fs
676 will automatically use a time-based UUID instead of a randomly-generated UUID.
677 .SH BUGS
678 We haven't found any bugs yet.  That doesn't mean there aren't any...
679 .SH AUTHOR
680 .B tune2fs 
681 was written by Remy Card <Remy.Card@linux.org>.  It is currently being
682 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
683 .B tune2fs
684 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
685 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
686 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
687 .SH AVAILABILITY
688 .B tune2fs
689 is part of the e2fsprogs package and is available from 
690 http://e2fsprogs.sourceforge.net.
691 .SH SEE ALSO
692 .BR debugfs (8),
693 .BR dumpe2fs (8),
694 .BR e2fsck (8),
695 .BR mke2fs (8),
696 .BR ext4 (5)