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