blob: 55c6dd9feea880ce9afe0c032bc2b17fc222a934 [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" Revision 1.0 93/06/3 23:00 chk
2.\" Initial revision
3.\"
4.\"
Theodore Ts'o74becf31997-04-26 14:37:06 +00005.TH TUNE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00006.SH NAME
Theodore Ts'o4f858542009-05-30 12:34:28 -04007tune2fs \- adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems
Theodore Ts'o3839e651997-04-26 13:21:57 +00008.SH SYNOPSIS
9.B tune2fs
10[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000011.B \-l
Theodore Ts'of3db3561997-04-26 13:34:30 +000012]
13[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000014.B \-c
Theodore Ts'of3db3561997-04-26 13:34:30 +000015.I max-mount-counts
16]
17[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000018.B \-e
Theodore Ts'of3db3561997-04-26 13:34:30 +000019.I errors-behavior
20]
21[
Theodore Ts'o177ab2b2002-01-27 18:23:49 -050022.B \-f
23]
24[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000025.B \-i
Theodore Ts'of3db3561997-04-26 13:34:30 +000026.I interval-between-checks
27]
28[
Theodore Ts'o08dd8302001-01-14 16:25:58 +000029.B \-j
Theodore Ts'odc2ec522001-01-18 01:51:15 +000030]
31[
32.B \-J
Theodore Ts'o08dd8302001-01-14 16:25:58 +000033.I journal-options
34]
35[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000036.B \-m
Theodore Ts'of3db3561997-04-26 13:34:30 +000037.I reserved-blocks-percentage
38]
39[
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -040040.B \-o
Theodore Ts'oc65e54b2003-12-11 11:31:48 -050041.RI [^]mount-options [,...]
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -040042]
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -040043[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000044.B \-r
Theodore Ts'of3db3561997-04-26 13:34:30 +000045.I reserved-blocks-count
46]
47[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000048.B \-s
49.I sparse-super-flag
Theodore Ts'o521e3681997-04-29 17:48:10 +000050]
51[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000052.B \-u
Theodore Ts'of3db3561997-04-26 13:34:30 +000053.I user
54]
55[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000056.B \-g
Theodore Ts'of3db3561997-04-26 13:34:30 +000057.I group
Theodore Ts'o3839e651997-04-26 13:21:57 +000058]
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000059[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000060.B \-C
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000061.I mount-count
62]
63[
Theodore Ts'o6cb27402008-01-26 19:06:35 -050064.B \-E
65.I extended-options
66]
67[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000068.B \-L
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000069.I volume-name
70]
71[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000072.B \-M
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000073.I last-mounted-directory
74]
75[
Theodore Ts'o896938d1999-10-23 01:04:50 +000076.B \-O
Theodore Ts'oce57f142001-04-26 04:25:39 +000077.RI [^] feature [,...]
Theodore Ts'o896938d1999-10-23 01:04:50 +000078]
79[
Aditya Kali771e8db2011-07-20 11:40:05 -070080.B \-Q
81.I quota-options
82]
83[
Theodore Ts'od4de4aa2001-12-26 08:58:01 -050084.B \-T
85.I time-last-checked
86]
87[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000088.B \-U
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000089.I UUID
90]
Theodore Ts'o3839e651997-04-26 13:21:57 +000091device
92.SH DESCRIPTION
93.BI tune2fs
Theodore Ts'oa7ac1df2003-08-24 17:56:41 -040094allows the system administrator to adjust various tunable filesystem
Theodore Ts'o4f858542009-05-30 12:34:28 -040095parameters on Linux ext2, ext3, or ext4 filesystems. The current values
96of these options can be displayed by using the
Theodore Ts'oc927bec2009-04-18 11:39:22 -040097.B -l
98option to
99.BR tune2fs (8)
100program, or by using the
101.BR dumpe2fs (8)
102program.
Theodore Ts'o99464782010-09-25 21:41:21 -0400103.PP
104The
105.I device
Theodore Ts'o585545e2012-07-14 19:58:06 -0400106specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
107specifier: "\fBLABEL=\fIvolume-name\fR" or "\fBUUID=\fIuuid\fR". (i.e.,
Theodore Ts'o99464782010-09-25 21:41:21 -0400108LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
Theodore Ts'o3839e651997-04-26 13:21:57 +0000109.SH OPTIONS
110.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000111.BI \-c " max-mount-counts"
Theodore Ts'oe0f72cf2006-05-14 18:09:12 -0400112Adjust the number of mounts after which the filesystem will be checked by
113.BR e2fsck (8).
114If
Theodore Ts'o45d9e2f2000-07-07 03:12:54 +0000115.I max-mount-counts
Theodore Ts'o7b921b92005-05-06 12:04:10 -0400116is 0 or \-1, the number of times the filesystem is mounted will be disregarded
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000117by
118.BR e2fsck (8)
119and the kernel.
120.sp
121Staggering the mount-counts at which filesystems are forcibly
122checked will avoid all filesystems being checked at one time
123when using journaled filesystems.
124.sp
125You should strongly consider the consequences of disabling
126mount-count-dependent checking entirely. Bad disk drives, cables,
127memory, and kernel bugs could all corrupt a filesystem without
128marking the filesystem dirty or in error. If you are using
129journaling on your filesystem, your filesystem will
130.B never
131be marked dirty, so it will not normally be checked. A
132filesystem error detected by the kernel will still force
133an fsck on the next reboot, but it may already be too late
134to prevent data loss at that point.
135.sp
136See also the
137.B \-i
138option for time-dependent checking.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000139.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000140.BI \-C " mount-count"
141Set the number of times the filesystem has been mounted.
Theodore Ts'oe0f72cf2006-05-14 18:09:12 -0400142If set to a greater value than the max-mount-counts parameter
143set by the
144.B \-c
145option,
146.BR e2fsck (8)
147will check the filesystem at the next reboot.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000148.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000149.BI \-e " error-behavior"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000150Change the behavior of the kernel code when errors are detected.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000151In all cases, a filesystem error will cause
152.BR e2fsck (8)
153to check the filesystem on the next boot.
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000154.I error-behavior
155can be one of the following:
Theodore Ts'oce57f142001-04-26 04:25:39 +0000156.RS 1.2i
157.TP 1.2i
158.B continue
159Continue normal execution.
160.TP
161.B remount-ro
162Remount filesystem read-only.
163.TP
164.B panic
165Cause a kernel panic.
166.RE
Theodore Ts'o3839e651997-04-26 13:21:57 +0000167.TP
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500168.BI \-E " extended-options"
169Set extended options for the filesystem. Extended options are comma
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500170separated, and may take an argument using the equals ('=') sign.
171The following extended options are supported:
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500172.RS 1.2i
173.TP
Andreas Dilger0f5eba72011-09-24 13:48:55 -0400174.B clear_mmp
175Reset the MMP block (if any) back to the clean state. Use only if
176absolutely certain the device is not currently mounted or being
177fscked, or major filesystem corruption can result. Needs '-f'.
178.TP
179.BI mmp_update_interval= interval
180Adjust the initial MMP update interval to
181.I interval
182seconds. Specifying an
183.I interval
184of 0 means to use the default interval. The specified interval must
185be less than 300 seconds. Requires that the
186.B mmp
187feature be enabled.
188.TP
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500189.BI stride= stride-size
190Configure the filesystem for a RAID array with
191.I stride-size
192filesystem blocks. This is the number of blocks read or written to disk
193before moving to next disk. This mostly affects placement of filesystem
194metadata like bitmaps at
195.BR mke2fs (2)
Theodore Ts'o711d3842008-09-07 14:08:40 -0400196time to avoid placing them on a single disk, which can hurt the performance.
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500197It may also be used by block allocator.
198.TP
Theodore Ts'o10ff68d2008-08-29 21:21:19 -0400199.BI stripe_width= stripe-width
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500200Configure the filesystem for a RAID array with
201.I stripe-width
202filesystem blocks per stripe. This is typically be stride-size * N, where
203N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
204This allows the block allocator to prevent read-modify-write of the
205parity in a RAID stripe if possible when the data is written.
206.TP
Theodore Ts'o10ff68d2008-08-29 21:21:19 -0400207.BI hash_alg= hash-alg
208Set the default hash algorithm used for filesystems with hashed b-tree
209directories. Valid algorithms accepted are:
210.IR legacy ,
211.IR half_md4 ,
212and
213.IR tea .
214.TP
Theodore Ts'o9345f022010-09-18 19:38:22 -0400215.BI mount_opts= mount_option_string
216Set a set of default mount options which will be used when the file
217system is mounted. Unlike the bitmask-based default mount options which
218can be specified with the
219.B -o
220option,
221.I mount_option_string
222is an arbitrary string with a maximum length of 63 bytes, which is
223stored in the superblock.
224.IP
225The ext4 file system driver will first apply
226the bitmask-based default options, and then parse the
227.IR mount_option_string ,
228before parsing the mount options passed from the
229.BR mount (8)
230program.
231.IP
232This superblock setting is only honored in 2.6.35+ kernels;
233and not at all by the ext2 and ext3 file system drivers.
234.TP
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500235.B test_fs
236Set a flag in the filesystem superblock indicating that it may be
237mounted using experimental kernel code, such as the ext4dev filesystem.
238.TP
239.B ^test_fs
240Clear the test_fs flag, indicating the filesystem should only be mounted
241using production-level filesystem code.
242.RE
243.TP
Theodore Ts'o177ab2b2002-01-27 18:23:49 -0500244.B \-f
245Force the tune2fs operation to complete even in the face of errors. This
246option is useful when removing the
247.B has_journal
248filesystem feature from a filesystem which has
249an external journal (or is corrupted
250such that it appears to have an external journal), but that
251external journal is not available.
252.sp
253.B WARNING:
254Removing an external journal from a filesystem which was not cleanly unmounted
255without first replaying the external journal can result in
256severe data loss and filesystem corruption.
257.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000258.BI \-g " group"
Theodore Ts'ofebac232007-07-11 23:20:17 -0400259Set the group which can use the reserved filesystem blocks.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000260The
Theodore Ts'of3db3561997-04-26 13:34:30 +0000261.I group
Theodore Ts'oce57f142001-04-26 04:25:39 +0000262parameter can be a numerical gid or a group name. If a group name is given,
Theodore Ts'oe1c6b2f2000-12-02 06:19:33 +0000263it is converted to a numerical gid before it is stored in the superblock.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000264.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000265.B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
266Adjust the maximal time between two filesystem checks.
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400267No suffix or
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000268.B d
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400269will interpret the number
270.I interval-between-checks
271as days,
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000272.B m
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400273as months, and
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000274.B w
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400275as weeks. A value of zero will disable the time-dependent checking.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000276.sp
277It is strongly recommended that either
278.B \-c
279(mount-count-dependent) or
280.B \-i
281(time-dependent) checking be enabled to force periodic full
282.BR e2fsck (8)
283checking of the filesystem. Failure to do so may lead to filesystem
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400284corruption (due to bad disks, cables, memory, or kernel bugs) going
285unnoticed, ultimately resulting in data loss or corruption.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000286.TP
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000287.B \-j
Theodore Ts'oce57f142001-04-26 04:25:39 +0000288Add an ext3 journal to the filesystem. If the
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000289.B \-J
Theodore Ts'o8d641742001-05-14 04:12:27 +0000290option is not specified, the default journal parameters will be used to create
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000291an appropriately sized journal (given the size of the filesystem)
Theodore Ts'oce57f142001-04-26 04:25:39 +0000292stored within the filesystem. Note that you must be using a kernel
293which has ext3 support in order to actually make use of the journal.
Theodore Ts'o91d71c42004-09-19 07:34:35 -0400294.IP
295If this option is used to create a journal on a mounted filesystem, an
296immutable file,
297.BR .journal ,
298will be created in the top-level directory of the filesystem, as it is
299the only safe way to create the journal inode while the filesystem is
300mounted. While the ext3 journal is visible, it is not safe to
301delete it, or modify it while the filesystem is mounted; for this
302reason the file is marked immutable.
303While checking unmounted filesystems,
304.BR e2fsck (8)
305will automatically move
306.B .journal
307files to the invisible, reserved journal inode. For all filesystems
308except for the root filesystem, this should happen automatically and
309naturally during the next reboot cycle. Since the root filesystem is
310mounted read-only,
311.BR e2fsck (8)
312must be run from a rescue floppy in order to effect this transition.
313.IP
314On some distributions, such as Debian, if an initial ramdisk is used,
315the initrd scripts will automatically convert an ext2 root filesystem
316to ext3 if the
317.BR /etc/fstab
318file specifies the ext3 filesystem for the root filesystem in order to
319avoid requiring the use of a rescue floppy to add an ext3 journal to
320the root filesystem.
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000321.TP
Theodore Ts'o8d641742001-05-14 04:12:27 +0000322.BR \-J " journal-options"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000323Override the default ext3 journal parameters. Journal options are comma
Theodore Ts'o08dd8302001-01-14 16:25:58 +0000324separated, and may take an argument using the equals ('=') sign.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000325The following journal options are supported:
326.RS 1.2i
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000327.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000328.BI size= journal-size
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000329Create a journal stored in the filesystem of size
Theodore Ts'o251395d2001-05-14 04:43:05 +0000330.I journal-size
331megabytes. The size of the journal must be at least 1024 filesystem blocks
332(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
333and may be no more than 102,400 filesystem blocks.
334There must be enough free space in the filesystem to create a journal of
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000335that size.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000336@JDEV@.TP
337@JDEV@.BI device= external-journal
Theodore Ts'o251395d2001-05-14 04:43:05 +0000338@JDEV@Attach the filesystem to the journal block device located on
339@JDEV@.IR external-journal .
Theodore Ts'oce57f142001-04-26 04:25:39 +0000340@JDEV@The external
341@JDEV@journal must have been already created using the command
Theodore Ts'o251395d2001-05-14 04:43:05 +0000342@JDEV@.IP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000343@JDEV@.B mke2fs -O journal_dev
Theodore Ts'oe9a2d072001-06-14 07:15:02 +0000344@JDEV@.I external-journal
Theodore Ts'o251395d2001-05-14 04:43:05 +0000345@JDEV@.IP
346@JDEV@Note that
347@JDEV@.I external-journal
348@JDEV@must be formatted with the same block
349@JDEV@size as filesystems which will be using it.
Theodore Ts'o3024d882006-03-27 11:53:00 -0500350@JDEV@In addition, while there is support for attaching
351@JDEV@multiple filesystems to a single external journal,
352@JDEV@the Linux kernel and
353@JDEV@.BR e2fsck (8)
354@JDEV@do not currently support shared external journals yet.
Andreas Dilger2d155762001-08-17 03:48:11 -0600355@JDEV@.IP
356@JDEV@Instead of specifying a device name directly,
357@JDEV@.I external-journal
358@JDEV@can also be specified by either
359@JDEV@.BI LABEL= label
360@JDEV@or
361@JDEV@.BI UUID= UUID
362@JDEV@to locate the external journal by either the volume label or UUID
363@JDEV@stored in the ext2 superblock at the start of the journal. Use
364@JDEV@.BR dumpe2fs (8)
365@JDEV@to display a journal device's volume label and UUID. See also the
366@JDEV@.B -L
367@JDEV@option of
368@JDEV@.BR tune2fs (8).
Theodore Ts'oce57f142001-04-26 04:25:39 +0000369.RE
370@JDEV@.IP
371@JDEV@Only one of the
372@JDEV@.BR size " or " device
373@JDEV@options can be given for a filesystem.
Theodore Ts'o08dd8302001-01-14 16:25:58 +0000374.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000375.B \-l
Theodore Ts'oc927bec2009-04-18 11:39:22 -0400376List the contents of the filesystem superblock, including the current
377values of the parameters that can be set via this program.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000378.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000379.BI \-L " volume-label"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000380Set the volume label of the filesystem.
Theodore Ts'oa789d841998-03-30 01:20:55 +0000381Ext2 filesystem labels can be at most 16 characters long; if
382.I volume-label
383is longer than 16 characters,
384.B tune2fs
Andreas Dilger2d155762001-08-17 03:48:11 -0600385will truncate it and print a warning. The volume label can be used
386by
387.BR mount (8),
388.BR fsck (8),
389and
390.BR /etc/fstab (5)
391(and possibly others) by specifying
392.BI LABEL= volume_label
393instead of a block special device name like
394.BR /dev/hda5 .
Theodore Ts'oce57f142001-04-26 04:25:39 +0000395.TP
396.BI \-m " reserved-blocks-percentage"
Theodore Ts'ofebac232007-07-11 23:20:17 -0400397Set the percentage of the filesystem which may only be allocated
398by privileged processes. Reserving some number of filesystem blocks
399for use by privileged processes is done
400to avoid filesystem fragmentation, and to allow system
401daemons, such as
402.BR syslogd (8),
403to continue to function correctly after non-privileged processes are
404prevented from writing to the filesystem. Normally, the default percentage
405of reserved blocks is 5%.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000406.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000407.BI \-M " last-mounted-directory"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000408Set the last-mounted directory for the filesystem.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000409.TP
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400410.BR \-o " [^]\fImount-option\fR[,...]"
411Set or clear the indicated default mount options in the filesystem.
Theodore Ts'o81393672005-04-16 14:05:09 -0400412Default mount options can be overridden by mount options specified
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400413either in
414.BR /etc/fstab (5)
415or on the command line arguments to
416.BR mount (8).
417Older kernels may not support this feature; in particular,
418kernels which predate 2.4.20 will almost certainly ignore the
419default mount options field in the superblock.
420.IP
421More than one mount option can be cleared or set by separating
422features with commas. Mount options prefixed with a
423caret character ('^') will be cleared in the filesystem's superblock;
424mount options without a prefix character or prefixed with a plus
425character ('+') will be added to the filesystem.
426.IP
427The following mount options can be set or cleared using
428.BR tune2fs :
429.RS 1.2i
430.TP
431.B debug
432Enable debugging code for this filesystem.
433.TP
434.B bsdgroups
Theodore Ts'o585545e2012-07-14 19:58:06 -0400435Emulate BSD behavior when creating new files: they will take the group-id
436of the directory in which they were created. The standard System V behavior
Theodore Ts'o77be4d22003-03-06 12:39:55 -0500437is the default, where newly created files take on the fsgid of the current
Theodore Ts'o81393672005-04-16 14:05:09 -0400438process, unless the directory has the setgid bit set, in which case it takes
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400439the gid from the parent directory, and also gets the setgid bit set if it is
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400440a directory itself.
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400441.TP
442.B user_xattr
443Enable user-specified extended attributes.
444.TP
445.B acl
446Enable Posix Access Control Lists.
447.TP
448.B uid16
449Disables 32-bit UIDs and GIDs. This is for interoperability with
450older kernels which only store and expect 16-bit values.
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400451.TP
452.B journal_data
453When the filesystem is mounted with journalling enabled, all data
454(not just metadata) is committed into the journal prior to being written
455into the main filesystem.
456.TP
457.B journal_data_ordered
458When the filesystem is mounted with journalling enabled, all data is forced
Theodore Ts'occdd1d62004-04-11 17:02:44 -0400459directly out to the main file system prior to its metadata being committed
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400460to the journal.
461.TP
462.B journal_data_writeback
463When the filesystem is mounted with journalling enabled, data may be
Theodore Ts'occdd1d62004-04-11 17:02:44 -0400464written into the main filesystem after its metadata has been committed
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400465to the journal. This may increase throughput, however, it may allow old
466data to appear in files after a crash and journal recovery.
Theodore Ts'o9345f022010-09-18 19:38:22 -0400467.TP
468.B nobarrier
469The file system will be mounted with barrier operations in the journal
470disabled. (This option is currently only supported by the ext4 file
471system driver in 2.6.35+ kernels.)
472.TP
473.B block_validity
474The file system will be mounted with the block_validity option enabled,
475which causes extra checks to be performed after reading or writing from
476the file system. This prevents corrupted metadata blocks from causing
477file system damage by overwriting parts of the inode table or block
478group descriptors. This comes at the cost of increased memory and CPU
479overhead, so it is enabled only for debugging purposes. (This option is
480currently only supported by the ext4 file system driver in 2.6.35+
481kernels.)
482.TP
483.B discard
Theodore Ts'o585545e2012-07-14 19:58:06 -0400484The file system will be mounted with the discard mount option. This will
Theodore Ts'o9345f022010-09-18 19:38:22 -0400485cause the file system driver to attempt to use the trim/discard feature
486of some storage devices (such as SSD's and thin-provisioned drives
487available in some enterprise storage arrays) to inform the storage
488device that blocks belonging to deleted files can be reused for other
489purposes. (This option is currently only supported by the ext4 file
490system driver in 2.6.35+ kernels.)
491.TP
492.B nodelalloc
493The file system will be mounted with the nodelalloc mount option. This
494will disable the delayed allocation feature. (This option is currently
495only supported by the ext4 file system driver in 2.6.35+ kernels.)
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400496.RE
497.TP
Theodore Ts'o251395d2001-05-14 04:43:05 +0000498.BR \-O " [^]\fIfeature\fR[,...]"
499Set or clear the indicated filesystem features (options) in the filesystem.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000500More than one filesystem feature can be cleared or set by separating
501features with commas. Filesystem features prefixed with a
502caret character ('^') will be cleared in the filesystem's superblock;
503filesystem features without a prefix character or prefixed with a plus
504character ('+') will be added to the filesystem.
505.IP
506The following filesystem features can be set or cleared using
Theodore Ts'o251395d2001-05-14 04:43:05 +0000507.BR tune2fs :
Theodore Ts'oce57f142001-04-26 04:25:39 +0000508.RS 1.2i
509.TP
Theodore Ts'occbed852003-04-11 13:32:31 -0400510.B dir_index
511Use hashed b-trees to speed up lookups in large directories.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000512.TP
Andreas Dilger25bc8c72011-06-11 11:29:54 -0400513.B dir_nlink
514Allow more than 65000 subdirectories per directory.
515.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000516.B filetype
Theodore Ts'o251395d2001-05-14 04:43:05 +0000517Store file type information in directory entries.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000518.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400519.B flex_bg
520Allow bitmaps and inode tables for a block group to be placed
Theodore Ts'o7a9f0552009-09-07 15:17:51 -0400521anywhere on the storage media. \fBTune2fs\fR will not reorganize
522the location of the inode tables and allocation bitmaps, as
523.BR mke2fs (8)
Theodore Ts'o585545e2012-07-14 19:58:06 -0400524will do when it creates a freshly formatted file system with
Theodore Ts'o7a9f0552009-09-07 15:17:51 -0400525.B flex_bg
526enabled.
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400527.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000528.B has_journal
Theodore Ts'o82b39c92002-09-29 19:08:38 -0400529Use a journal to ensure filesystem consistency even across unclean shutdowns.
530Setting the filesystem feature is equivalent to using the
Theodore Ts'oce57f142001-04-26 04:25:39 +0000531.B \-j
Theodore Ts'o82b39c92002-09-29 19:08:38 -0400532option.
Theodore Ts'occbed852003-04-11 13:32:31 -0400533.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400534.B large_file
535Filesystem can contain files that are greater than 2GB. (Modern kernels
536set this feature automatically when a file > 2GB is created.)
Theodore Ts'o037914e2008-02-26 17:31:06 -0500537.TP
538.B resize_inode
539Reserve space so the block group descriptor table may grow in the
540future.
541.B Tune2fs
542only supports clearing this filesystem feature.
Jose R. Santos4e988cb2007-10-21 21:03:41 -0500543.TP
Andreas Dilger0f5eba72011-09-24 13:48:55 -0400544.B mmp
Andreas Dilgerd9c60e02011-09-24 14:13:27 -0400545Enable or disable multiple mount protection (MMP) feature. MMP helps to
546protect the filesystem from being multiply mounted and is useful in
547shared storage environments.
Andreas Dilger0f5eba72011-09-24 13:48:55 -0400548.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400549.B sparse_super
550Limit the number of backup superblocks to save space on large filesystems.
551.TP
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400552.B uninit_bg
Jose R. Santos4e988cb2007-10-21 21:03:41 -0500553Allow the kernel to initialize bitmaps and inode tables and keep a high
554watermark for the unused inodes in a filesystem, to reduce
555.BR e2fsck (8)
Andreas Dilger4237c732008-03-30 14:13:03 -0400556time. This first e2fsck run after enabling this feature will take the
557full time, but subsequent e2fsck runs will take only a fraction of the
558original time, depending on how full the file system is.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000559.RE
560.IP
Theodore Ts'o39567c42001-09-19 15:28:21 -0400561After setting or clearing
Theodore Ts'o037914e2008-02-26 17:31:06 -0500562.BR sparse_super ,
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400563.BR uninit_bg ,
Theodore Ts'o037914e2008-02-26 17:31:06 -0500564.BR filetype ,
565or
566.B resize_inode
Theodore Ts'o39567c42001-09-19 15:28:21 -0400567filesystem features,
Theodore Ts'oce57f142001-04-26 04:25:39 +0000568.BR e2fsck (8)
Theodore Ts'o251395d2001-05-14 04:43:05 +0000569must be run on the filesystem to return the filesystem to a consistent state.
Theodore Ts'o39567c42001-09-19 15:28:21 -0400570.B Tune2fs
571will print a message requesting that the system administrator run
572.BR e2fsck (8)
Theodore Ts'o45e18ad2004-09-17 17:31:16 -0400573if necessary. After setting the
574.B dir_index
575feature,
576.B e2fsck -D
577can be run to convert existing directories to the hashed B-tree format.
Andreas Dilger4237c732008-03-30 14:13:03 -0400578Enabling certain filesystem features may prevent the filesystem from being
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400579mounted by kernels which do not support those features. In particular, the
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400580.BR uninit_bg
Andreas Dilger4237c732008-03-30 14:13:03 -0400581and
582.BR flex_bg
583features are only supported by the ext4 filesystem.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000584.TP
Andreas Dilger0f5eba72011-09-24 13:48:55 -0400585.BI \-p " mmp_check_interval"
586Set the desired MMP check interval in seconds. It is 5 seconds by default.
587.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000588.BI \-r " reserved-blocks-count"
589Set the number of reserved filesystem blocks.
590.TP
Aditya Kali771e8db2011-07-20 11:40:05 -0700591.BI \-Q " quota-options"
592Sets 'quota' feature on the superblock and works on the quota files for the
593given quota type. Quota options could be one or more of the following:
594.RS 1.2i
595.TP
596.BR [^]usrquota
597Sets/clears user quota inode in the superblock.
David Prévotb75a4ce2012-03-26 10:45:51 -0700598.TP
599.BR [^]grpquota
Aditya Kali771e8db2011-07-20 11:40:05 -0700600Sets/clears group quota inode in the superblock.
Aditya Kalia99145e2012-04-24 14:26:13 -0400601.RE
Aditya Kali771e8db2011-07-20 11:40:05 -0700602.TP
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500603.BI \-T " time-last-checked"
604Set the time the filesystem was last checked using
605.BR e2fsck .
Theodore Ts'o402b95d2008-03-21 09:25:23 -0400606The time is interpreted using the current (local) timezone.
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500607This can be useful in scripts which use a Logical Volume Manager to make
608a consistent snapshot of a filesystem, and then check the filesystem
609during off hours to make sure it hasn't been corrupted due to
610hardware problems, etc. If the filesystem was clean, then this option can
611be used to set the last checked time on the original filesystem. The format
612of
613.I time-last-checked
614is the international date format, with an optional time specifier, i.e.
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400615YYYYMMDD[HH[MM[SS]]]. The keyword
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500616.B now
617is also accepted, in which case the last checked time will be set to the
618current time.
619.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000620.BI \-u " user"
621Set the user who can use the reserved filesystem blocks.
622.I user
623can be a numerical uid or a user name. If a user name is given, it
624is converted to a numerical uid before it is stored in the superblock.
Theodore Ts'o896938d1999-10-23 01:04:50 +0000625.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000626.BI \-U " UUID"
Theodore Ts'o8d641742001-05-14 04:12:27 +0000627Set the universally unique identifier (UUID) of the filesystem to
Theodore Ts'oce57f142001-04-26 04:25:39 +0000628.IR UUID .
Theodore Ts'of044b4d2002-08-17 13:32:21 -0400629The format of the UUID is a series of hex digits separated by hyphens,
Theodore Ts'oce57f142001-04-26 04:25:39 +0000630like this:
631"c1b9d5a2-f162-11cf-9ece-0020afc76f16".
632The
633.I UUID
634parameter may also be one of the following:
635.RS 1.2i
636.TP
637.I clear
638clear the filesystem UUID
639.TP
640.I random
641generate a new randomly-generated UUID
642.TP
643.I time
644generate a new time-based UUID
645.RE
646.IP
Andreas Dilger2d155762001-08-17 03:48:11 -0600647The UUID may be used by
648.BR mount (8),
649.BR fsck (8),
650and
651.BR /etc/fstab (5)
652(and possibly others) by specifying
653.BI UUID= uuid
654instead of a block special device name like
655.BR /dev/hda1 .
656.IP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000657See
658.BR uuidgen (8)
659for more information.
660If the system does not have a good random number generator such as
661.I /dev/random
662or
663.IR /dev/urandom ,
664.B tune2fs
665will automatically use a time-based UUID instead of a randomly-generated UUID.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000666.SH BUGS
Theodore Ts'o63985322001-01-03 17:02:13 +0000667We haven't found any bugs yet. That doesn't mean there aren't any...
Theodore Ts'o3839e651997-04-26 13:21:57 +0000668.SH AUTHOR
669.B tune2fs
Theodore Ts'o2e5a1b92004-01-31 20:27:36 -0500670was written by Remy Card <Remy.Card@linux.org>. It is currently being
671maintained by Theodore Ts'o <tytso@alum.mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000672.B tune2fs
Theodore Ts'oa418d3a1997-04-26 14:00:26 +0000673uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000674This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000675Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000676.SH AVAILABILITY
677.B tune2fs
Theodore Ts'o12da49c2001-05-12 15:49:17 +0000678is part of the e2fsprogs package and is available from
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000679http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000680.SH SEE ALSO
Andreas Mohr0fd2f902008-02-28 20:50:05 -0500681.BR debugfs (8),
Theodore Ts'o3839e651997-04-26 13:21:57 +0000682.BR dumpe2fs (8),
683.BR e2fsck (8),
684.BR mke2fs (8)