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 filesystem parameters on ext2/ext3/ext4 filesystems
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 filesystem
99 parameters on Linux ext2, ext3, or ext4 filesystems. 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 filesystem will be checked by
120 is 0 or \-1, the number of times the filesystem is mounted will be disregarded
125 Staggering the mount-counts at which filesystems are forcibly
126 checked will avoid all filesystems being checked at one time
127 when using journaled filesystems.
129 Mount-count-dependent checking is disabled by default to avoid
130 unanticipated long reboots while e2fsck does its work. However,
131 you may wish to consider the consequences of disabling
132 mount-count-dependent checking entirely. Bad disk drives, cables,
133 memory, and kernel bugs could all corrupt a filesystem without
134 marking the filesystem dirty or in error. If you are using
135 journaling on your filesystem, your filesystem will
137 be marked dirty, so it will not normally be checked. A
138 filesystem error detected by the kernel will still force
139 an fsck on the next reboot, but it may already be too late
140 to prevent data loss at that point.
144 option for time-dependent checking.
146 .BI \-C " mount-count"
147 Set the number of times the filesystem has been mounted.
148 If set to a greater value than the max-mount-counts parameter
153 will check the filesystem at the next reboot.
155 .BI \-e " error-behavior"
156 Change the behavior of the kernel code when errors are detected.
157 In all cases, a filesystem error will cause
159 to check the filesystem on the next boot.
161 can be one of the following:
165 Continue normal execution.
168 Remount filesystem read-only.
171 Cause a kernel panic.
174 .BI \-E " extended-options"
175 Set extended options for the filesystem. Extended options are comma
176 separated, and may take an argument using the equals ('=') sign.
177 The following extended options are supported:
181 Reset the MMP block (if any) back to the clean state. Use only if
182 absolutely certain the device is not currently mounted or being
183 fscked, or major filesystem corruption can result. Needs '-f'.
185 .BI mmp_update_interval= interval
186 Adjust the initial MMP update interval to
188 seconds. Specifying an
190 of 0 means to use the default interval. The specified interval must
191 be less than 300 seconds. Requires that the
195 .BI stride= stride-size
196 Configure the filesystem for a RAID array with
198 filesystem blocks. This is the number of blocks read or written to disk
199 before moving to next disk. This mostly affects placement of filesystem
200 metadata like bitmaps at
202 time to avoid placing them on a single disk, which can hurt the performance.
203 It may also be used by block allocator.
205 .BI stripe_width= stripe-width
206 Configure the filesystem for a RAID array with
208 filesystem blocks per stripe. This is typically be stride-size * N, where
209 N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
210 This allows the block allocator to prevent read-modify-write of the
211 parity in a RAID stripe if possible when the data is written.
213 .BI hash_alg= hash-alg
214 Set the default hash algorithm used for filesystems with hashed b-tree
215 directories. Valid algorithms accepted are:
221 .BI mount_opts= mount_option_string
222 Set a set of default mount options which will be used when the file
223 system is mounted. Unlike the bitmask-based default mount options which
224 can be specified with the
227 .I mount_option_string
228 is an arbitrary string with a maximum length of 63 bytes, which is
229 stored in the superblock.
231 The ext4 file system driver will first apply
232 the bitmask-based default options, and then parse the
233 .IR mount_option_string ,
234 before parsing the mount options passed from the
238 This superblock setting is only honored in 2.6.35+ kernels;
239 and not at all by the ext2 and ext3 file system drivers.
242 Set a flag in the filesystem superblock indicating that errors have been found.
243 This will force fsck to run at the next mount.
246 Set a flag in the filesystem superblock indicating that it may be
247 mounted using experimental kernel code, such as the ext4dev filesystem.
250 Clear the test_fs flag, indicating the filesystem should only be mounted
251 using production-level filesystem code.
255 Force the tune2fs operation to complete even in the face of errors. This
256 option is useful when removing the
258 filesystem feature from a filesystem which has
259 an external journal (or is corrupted
260 such that it appears to have an external journal), but that
261 external journal is not available. If the filesystem appears to require
264 flag must be specified twice to proceed.
267 Removing an external journal from a filesystem which was not cleanly unmounted
268 without first replaying the external journal can result in
269 severe data loss and filesystem corruption.
272 Set the group which can use the reserved filesystem blocks.
275 parameter can be a numerical gid or a group name. If a group name is given,
276 it is converted to a numerical gid before it is stored in the superblock.
278 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
279 Adjust the maximal time between two filesystem checks.
282 will interpret the number
283 .I interval-between-checks
288 as weeks. A value of zero will disable the time-dependent checking.
290 There are pros and cons to disabling these periodic checks; see the
293 (mount-count-dependent check) option for details.
296 Change the inode size used by the file system. This requires rewriting
297 the inode table, so it requires that the file system is checked for
298 consistency first using
300 This operation can also take a while and the file system can be
301 corrupted and data lost if it is interrupted while in the middle of
302 converting the file system. Backing up the file system before changing
303 inode size is recommended.
305 File systems with an inode size of 128 bytes do not support timestamps
306 beyond January 19, 2038. Inodes which are 256 bytes or larger will
307 support extended timestamps, project id's, and the ability to store some
308 extended attributes in the inode table for improved performance.
311 Add an ext3 journal to the filesystem. If the
313 option is not specified, the default journal parameters will be used to create
314 an appropriately sized journal (given the size of the filesystem)
315 stored within the filesystem. Note that you must be using a kernel
316 which has ext3 support in order to actually make use of the journal.
318 If this option is used to create a journal on a mounted filesystem, an
321 will be created in the top-level directory of the filesystem, as it is
322 the only safe way to create the journal inode while the filesystem is
323 mounted. While the ext3 journal is visible, it is not safe to
324 delete it, or modify it while the filesystem is mounted; for this
325 reason the file is marked immutable.
326 While checking unmounted filesystems,
328 will automatically move
330 files to the invisible, reserved journal inode. For all filesystems
331 except for the root filesystem, this should happen automatically and
332 naturally during the next reboot cycle. Since the root filesystem is
335 must be run from a rescue floppy in order to effect this transition.
337 On some distributions, such as Debian, if an initial ramdisk is used,
338 the initrd scripts will automatically convert an ext2 root filesystem
341 file specifies the ext3 filesystem for the root filesystem in order to
342 avoid requiring the use of a rescue floppy to add an ext3 journal to
345 .BR \-J " journal-options"
346 Override the default ext3 journal parameters. Journal options are comma
347 separated, and may take an argument using the equals ('=') sign.
348 The following journal options are supported:
351 .BI size= journal-size
352 Create a journal stored in the filesystem of size
354 megabytes. The size of the journal must be at least 1024 filesystem blocks
355 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
356 and may be no more than 10,240,000 filesystem blocks.
357 There must be enough free space in the filesystem to create a journal of
360 .BI fast_commit_size= fast-commit-size
361 Create an additional fast commit journal area of size
364 This option is only valid if
367 on the file system. If this option is not specified and if
369 feature is turned on, fast commit area size defaults to
371 / 64 megabytes. The total size of the journal with
377 * 1024) megabytes. The total journal size may be no more than
378 10,240,000 filesystem blocks or half the total file system size
379 (whichever is smaller).
381 .BI location =journal-location
382 Specify the location of the journal. The argument
384 can either be specified as a block number, or if the number has a units
385 suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the
386 beginning of the file system.
388 @JDEV@.BI device= external-journal
389 @JDEV@Attach the filesystem to the journal block device located on
390 @JDEV@.IR external-journal .
392 @JDEV@journal must have been already created using the command
394 @JDEV@.B mke2fs -O journal_dev
395 @JDEV@.I external-journal
398 @JDEV@.I external-journal
399 @JDEV@must be formatted with the same block
400 @JDEV@size as filesystems which will be using it.
401 @JDEV@In addition, while there is support for attaching
402 @JDEV@multiple filesystems to a single external journal,
403 @JDEV@the Linux kernel and
405 @JDEV@do not currently support shared external journals yet.
407 @JDEV@Instead of specifying a device name directly,
408 @JDEV@.I external-journal
409 @JDEV@can also be specified by either
410 @JDEV@.BI LABEL= label
413 @JDEV@to locate the external journal by either the volume label or UUID
414 @JDEV@stored in the ext2 superblock at the start of the journal. Use
415 @JDEV@.BR dumpe2fs (8)
416 @JDEV@to display a journal device's volume label and UUID. See also the
419 @JDEV@.BR tune2fs (8).
422 @JDEV@Only one of the
423 @JDEV@.BR size " or " device
424 @JDEV@options can be given for a filesystem.
427 List the contents of the filesystem superblock, including the current
428 values of the parameters that can be set via this program.
430 .BI \-L " volume-label"
431 Set the volume label of the filesystem.
432 Ext2 filesystem labels can be at most 16 characters long; if
434 is longer than 16 characters,
436 will truncate it and print a warning. The volume label can be used
442 (and possibly others) by specifying
443 .BI LABEL= volume-label
444 instead of a block special device name like
447 .BI \-m " reserved-blocks-percentage"
448 Set the percentage of the filesystem which may only be allocated
449 by privileged processes. Reserving some number of filesystem blocks
450 for use by privileged processes is done
451 to avoid filesystem fragmentation, and to allow system
454 to continue to function correctly after non-privileged processes are
455 prevented from writing to the filesystem. Normally, the default percentage
456 of reserved blocks is 5%.
458 .BI \-M " last-mounted-directory"
459 Set the last-mounted directory for the filesystem.
461 .BR \-o " [^]\fImount-option\fR[,...]"
462 Set or clear the indicated default mount options in the filesystem.
463 Default mount options can be overridden by mount options specified
466 or on the command line arguments to
468 Older kernels may not support this feature; in particular,
469 kernels which predate 2.4.20 will almost certainly ignore the
470 default mount options field in the superblock.
472 More than one mount option can be cleared or set by separating
473 features with commas. Mount options prefixed with a
474 caret character ('^') will be cleared in the filesystem's superblock;
475 mount options without a prefix character or prefixed with a plus
476 character ('+') will be added to the filesystem.
478 The following mount options can be set or cleared using
483 Enable debugging code for this filesystem.
486 Emulate BSD behavior when creating new files: they will take the group-id
487 of the directory in which they were created. The standard System V behavior
488 is the default, where newly created files take on the fsgid of the current
489 process, unless the directory has the setgid bit set, in which case it takes
490 the gid from the parent directory, and also gets the setgid bit set if it is
494 Enable user-specified extended attributes.
497 Enable Posix Access Control Lists.
500 Disables 32-bit UIDs and GIDs. This is for interoperability with
501 older kernels which only store and expect 16-bit values.
504 When the filesystem is mounted with journalling enabled, all data
505 (not just metadata) is committed into the journal prior to being written
506 into the main filesystem.
508 .B journal_data_ordered
509 When the filesystem is mounted with journalling enabled, all data is forced
510 directly out to the main file system prior to its metadata being committed
513 .B journal_data_writeback
514 When the filesystem is mounted with journalling enabled, data may be
515 written into the main filesystem after its metadata has been committed
516 to the journal. This may increase throughput, however, it may allow old
517 data to appear in files after a crash and journal recovery.
520 The file system will be mounted with barrier operations in the journal
521 disabled. (This option is currently only supported by the ext4 file
522 system driver in 2.6.35+ kernels.)
525 The file system will be mounted with the block_validity option enabled,
526 which causes extra checks to be performed after reading or writing from
527 the file system. This prevents corrupted metadata blocks from causing
528 file system damage by overwriting parts of the inode table or block
529 group descriptors. This comes at the cost of increased memory and CPU
530 overhead, so it is enabled only for debugging purposes. (This option is
531 currently only supported by the ext4 file system driver in 2.6.35+
535 The file system will be mounted with the discard mount option. This will
536 cause the file system driver to attempt to use the trim/discard feature
537 of some storage devices (such as SSD's and thin-provisioned drives
538 available in some enterprise storage arrays) to inform the storage
539 device that blocks belonging to deleted files can be reused for other
540 purposes. (This option is currently only supported by the ext4 file
541 system driver in 2.6.35+ kernels.)
544 The file system will be mounted with the nodelalloc mount option. This
545 will disable the delayed allocation feature. (This option is currently
546 only supported by the ext4 file system driver in 2.6.35+ kernels.)
549 .BR \-O " [^]\fIfeature\fR[,...]"
550 Set or clear the indicated filesystem features (options) in the filesystem.
551 More than one filesystem feature can be cleared or set by separating
552 features with commas. Filesystem features prefixed with a
553 caret character ('^') will be cleared in the filesystem's superblock;
554 filesystem features without a prefix character or prefixed with a plus
555 character ('+') will be added to the filesystem. For a detailed
556 description of the file system features, please see the man page
559 The following filesystem features can be set or cleared using
564 Enable the file system to be larger than 2^32 blocks.
567 Use hashed b-trees to speed up lookups for large directories.
570 Allow more than 65000 subdirectories per directory.
573 Allow the value of each extended attribute to be placed in the data blocks of a
574 separate inode if necessary, increasing the limit on the size and number of
575 extended attributes per file.
577 currently only supports setting this filesystem feature.
580 Enable support for file system level encryption.
582 currently only supports setting this filesystem feature.
585 Enable the use of extent trees to store the location of data blocks in inodes.
587 currently only supports setting this filesystem feature.
590 Enable the extended inode fields used by ext4.
593 Store file type information in directory entries.
596 Allow bitmaps and inode tables for a block group to be placed
597 anywhere on the storage media. \fBTune2fs\fR will not reorganize
598 the location of the inode tables and allocation bitmaps, as
600 will do when it creates a freshly formatted file system with
605 Use a journal to ensure filesystem consistency even across unclean shutdowns.
606 Setting the filesystem feature is equivalent to using the
612 Enable fast commit journaling feature to improve fsync latency.
615 Increase the limit on the number of files per directory.
617 currently only supports setting this filesystem feature.
620 Support files larger than 2 terabytes in size.
623 Filesystem can contain files that are greater than 2GB.
626 Store a checksum to protect the contents in each metadata block.
628 .B metadata_csum_seed
629 Allow the filesystem to store the metadata checksum seed in the
630 superblock, enabling the administrator to change the UUID of a filesystem
633 feature while it is mounted.
636 Enable or disable multiple mount protection (MMP) feature.
639 Enable project ID tracking. This is used for project quota tracking.
642 Enable internal file system quota inodes.
645 Force the kernel to mount the file system read-only.
648 Reserve space so the block group descriptor table may grow in the
651 only supports clearing this filesystem feature.
654 Limit the number of backup superblocks to save space on large filesystems.
656 currently only supports setting this filesystem feature.
659 Prevent the filesystem from being shrunk or having its UUID changed, in order to
660 allow the use of specialized encryption settings that make use of the inode
663 currently only supports setting this filesystem feature.
666 Allow the kernel to initialize bitmaps and inode tables lazily, and to
667 keep a high watermark for the unused inodes in a filesystem, to reduce
669 time. The first e2fsck run after enabling this feature will take the
670 full time, but subsequent e2fsck runs will take only a fraction of the
671 original time, depending on how full the file system is.
674 Enable support for verity protected files.
676 currently only supports setting this filesystem feature.
679 After setting or clearing
686 the file system may require being checked using
688 to return the filesystem to a consistent state.
690 will print a message requesting that the system administrator run
692 if necessary. After setting the
696 can be run to convert existing directories to the hashed B-tree format.
697 Enabling certain filesystem features may prevent the filesystem from being
698 mounted by kernels which do not support those features. In particular, the
702 features are only supported by the ext4 filesystem.
704 .BI \-r " reserved-blocks-count"
705 Set the number of reserved filesystem blocks.
707 .BI \-Q " quota-options"
708 Sets 'quota' feature on the superblock and works on the quota files for the
709 given quota type. Quota options could be one or more of the following:
713 Sets/clears user quota inode in the superblock.
716 Sets/clears group quota inode in the superblock.
719 Sets/clears project quota inode in the superblock.
722 .BI \-T " time-last-checked"
723 Set the time the filesystem was last checked using
725 The time is interpreted using the current (local) timezone.
726 This can be useful in scripts which use a Logical Volume Manager to make
727 a consistent snapshot of a filesystem, and then check the filesystem
728 during off hours to make sure it hasn't been corrupted due to
729 hardware problems, etc. If the filesystem was clean, then this option can
730 be used to set the last checked time on the original filesystem. The format
733 is the international date format, with an optional time specifier, i.e.
734 YYYYMMDD[HH[MM[SS]]]. The keyword
736 is also accepted, in which case the last checked time will be set to the
740 Set the user who can use the reserved filesystem blocks.
742 can be a numerical uid or a user name. If a user name is given, it
743 is converted to a numerical uid before it is stored in the superblock.
746 Set the universally unique identifier (UUID) of the filesystem to
748 The format of the UUID is a series of hex digits separated by hyphens,
750 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
753 parameter may also be one of the following:
757 clear the filesystem UUID
760 generate a new randomly-generated UUID
763 generate a new time-based UUID
766 The UUID may be used by
771 (and possibly others) by specifying
773 instead of a block special device name like
778 for more information.
779 If the system does not have a good random number generator such as
784 will automatically use a time-based UUID instead of a randomly-generated UUID.
787 Before overwriting a file system block, write the old contents of the block to
788 an undo file. This undo file can be used with e2undo(8) to restore the old
789 contents of the file system should something go wrong. If the empty string is
790 passed as the undo_file argument, the undo file will be written to a file named
791 tune2fs-\fIdevice\fR.e2undo in the directory specified via the
792 \fIE2FSPROGS_UNDO_DIR\fR environment variable.
794 WARNING: The undo file cannot be used to recover from a power or system crash.
796 We haven't found any bugs yet. That doesn't mean there aren't any...
799 was written by Remy Card <Remy.Card@linux.org>. It is currently being
800 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
802 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
803 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
804 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
807 is part of the e2fsprogs package and is available from
808 http://e2fsprogs.sourceforge.net.