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
37 .I reserved-blocks-percentage
41 .RI [^]mount-options [,...]
45 .I reserved-blocks-count
73 .I last-mounted-directory
77 .RI [^] feature [,...]
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
100 program, or by using the
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).
111 .BI \-c " max-mount-counts"
112 Adjust the number of mounts after which the filesystem will be checked by
116 is 0 or \-1, the number of times the filesystem is mounted will be disregarded
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.
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
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.
138 option for time-dependent checking.
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
147 will check the filesystem at the next reboot.
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
153 to check the filesystem on the next boot.
155 can be one of the following:
159 Continue normal execution.
162 Remount filesystem read-only.
165 Cause a kernel panic.
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:
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'.
179 .BI mmp_update_interval= interval
180 Adjust the initial MMP update interval to
182 seconds. Specifying an
184 of 0 means to use the default interval. The specified interval must
185 be less than 300 seconds. Requires that the
189 .BI stride= stride-size
190 Configure the filesystem for a RAID array with
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
196 time to avoid placing them on a single disk, which can hurt the performance.
197 It may also be used by block allocator.
199 .BI stripe_width= stripe-width
200 Configure the filesystem for a RAID array with
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.
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:
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
221 .I mount_option_string
222 is an arbitrary string with a maximum length of 63 bytes, which is
223 stored in the superblock.
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
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.
236 Set a flag in the filesystem superblock indicating that it may be
237 mounted using experimental kernel code, such as the ext4dev filesystem.
240 Clear the test_fs flag, indicating the filesystem should only be mounted
241 using production-level filesystem code.
245 Force the tune2fs operation to complete even in the face of errors. This
246 option is useful when removing the
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. If the filesystem appears to require
254 flag must be specified twice to proceed.
257 Removing an external journal from a filesystem which was not cleanly unmounted
258 without first replaying the external journal can result in
259 severe data loss and filesystem corruption.
262 Set the group which can use the reserved filesystem blocks.
265 parameter can be a numerical gid or a group name. If a group name is given,
266 it is converted to a numerical gid before it is stored in the superblock.
268 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
269 Adjust the maximal time between two filesystem checks.
272 will interpret the number
273 .I interval-between-checks
278 as weeks. A value of zero will disable the time-dependent checking.
280 It is strongly recommended that either
282 (mount-count-dependent) or
284 (time-dependent) checking be enabled to force periodic full
286 checking of the filesystem. Failure to do so may lead to filesystem
287 corruption (due to bad disks, cables, memory, or kernel bugs) going
288 unnoticed, ultimately resulting in data loss or corruption.
291 Add an ext3 journal to the filesystem. If the
293 option is not specified, the default journal parameters will be used to create
294 an appropriately sized journal (given the size of the filesystem)
295 stored within the filesystem. Note that you must be using a kernel
296 which has ext3 support in order to actually make use of the journal.
298 If this option is used to create a journal on a mounted filesystem, an
301 will be created in the top-level directory of the filesystem, as it is
302 the only safe way to create the journal inode while the filesystem is
303 mounted. While the ext3 journal is visible, it is not safe to
304 delete it, or modify it while the filesystem is mounted; for this
305 reason the file is marked immutable.
306 While checking unmounted filesystems,
308 will automatically move
310 files to the invisible, reserved journal inode. For all filesystems
311 except for the root filesystem, this should happen automatically and
312 naturally during the next reboot cycle. Since the root filesystem is
315 must be run from a rescue floppy in order to effect this transition.
317 On some distributions, such as Debian, if an initial ramdisk is used,
318 the initrd scripts will automatically convert an ext2 root filesystem
321 file specifies the ext3 filesystem for the root filesystem in order to
322 avoid requiring the use of a rescue floppy to add an ext3 journal to
325 .BR \-J " journal-options"
326 Override the default ext3 journal parameters. Journal options are comma
327 separated, and may take an argument using the equals ('=') sign.
328 The following journal options are supported:
331 .BI size= journal-size
332 Create a journal stored in the filesystem of size
334 megabytes. The size of the journal must be at least 1024 filesystem blocks
335 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
336 and may be no more than 102,400 filesystem blocks.
337 There must be enough free space in the filesystem to create a journal of
340 .BI location =journal-location
341 Specify the location of the journal. The argument
343 can either be specified as a block number, or if the number has a units
344 suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the
345 beginning of the file system.
347 @JDEV@.BI device= external-journal
348 @JDEV@Attach the filesystem to the journal block device located on
349 @JDEV@.IR external-journal .
351 @JDEV@journal must have been already created using the command
353 @JDEV@.B mke2fs -O journal_dev
354 @JDEV@.I external-journal
357 @JDEV@.I external-journal
358 @JDEV@must be formatted with the same block
359 @JDEV@size as filesystems which will be using it.
360 @JDEV@In addition, while there is support for attaching
361 @JDEV@multiple filesystems to a single external journal,
362 @JDEV@the Linux kernel and
364 @JDEV@do not currently support shared external journals yet.
366 @JDEV@Instead of specifying a device name directly,
367 @JDEV@.I external-journal
368 @JDEV@can also be specified by either
369 @JDEV@.BI LABEL= label
372 @JDEV@to locate the external journal by either the volume label or UUID
373 @JDEV@stored in the ext2 superblock at the start of the journal. Use
374 @JDEV@.BR dumpe2fs (8)
375 @JDEV@to display a journal device's volume label and UUID. See also the
378 @JDEV@.BR tune2fs (8).
381 @JDEV@Only one of the
382 @JDEV@.BR size " or " device
383 @JDEV@options can be given for a filesystem.
386 List the contents of the filesystem superblock, including the current
387 values of the parameters that can be set via this program.
389 .BI \-L " volume-label"
390 Set the volume label of the filesystem.
391 Ext2 filesystem labels can be at most 16 characters long; if
393 is longer than 16 characters,
395 will truncate it and print a warning. The volume label can be used
401 (and possibly others) by specifying
402 .BI LABEL= volume_label
403 instead of a block special device name like
406 .BI \-m " reserved-blocks-percentage"
407 Set the percentage of the filesystem which may only be allocated
408 by privileged processes. Reserving some number of filesystem blocks
409 for use by privileged processes is done
410 to avoid filesystem fragmentation, and to allow system
413 to continue to function correctly after non-privileged processes are
414 prevented from writing to the filesystem. Normally, the default percentage
415 of reserved blocks is 5%.
417 .BI \-M " last-mounted-directory"
418 Set the last-mounted directory for the filesystem.
420 .BR \-o " [^]\fImount-option\fR[,...]"
421 Set or clear the indicated default mount options in the filesystem.
422 Default mount options can be overridden by mount options specified
425 or on the command line arguments to
427 Older kernels may not support this feature; in particular,
428 kernels which predate 2.4.20 will almost certainly ignore the
429 default mount options field in the superblock.
431 More than one mount option can be cleared or set by separating
432 features with commas. Mount options prefixed with a
433 caret character ('^') will be cleared in the filesystem's superblock;
434 mount options without a prefix character or prefixed with a plus
435 character ('+') will be added to the filesystem.
437 The following mount options can be set or cleared using
442 Enable debugging code for this filesystem.
445 Emulate BSD behavior when creating new files: they will take the group-id
446 of the directory in which they were created. The standard System V behavior
447 is the default, where newly created files take on the fsgid of the current
448 process, unless the directory has the setgid bit set, in which case it takes
449 the gid from the parent directory, and also gets the setgid bit set if it is
453 Enable user-specified extended attributes.
456 Enable Posix Access Control Lists.
459 Disables 32-bit UIDs and GIDs. This is for interoperability with
460 older kernels which only store and expect 16-bit values.
463 When the filesystem is mounted with journalling enabled, all data
464 (not just metadata) is committed into the journal prior to being written
465 into the main filesystem.
467 .B journal_data_ordered
468 When the filesystem is mounted with journalling enabled, all data is forced
469 directly out to the main file system prior to its metadata being committed
472 .B journal_data_writeback
473 When the filesystem is mounted with journalling enabled, data may be
474 written into the main filesystem after its metadata has been committed
475 to the journal. This may increase throughput, however, it may allow old
476 data to appear in files after a crash and journal recovery.
479 The file system will be mounted with barrier operations in the journal
480 disabled. (This option is currently only supported by the ext4 file
481 system driver in 2.6.35+ kernels.)
484 The file system will be mounted with the block_validity option enabled,
485 which causes extra checks to be performed after reading or writing from
486 the file system. This prevents corrupted metadata blocks from causing
487 file system damage by overwriting parts of the inode table or block
488 group descriptors. This comes at the cost of increased memory and CPU
489 overhead, so it is enabled only for debugging purposes. (This option is
490 currently only supported by the ext4 file system driver in 2.6.35+
494 The file system will be mounted with the discard mount option. This will
495 cause the file system driver to attempt to use the trim/discard feature
496 of some storage devices (such as SSD's and thin-provisioned drives
497 available in some enterprise storage arrays) to inform the storage
498 device that blocks belonging to deleted files can be reused for other
499 purposes. (This option is currently only supported by the ext4 file
500 system driver in 2.6.35+ kernels.)
503 The file system will be mounted with the nodelalloc mount option. This
504 will disable the delayed allocation feature. (This option is currently
505 only supported by the ext4 file system driver in 2.6.35+ kernels.)
508 .BR \-O " [^]\fIfeature\fR[,...]"
509 Set or clear the indicated filesystem features (options) in the filesystem.
510 More than one filesystem feature can be cleared or set by separating
511 features with commas. Filesystem features prefixed with a
512 caret character ('^') will be cleared in the filesystem's superblock;
513 filesystem features without a prefix character or prefixed with a plus
514 character ('+') will be added to the filesystem. For a detailed
515 description of the file system features, please see the man page
518 The following filesystem features can be set or cleared using
523 Use hashed b-trees to speed up lookups for large directories.
526 Allow more than 65000 subdirectories per directory.
529 Enable the use of extent trees to store the location of data blocks in inodes.
532 Enable the extended inode fields used by ext4.
535 Store file type information in directory entries.
538 Allow bitmaps and inode tables for a block group to be placed
539 anywhere on the storage media. \fBTune2fs\fR will not reorganize
540 the location of the inode tables and allocation bitmaps, as
542 will do when it creates a freshly formatted file system with
547 Use a journal to ensure filesystem consistency even across unclean shutdowns.
548 Setting the filesystem feature is equivalent to using the
553 Support files larger than 2 terabytes in size.
556 Filesystem can contain files that are greater than 2GB.
559 Reserve space so the block group descriptor table may grow in the
562 only supports clearing this filesystem feature.
565 Enable or disable multiple mount protection (MMP) feature.
566 @QUOTA_MAN_COMMENT@.TP
567 @QUOTA_MAN_COMMENT@.B quota
568 @QUOTA_MAN_COMMENT@Enable internal file system quota inodes.
571 Limit the number of backup superblocks to save space on large filesystems.
574 Allow the kernel to initialize bitmaps and inode tables lazily, and to
575 keep a high watermark for the unused inodes in a filesystem, to reduce
577 time. This first e2fsck run after enabling this feature will take the
578 full time, but subsequent e2fsck runs will take only a fraction of the
579 original time, depending on how full the file system is.
582 After setting or clearing
590 must be run on the filesystem to return the filesystem to a consistent state.
592 will print a message requesting that the system administrator run
594 if necessary. After setting the
598 can be run to convert existing directories to the hashed B-tree format.
599 Enabling certain filesystem features may prevent the filesystem from being
600 mounted by kernels which do not support those features. In particular, the
604 features are only supported by the ext4 filesystem.
606 .BI \-p " mmp_check_interval"
607 Set the desired MMP check interval in seconds. It is 5 seconds by default.
609 .BI \-r " reserved-blocks-count"
610 Set the number of reserved filesystem blocks.
612 .BI \-Q " quota-options"
613 Sets 'quota' feature on the superblock and works on the quota files for the
614 given quota type. Quota options could be one or more of the following:
618 Sets/clears user quota inode in the superblock.
621 Sets/clears group quota inode in the superblock.
624 .BI \-T " time-last-checked"
625 Set the time the filesystem was last checked using
627 The time is interpreted using the current (local) timezone.
628 This can be useful in scripts which use a Logical Volume Manager to make
629 a consistent snapshot of a filesystem, and then check the filesystem
630 during off hours to make sure it hasn't been corrupted due to
631 hardware problems, etc. If the filesystem was clean, then this option can
632 be used to set the last checked time on the original filesystem. The format
635 is the international date format, with an optional time specifier, i.e.
636 YYYYMMDD[HH[MM[SS]]]. The keyword
638 is also accepted, in which case the last checked time will be set to the
642 Set the user who can use the reserved filesystem blocks.
644 can be a numerical uid or a user name. If a user name is given, it
645 is converted to a numerical uid before it is stored in the superblock.
648 Set the universally unique identifier (UUID) of the filesystem to
650 The format of the UUID is a series of hex digits separated by hyphens,
652 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
655 parameter may also be one of the following:
659 clear the filesystem UUID
662 generate a new randomly-generated UUID
665 generate a new time-based UUID
668 The UUID may be used by
673 (and possibly others) by specifying
675 instead of a block special device name like
680 for more information.
681 If the system does not have a good random number generator such as
686 will automatically use a time-based UUID instead of a randomly-generated UUID.
688 We haven't found any bugs yet. That doesn't mean there aren't any...
691 was written by Remy Card <Remy.Card@linux.org>. It is currently being
692 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
694 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
695 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
696 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
699 is part of the e2fsprogs package and is available from
700 http://e2fsprogs.sourceforge.net.