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