1 .\" Revision 1.0 93/06/3 23:00 chk
5 .TH TUNE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
7 tune2fs \- adjust tunable file system parameters on ext2/ext3/ext4 file systems
26 .I interval-between-checks
41 .I reserved-blocks-percentage
45 .RI [^]mount-options [,...]
49 .I reserved-blocks-count
73 .I last-mounted-directory
77 .RI [^] feature [,...]
98 allows the system administrator to adjust various tunable file system
99 parameters on Linux ext2, ext3, or ext4 file systems. The current values
100 of these options can be displayed by using the
104 program, or by using the
110 specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
111 specifier: "\fBLABEL=\fIvolume-label\fR" or "\fBUUID=\fIuuid\fR". (i.e.,
112 LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
115 .BI \-c " max-mount-counts"
116 Adjust the number of mounts after which the file system will be checked by
120 is the string "random", tune2fs will use a random value between 20 and 40.
123 is 0 or \-1, the number of times the file system is mounted will be disregarded
128 Staggering the mount-counts at which file systems are forcibly
129 checked will avoid all file systems being checked at one time
130 when using journaled file systems.
132 Mount-count-dependent checking is disabled by default to avoid
133 unanticipated long reboots while e2fsck does its work. If you
134 are concerned about file system corruptions caused by potential hardware
135 problems of kernel bugs, a better solution than mount-count-dependent
136 checking is to use the
138 program. This does require placing the file system on an LVM volume,
141 .BI \-C " mount-count"
142 Set the number of times the file system has been mounted.
143 If set to a greater value than the max-mount-counts parameter
148 will check the file system at the next reboot.
150 .BI \-e " error-behavior"
151 Change the behavior of the kernel code when errors are detected.
152 In all cases, a file system error will cause
154 to check the file system on the next boot.
156 can be one of the following:
160 Continue normal execution.
163 Remount file system read-only.
166 Cause a kernel panic.
169 .BI \-E " extended-options"
170 Set extended options for the file system. Extended options are comma
171 separated, and may take an argument using the equals ('=') sign.
172 The following extended options are supported:
176 Reset the MMP block (if any) back to the clean state. Use only if
177 absolutely certain the device is not currently mounted or being
178 fscked, or major file system corruption can result. Needs '-f'.
180 .BI mmp_update_interval= interval
181 Adjust the initial MMP update interval to
183 seconds. Specifying an
185 of 0 means to use the default interval. The specified interval must
186 be less than 300 seconds. Requires that the
190 .BI stride= stride-size
191 Configure the file system for a RAID array with
193 file system blocks. This is the number of blocks read or written to disk
194 before moving to next disk. This mostly affects placement of file system
195 metadata like bitmaps at
197 time to avoid placing them on a single disk, which can hurt the performance.
198 It may also be used by block allocator.
200 .BI stripe_width= stripe-width
201 Configure the file system for a RAID array with
203 file system blocks per stripe. This is typically be stride-size * N, where
204 N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
205 This allows the block allocator to prevent read-modify-write of the
206 parity in a RAID stripe if possible when the data is written.
208 .BI hash_alg= hash-alg
209 Set the default hash algorithm used for file systems with hashed b-tree
210 directories. Valid algorithms accepted are:
216 .BI encoding= encoding-name
219 feature in the super block and set
221 as the encoding to be used. If
223 is not specified, utf8 is used. The encoding cannot be altered if casefold
224 was previously enabled.
226 .BI encoding_flags= encoding-flags
227 Define parameters for file name character encoding operations. If a
228 flag is not changed using this parameter, its default value is used.
230 should be a comma-separated lists of flags to be enabled. The flags cannot be
231 altered if casefold was previously enabled.
233 The only flag that can be set right now is
235 which means that invalid strings should be rejected by the file system.
236 In the default configuration, the
240 .BI mount_opts= mount_option_string
241 Set a set of default mount options which will be used when the file
242 system is mounted. Unlike the bitmask-based default mount options which
243 can be specified with the
246 .I mount_option_string
247 is an arbitrary string with a maximum length of 63 bytes, which is
248 stored in the superblock.
250 The ext4 file system driver will first apply
251 the bitmask-based default options, and then parse the
252 .IR mount_option_string ,
253 before parsing the mount options passed from the
257 This superblock setting is only honored in 2.6.35+ kernels;
258 and not at all by the ext2 and ext3 file system drivers.
260 .BI orphan_file_size= size
261 Set size of the file for tracking unlinked but still open inodes and inodes
262 with truncate in progress. Larger file allows for better scalability, reserving
263 a few blocks per cpu is ideal.
266 Set a flag in the file system superblock indicating that errors have been found.
267 This will force fsck to run at the next mount.
270 Set a flag in the file system superblock indicating that it may be
271 mounted using experimental kernel code, such as the ext4dev file system.
274 Clear the test_fs flag, indicating the file system should only be mounted
275 using production-level file system code.
278 Set a flag in the file system superblock to make fstrim save the trim status
279 in each block group and skip the block groups already been trimmed.
282 Clear the track_trim flag to make fstrim ignore the trim status saved in
283 each block group, and trim every block group.
287 Force the tune2fs operation to complete even in the face of errors. This
288 option is useful when removing the
290 file system feature from a file system which has
291 an external journal (or is corrupted
292 such that it appears to have an external journal), but that
293 external journal is not available. If the file system appears to require
296 flag must be specified twice to proceed.
299 Removing an external journal from a file system which was not cleanly unmounted
300 without first replaying the external journal can result in
301 severe data loss and file system corruption.
304 Set the group which can use the reserved file system blocks.
307 parameter can be a numerical gid or a group name. If a group name is given,
308 it is converted to a numerical gid before it is stored in the superblock.
310 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
311 Adjust the maximal time between two file system checks.
314 will interpret the number
315 .I interval-between-checks
320 as weeks. A value of zero will disable the time-dependent checking.
322 There are pros and cons to disabling these periodic checks; see the
325 (mount-count-dependent check) option for details.
328 Change the inode size used by the file system. This requires rewriting
329 the inode table, so it requires that the file system is checked for
330 consistency first using
332 This operation can also take a while and the file system can be
333 corrupted and data lost if it is interrupted while in the middle of
334 converting the file system. Backing up the file system before changing
335 inode size is recommended.
337 File systems with an inode size of 128 bytes do not support timestamps
338 beyond January 19, 2038. Inodes which are 256 bytes or larger will
339 support extended timestamps, project id's, and the ability to store some
340 extended attributes in the inode table for improved performance.
343 Add an ext3 journal to the file system. If the
345 option is not specified, the default journal parameters will be used to create
346 an appropriately sized journal (given the size of the file system)
347 stored within the file system. Note that you must be using a kernel
348 which has ext3 support in order to actually make use of the journal.
350 If this option is used to create a journal on a mounted file system, an
353 will be created in the top-level directory of the file system, as it is
354 the only safe way to create the journal inode while the file system is
355 mounted. While the ext3 journal is visible, it is not safe to
356 delete it, or modify it while the file system is mounted; for this
357 reason the file is marked immutable.
358 While checking unmounted file systems,
360 will automatically move
362 files to the invisible, reserved journal inode. For all file systems
363 except for the root file system, this should happen automatically and
364 naturally during the next reboot cycle. Since the root file system is
367 must be run from a rescue floppy in order to effect this transition.
369 On some distributions, such as Debian, if an initial ramdisk is used,
370 the initrd scripts will automatically convert an ext2 root file system
373 file specifies the ext3 file system for the root file system in order to
374 avoid requiring the use of a rescue floppy to add an ext3 journal to
375 the root file system.
377 .BR \-J " journal-options"
378 Override the default ext3 journal parameters. Journal options are comma
379 separated, and may take an argument using the equals ('=') sign.
380 The following journal options are supported:
383 .BI size= journal-size
384 Create a journal stored in the file system of size
386 megabytes. The size of the journal must be at least 1024 file system blocks
387 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
388 and may be no more than 10,240,000 file system blocks.
389 There must be enough free space in the file system to create a journal of
392 .BI fast_commit_size= fast-commit-size
393 Create an additional fast commit journal area of size
396 This option is only valid if
399 on the file system. If this option is not specified and if
401 feature is turned on, fast commit area size defaults to
403 / 64 megabytes. The total size of the journal with
409 * 1024) megabytes. The total journal size may be no more than
410 10,240,000 file system blocks or half the total file system size
411 (whichever is smaller).
413 .BI location =journal-location
414 Specify the location of the journal. The argument
416 can either be specified as a block number, or if the number has a units
417 suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the
418 beginning of the file system.
420 @JDEV@.BI device= external-journal
421 @JDEV@Attach the file system to the journal block device located on
422 @JDEV@.IR external-journal .
424 @JDEV@journal must have been already created using the command
426 @JDEV@.B mke2fs -O journal_dev
427 @JDEV@.I external-journal
430 @JDEV@.I external-journal
431 @JDEV@must be formatted with the same block
432 @JDEV@size as file systems which will be using it.
433 @JDEV@In addition, while there is support for attaching
434 @JDEV@multiple file systems to a single external journal,
435 @JDEV@the Linux kernel and
437 @JDEV@do not currently support shared external journals yet.
439 @JDEV@Instead of specifying a device name directly,
440 @JDEV@.I external-journal
441 @JDEV@can also be specified by either
442 @JDEV@.BI LABEL= label
445 @JDEV@to locate the external journal by either the volume label or UUID
446 @JDEV@stored in the ext2 superblock at the start of the journal. Use
447 @JDEV@.BR dumpe2fs (8)
448 @JDEV@to display a journal device's volume label and UUID. See also the
451 @JDEV@.BR tune2fs (8).
454 @JDEV@Only one of the
455 @JDEV@.BR size " or " device
456 @JDEV@options can be given for a file system.
459 List the contents of the file system superblock, including the current
460 values of the parameters that can be set via this program.
462 .BI \-L " volume-label"
463 Set the volume label of the file system.
464 Ext2 file system labels can be at most 16 characters long; if
466 is longer than 16 characters,
468 will truncate it and print a warning. For other file systems that
469 support online label manipulation and are mounted
471 will work as well, but it will not attempt to truncate the
473 at all. The volume label can be used by
478 (and possibly others) by specifying
479 .BI LABEL= volume-label
480 instead of a block special device name like
483 .BI \-m " reserved-blocks-percentage"
484 Set the percentage of the file system which may only be allocated
485 by privileged processes. Reserving some number of file system blocks
486 for use by privileged processes is done
487 to avoid file system fragmentation, and to allow system
490 to continue to function correctly after non-privileged processes are
491 prevented from writing to the file system. Normally, the default percentage
492 of reserved blocks is 5%.
494 .BI \-M " last-mounted-directory"
495 Set the last-mounted directory for the file system.
497 .BR \-o " [^]\fImount-option\fR[,...]"
498 Set or clear the indicated default mount options in the file system.
499 Default mount options can be overridden by mount options specified
502 or on the command line arguments to
504 Older kernels may not support this feature; in particular,
505 kernels which predate 2.4.20 will almost certainly ignore the
506 default mount options field in the superblock.
508 More than one mount option can be cleared or set by separating
509 features with commas. Mount options prefixed with a
510 caret character ('^') will be cleared in the file system's superblock;
511 mount options without a prefix character or prefixed with a plus
512 character ('+') will be added to the file system.
514 The following mount options can be set or cleared using
519 Enable debugging code for this file system.
522 Emulate BSD behavior when creating new files: they will take the group-id
523 of the directory in which they were created. The standard System V behavior
524 is the default, where newly created files take on the fsgid of the current
525 process, unless the directory has the setgid bit set, in which case it takes
526 the gid from the parent directory, and also gets the setgid bit set if it is
530 Enable user-specified extended attributes.
533 Enable Posix Access Control Lists.
536 Disables 32-bit UIDs and GIDs. This is for interoperability with
537 older kernels which only store and expect 16-bit values.
540 When the file system is mounted with journaling enabled, all data
541 (not just metadata) is committed into the journal prior to being written
542 into the main file system.
544 .B journal_data_ordered
545 When the file system is mounted with journaling enabled, all data is forced
546 directly out to the main file system prior to its metadata being committed
549 .B journal_data_writeback
550 When the file system is mounted with journaling enabled, data may be
551 written into the main file system after its metadata has been committed
552 to the journal. This may increase throughput, however, it may allow old
553 data to appear in files after a crash and journal recovery.
556 The file system will be mounted with barrier operations in the journal
557 disabled. (This option is currently only supported by the ext4 file
558 system driver in 2.6.35+ kernels.)
561 The file system will be mounted with the block_validity option enabled,
562 which causes extra checks to be performed after reading or writing from
563 the file system. This prevents corrupted metadata blocks from causing
564 file system damage by overwriting parts of the inode table or block
565 group descriptors. This comes at the cost of increased memory and CPU
566 overhead, so it is enabled only for debugging purposes. (This option is
567 currently only supported by the ext4 file system driver in 2.6.35+
571 The file system will be mounted with the discard mount option. This will
572 cause the file system driver to attempt to use the trim/discard feature
573 of some storage devices (such as SSD's and thin-provisioned drives
574 available in some enterprise storage arrays) to inform the storage
575 device that blocks belonging to deleted files can be reused for other
576 purposes. (This option is currently only supported by the ext4 file
577 system driver in 2.6.35+ kernels.)
580 The file system will be mounted with the nodelalloc mount option. This
581 will disable the delayed allocation feature. (This option is currently
582 only supported by the ext4 file system driver in 2.6.35+ kernels.)
585 .BR \-O " [^]\fIfeature\fR[,...]"
586 Set or clear the indicated file system features (options) in the file system.
587 More than one file system feature can be cleared or set by separating
588 features with commas. File System features prefixed with a
589 caret character ('^') will be cleared in the file system's superblock;
590 file system features without a prefix character or prefixed with a plus
591 character ('+') will be added to the file system. For a detailed
592 description of the file system features, please see the man page
595 The following file system features can be set or cleared using
600 Enable the file system to be larger than 2^32 blocks.
603 Enable support for file system level casefolding.
604 The option can be cleared only if filesystem has no
610 Use hashed b-trees to speed up lookups for large directories.
613 Allow more than 65000 subdirectories per directory.
616 Allow the value of each extended attribute to be placed in the data blocks of a
617 separate inode if necessary, increasing the limit on the size and number of
618 extended attributes per file.
620 currently only supports setting this file system feature.
623 Enable support for file system level encryption.
625 currently only supports setting this file system feature.
628 Enable the use of extent trees to store the location of data blocks in inodes.
630 currently only supports setting this file system feature.
633 Enable the extended inode fields used by ext4.
636 Store file type information in directory entries.
639 Allow bitmaps and inode tables for a block group to be placed
640 anywhere on the storage media. \fBTune2fs\fR will not reorganize
641 the location of the inode tables and allocation bitmaps, as
643 will do when it creates a freshly formatted file system with
648 Use a journal to ensure file system consistency even across unclean shutdowns.
649 Setting the file system feature is equivalent to using the
655 Enable fast commit journaling feature to improve fsync latency.
658 Increase the limit on the number of files per directory.
660 currently only supports setting this file system feature.
663 Support files larger than 2 terabytes in size.
666 File System can contain files that are greater than 2GB.
669 Store a checksum to protect the contents in each metadata block.
671 .B metadata_csum_seed
672 Allow the file system to store the metadata checksum seed in the
673 superblock, enabling the administrator to change the UUID of a file system
676 feature while it is mounted.
679 Enable or disable multiple mount protection (MMP) feature.
682 Enable project ID tracking. This is used for project quota tracking.
685 Enable internal file system quota inodes.
688 Force the kernel to mount the file system read-only.
691 Reserve space so the block group descriptor table may grow in the
694 only supports clearing this file system feature.
697 Limit the number of backup superblocks to save space on large file systems.
699 currently only supports setting this file system feature.
702 Prevent the file system from being shrunk or having its UUID changed, in order to
703 allow the use of specialized encryption settings that make use of the inode
706 currently only supports setting this file system feature.
709 Allow the kernel to initialize bitmaps and inode tables lazily, and to
710 keep a high watermark for the unused inodes in a file system, to reduce
712 time. The first e2fsck run after enabling this feature will take the
713 full time, but subsequent e2fsck runs will take only a fraction of the
714 original time, depending on how full the file system is.
717 Enable support for verity protected files.
719 currently only supports setting this file system feature.
722 After setting or clearing
728 file system features,
729 the file system may require being checked using
731 to return the file system to a consistent state.
733 will print a message requesting that the system administrator run
735 if necessary. After setting the
739 can be run to convert existing directories to the hashed B-tree format.
740 Enabling certain file system features may prevent the file system from being
741 mounted by kernels which do not support those features. In particular, the
745 features are only supported by the ext4 file system.
747 .BI \-r " reserved-blocks-count"
748 Set the number of reserved file system blocks.
750 .BI \-Q " quota-options"
751 Sets 'quota' feature on the superblock and works on the quota files for the
752 given quota type. Quota options could be one or more of the following:
756 Sets/clears user quota inode in the superblock.
759 Sets/clears group quota inode in the superblock.
762 Sets/clears project quota inode in the superblock.
765 .BI \-T " time-last-checked"
766 Set the time the file system was last checked using
768 The time is interpreted using the current (local) timezone.
769 This can be useful in scripts which use a Logical Volume Manager to make
770 a consistent snapshot of a file system, and then check the file system
771 during off hours to make sure it hasn't been corrupted due to
772 hardware problems, etc. If the file system was clean, then this option can
773 be used to set the last checked time on the original file system. The format
776 is the international date format, with an optional time specifier, i.e.
777 YYYYMMDD[HH[MM[SS]]]. The keyword
779 is also accepted, in which case the last checked time will be set to the
783 Set the user who can use the reserved file system blocks.
785 can be a numerical uid or a user name. If a user name is given, it
786 is converted to a numerical uid before it is stored in the superblock.
789 Set the universally unique identifier (UUID) of the file system to
791 The format of the UUID is a series of hex digits separated by hyphens,
793 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
796 parameter may also be one of the following:
800 clear the file system UUID
803 generate a new randomly-generated UUID
806 generate a new time-based UUID
809 The UUID may be used by
814 (and possibly others) by specifying
816 instead of a block special device name like
821 for more information.
822 If the system does not have a good random number generator such as
827 will automatically use a time-based UUID instead of a randomly-generated UUID.
830 Before overwriting a file system block, write the old contents of the block to
831 an undo file. This undo file can be used with e2undo(8) to restore the old
832 contents of the file system should something go wrong. If the empty string is
833 passed as the undo_file argument, the undo file will be written to a file named
834 tune2fs-\fIdevice\fR.e2undo in the directory specified via the
835 \fIE2FSPROGS_UNDO_DIR\fR environment variable.
837 WARNING: The undo file cannot be used to recover from a power or system crash.
839 We haven't found any bugs yet. That doesn't mean there aren't any...
842 was written by Remy Card <Remy.Card@linux.org>. It is currently being
843 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
845 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
846 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
847 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
850 is part of the e2fsprogs package and is available from
851 http://e2fsprogs.sourceforge.net.