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.
279 Force the tune2fs operation to complete even in the face of errors. This
280 option is useful when removing the
282 file system feature from a file system which has
283 an external journal (or is corrupted
284 such that it appears to have an external journal), but that
285 external journal is not available. If the file system appears to require
288 flag must be specified twice to proceed.
291 Removing an external journal from a file system which was not cleanly unmounted
292 without first replaying the external journal can result in
293 severe data loss and file system corruption.
296 Set the group which can use the reserved file system blocks.
299 parameter can be a numerical gid or a group name. If a group name is given,
300 it is converted to a numerical gid before it is stored in the superblock.
302 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
303 Adjust the maximal time between two file system checks.
306 will interpret the number
307 .I interval-between-checks
312 as weeks. A value of zero will disable the time-dependent checking.
314 There are pros and cons to disabling these periodic checks; see the
317 (mount-count-dependent check) option for details.
320 Change the inode size used by the file system. This requires rewriting
321 the inode table, so it requires that the file system is checked for
322 consistency first using
324 This operation can also take a while and the file system can be
325 corrupted and data lost if it is interrupted while in the middle of
326 converting the file system. Backing up the file system before changing
327 inode size is recommended.
329 File systems with an inode size of 128 bytes do not support timestamps
330 beyond January 19, 2038. Inodes which are 256 bytes or larger will
331 support extended timestamps, project id's, and the ability to store some
332 extended attributes in the inode table for improved performance.
335 Add an ext3 journal to the file system. If the
337 option is not specified, the default journal parameters will be used to create
338 an appropriately sized journal (given the size of the file system)
339 stored within the file system. Note that you must be using a kernel
340 which has ext3 support in order to actually make use of the journal.
342 If this option is used to create a journal on a mounted file system, an
345 will be created in the top-level directory of the file system, as it is
346 the only safe way to create the journal inode while the file system is
347 mounted. While the ext3 journal is visible, it is not safe to
348 delete it, or modify it while the file system is mounted; for this
349 reason the file is marked immutable.
350 While checking unmounted file systems,
352 will automatically move
354 files to the invisible, reserved journal inode. For all file systems
355 except for the root file system, this should happen automatically and
356 naturally during the next reboot cycle. Since the root file system is
359 must be run from a rescue floppy in order to effect this transition.
361 On some distributions, such as Debian, if an initial ramdisk is used,
362 the initrd scripts will automatically convert an ext2 root file system
365 file specifies the ext3 file system for the root file system in order to
366 avoid requiring the use of a rescue floppy to add an ext3 journal to
367 the root file system.
369 .BR \-J " journal-options"
370 Override the default ext3 journal parameters. Journal options are comma
371 separated, and may take an argument using the equals ('=') sign.
372 The following journal options are supported:
375 .BI size= journal-size
376 Create a journal stored in the file system of size
378 megabytes. The size of the journal must be at least 1024 file system blocks
379 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
380 and may be no more than 10,240,000 file system blocks.
381 There must be enough free space in the file system to create a journal of
384 .BI fast_commit_size= fast-commit-size
385 Create an additional fast commit journal area of size
388 This option is only valid if
391 on the file system. If this option is not specified and if
393 feature is turned on, fast commit area size defaults to
395 / 64 megabytes. The total size of the journal with
401 * 1024) megabytes. The total journal size may be no more than
402 10,240,000 file system blocks or half the total file system size
403 (whichever is smaller).
405 .BI location =journal-location
406 Specify the location of the journal. The argument
408 can either be specified as a block number, or if the number has a units
409 suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the
410 beginning of the file system.
412 @JDEV@.BI device= external-journal
413 @JDEV@Attach the file system to the journal block device located on
414 @JDEV@.IR external-journal .
416 @JDEV@journal must have been already created using the command
418 @JDEV@.B mke2fs -O journal_dev
419 @JDEV@.I external-journal
422 @JDEV@.I external-journal
423 @JDEV@must be formatted with the same block
424 @JDEV@size as file systems which will be using it.
425 @JDEV@In addition, while there is support for attaching
426 @JDEV@multiple file systems to a single external journal,
427 @JDEV@the Linux kernel and
429 @JDEV@do not currently support shared external journals yet.
431 @JDEV@Instead of specifying a device name directly,
432 @JDEV@.I external-journal
433 @JDEV@can also be specified by either
434 @JDEV@.BI LABEL= label
437 @JDEV@to locate the external journal by either the volume label or UUID
438 @JDEV@stored in the ext2 superblock at the start of the journal. Use
439 @JDEV@.BR dumpe2fs (8)
440 @JDEV@to display a journal device's volume label and UUID. See also the
443 @JDEV@.BR tune2fs (8).
446 @JDEV@Only one of the
447 @JDEV@.BR size " or " device
448 @JDEV@options can be given for a file system.
451 List the contents of the file system superblock, including the current
452 values of the parameters that can be set via this program.
454 .BI \-L " volume-label"
455 Set the volume label of the file system.
456 Ext2 file system labels can be at most 16 characters long; if
458 is longer than 16 characters,
460 will truncate it and print a warning. For other file systems that
461 support online label manipulation and are mounted
463 will work as well, but it will not attempt to truncate the
465 at all. The volume label can be used by
470 (and possibly others) by specifying
471 .BI LABEL= volume-label
472 instead of a block special device name like
475 .BI \-m " reserved-blocks-percentage"
476 Set the percentage of the file system which may only be allocated
477 by privileged processes. Reserving some number of file system blocks
478 for use by privileged processes is done
479 to avoid file system fragmentation, and to allow system
482 to continue to function correctly after non-privileged processes are
483 prevented from writing to the file system. Normally, the default percentage
484 of reserved blocks is 5%.
486 .BI \-M " last-mounted-directory"
487 Set the last-mounted directory for the file system.
489 .BR \-o " [^]\fImount-option\fR[,...]"
490 Set or clear the indicated default mount options in the file system.
491 Default mount options can be overridden by mount options specified
494 or on the command line arguments to
496 Older kernels may not support this feature; in particular,
497 kernels which predate 2.4.20 will almost certainly ignore the
498 default mount options field in the superblock.
500 More than one mount option can be cleared or set by separating
501 features with commas. Mount options prefixed with a
502 caret character ('^') will be cleared in the file system's superblock;
503 mount options without a prefix character or prefixed with a plus
504 character ('+') will be added to the file system.
506 The following mount options can be set or cleared using
511 Enable debugging code for this file system.
514 Emulate BSD behavior when creating new files: they will take the group-id
515 of the directory in which they were created. The standard System V behavior
516 is the default, where newly created files take on the fsgid of the current
517 process, unless the directory has the setgid bit set, in which case it takes
518 the gid from the parent directory, and also gets the setgid bit set if it is
522 Enable user-specified extended attributes.
525 Enable Posix Access Control Lists.
528 Disables 32-bit UIDs and GIDs. This is for interoperability with
529 older kernels which only store and expect 16-bit values.
532 When the file system is mounted with journaling enabled, all data
533 (not just metadata) is committed into the journal prior to being written
534 into the main file system.
536 .B journal_data_ordered
537 When the file system is mounted with journaling enabled, all data is forced
538 directly out to the main file system prior to its metadata being committed
541 .B journal_data_writeback
542 When the file system is mounted with journaling enabled, data may be
543 written into the main file system after its metadata has been committed
544 to the journal. This may increase throughput, however, it may allow old
545 data to appear in files after a crash and journal recovery.
548 The file system will be mounted with barrier operations in the journal
549 disabled. (This option is currently only supported by the ext4 file
550 system driver in 2.6.35+ kernels.)
553 The file system will be mounted with the block_validity option enabled,
554 which causes extra checks to be performed after reading or writing from
555 the file system. This prevents corrupted metadata blocks from causing
556 file system damage by overwriting parts of the inode table or block
557 group descriptors. This comes at the cost of increased memory and CPU
558 overhead, so it is enabled only for debugging purposes. (This option is
559 currently only supported by the ext4 file system driver in 2.6.35+
563 The file system will be mounted with the discard mount option. This will
564 cause the file system driver to attempt to use the trim/discard feature
565 of some storage devices (such as SSD's and thin-provisioned drives
566 available in some enterprise storage arrays) to inform the storage
567 device that blocks belonging to deleted files can be reused for other
568 purposes. (This option is currently only supported by the ext4 file
569 system driver in 2.6.35+ kernels.)
572 The file system will be mounted with the nodelalloc mount option. This
573 will disable the delayed allocation feature. (This option is currently
574 only supported by the ext4 file system driver in 2.6.35+ kernels.)
577 .BR \-O " [^]\fIfeature\fR[,...]"
578 Set or clear the indicated file system features (options) in the file system.
579 More than one file system feature can be cleared or set by separating
580 features with commas. File System features prefixed with a
581 caret character ('^') will be cleared in the file system's superblock;
582 file system features without a prefix character or prefixed with a plus
583 character ('+') will be added to the file system. For a detailed
584 description of the file system features, please see the man page
587 The following file system features can be set or cleared using
592 Enable the file system to be larger than 2^32 blocks.
595 Enable support for file system level casefolding.
596 The option can be cleared only if filesystem has no
602 Use hashed b-trees to speed up lookups for large directories.
605 Allow more than 65000 subdirectories per directory.
608 Allow the value of each extended attribute to be placed in the data blocks of a
609 separate inode if necessary, increasing the limit on the size and number of
610 extended attributes per file.
612 currently only supports setting this file system feature.
615 Enable support for file system level encryption.
617 currently only supports setting this file system feature.
620 Enable the use of extent trees to store the location of data blocks in inodes.
622 currently only supports setting this file system feature.
625 Enable the extended inode fields used by ext4.
628 Store file type information in directory entries.
631 Allow bitmaps and inode tables for a block group to be placed
632 anywhere on the storage media. \fBTune2fs\fR will not reorganize
633 the location of the inode tables and allocation bitmaps, as
635 will do when it creates a freshly formatted file system with
640 Use a journal to ensure file system consistency even across unclean shutdowns.
641 Setting the file system feature is equivalent to using the
647 Enable fast commit journaling feature to improve fsync latency.
650 Increase the limit on the number of files per directory.
652 currently only supports setting this file system feature.
655 Support files larger than 2 terabytes in size.
658 File System can contain files that are greater than 2GB.
661 Store a checksum to protect the contents in each metadata block.
663 .B metadata_csum_seed
664 Allow the file system to store the metadata checksum seed in the
665 superblock, enabling the administrator to change the UUID of a file system
668 feature while it is mounted.
671 Enable or disable multiple mount protection (MMP) feature.
674 Enable project ID tracking. This is used for project quota tracking.
677 Enable internal file system quota inodes.
680 Force the kernel to mount the file system read-only.
683 Reserve space so the block group descriptor table may grow in the
686 only supports clearing this file system feature.
689 Limit the number of backup superblocks to save space on large file systems.
691 currently only supports setting this file system feature.
694 Prevent the file system from being shrunk or having its UUID changed, in order to
695 allow the use of specialized encryption settings that make use of the inode
698 currently only supports setting this file system feature.
701 Allow the kernel to initialize bitmaps and inode tables lazily, and to
702 keep a high watermark for the unused inodes in a file system, to reduce
704 time. The first e2fsck run after enabling this feature will take the
705 full time, but subsequent e2fsck runs will take only a fraction of the
706 original time, depending on how full the file system is.
709 Enable support for verity protected files.
711 currently only supports setting this file system feature.
714 After setting or clearing
720 file system features,
721 the file system may require being checked using
723 to return the file system to a consistent state.
725 will print a message requesting that the system administrator run
727 if necessary. After setting the
731 can be run to convert existing directories to the hashed B-tree format.
732 Enabling certain file system features may prevent the file system from being
733 mounted by kernels which do not support those features. In particular, the
737 features are only supported by the ext4 file system.
739 .BI \-r " reserved-blocks-count"
740 Set the number of reserved file system blocks.
742 .BI \-Q " quota-options"
743 Sets 'quota' feature on the superblock and works on the quota files for the
744 given quota type. Quota options could be one or more of the following:
748 Sets/clears user quota inode in the superblock.
751 Sets/clears group quota inode in the superblock.
754 Sets/clears project quota inode in the superblock.
757 .BI \-T " time-last-checked"
758 Set the time the file system was last checked using
760 The time is interpreted using the current (local) timezone.
761 This can be useful in scripts which use a Logical Volume Manager to make
762 a consistent snapshot of a file system, and then check the file system
763 during off hours to make sure it hasn't been corrupted due to
764 hardware problems, etc. If the file system was clean, then this option can
765 be used to set the last checked time on the original file system. The format
768 is the international date format, with an optional time specifier, i.e.
769 YYYYMMDD[HH[MM[SS]]]. The keyword
771 is also accepted, in which case the last checked time will be set to the
775 Set the user who can use the reserved file system blocks.
777 can be a numerical uid or a user name. If a user name is given, it
778 is converted to a numerical uid before it is stored in the superblock.
781 Set the universally unique identifier (UUID) of the file system to
783 The format of the UUID is a series of hex digits separated by hyphens,
785 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
788 parameter may also be one of the following:
792 clear the file system UUID
795 generate a new randomly-generated UUID
798 generate a new time-based UUID
801 The UUID may be used by
806 (and possibly others) by specifying
808 instead of a block special device name like
813 for more information.
814 If the system does not have a good random number generator such as
819 will automatically use a time-based UUID instead of a randomly-generated UUID.
822 Before overwriting a file system block, write the old contents of the block to
823 an undo file. This undo file can be used with e2undo(8) to restore the old
824 contents of the file system should something go wrong. If the empty string is
825 passed as the undo_file argument, the undo file will be written to a file named
826 tune2fs-\fIdevice\fR.e2undo in the directory specified via the
827 \fIE2FSPROGS_UNDO_DIR\fR environment variable.
829 WARNING: The undo file cannot be used to recover from a power or system crash.
831 We haven't found any bugs yet. That doesn't mean there aren't any...
834 was written by Remy Card <Remy.Card@linux.org>. It is currently being
835 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
837 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
838 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
839 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
842 is part of the e2fsprogs package and is available from
843 http://e2fsprogs.sourceforge.net.