blob: 233f85a8f87d4d8e0cf11967f6df53dd8627cc98 [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[
Theodore Ts'od4de4aa2001-12-26 08:58:01 -050080.B \-T
81.I time-last-checked
82]
83[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000084.B \-U
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000085.I UUID
86]
Theodore Ts'o3839e651997-04-26 13:21:57 +000087device
88.SH DESCRIPTION
89.BI tune2fs
Theodore Ts'oa7ac1df2003-08-24 17:56:41 -040090allows the system administrator to adjust various tunable filesystem
Theodore Ts'o4f858542009-05-30 12:34:28 -040091parameters on Linux ext2, ext3, or ext4 filesystems. The current values
92of these options can be displayed by using the
Theodore Ts'oc927bec2009-04-18 11:39:22 -040093.B -l
94option to
95.BR tune2fs (8)
96program, or by using the
97.BR dumpe2fs (8)
98program.
Theodore Ts'o99464782010-09-25 21:41:21 -040099.PP
100The
101.I device
102specifer can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
103specifer: "\fBLABEL=\fIvolume-name\fR" or "\fBUUID=\fIuuid\fR". (i.e.,
104LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
Theodore Ts'o3839e651997-04-26 13:21:57 +0000105.SH OPTIONS
106.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000107.BI \-c " max-mount-counts"
Theodore Ts'oe0f72cf2006-05-14 18:09:12 -0400108Adjust the number of mounts after which the filesystem will be checked by
109.BR e2fsck (8).
110If
Theodore Ts'o45d9e2f2000-07-07 03:12:54 +0000111.I max-mount-counts
Theodore Ts'o7b921b92005-05-06 12:04:10 -0400112is 0 or \-1, the number of times the filesystem is mounted will be disregarded
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000113by
114.BR e2fsck (8)
115and the kernel.
116.sp
117Staggering the mount-counts at which filesystems are forcibly
118checked will avoid all filesystems being checked at one time
119when using journaled filesystems.
120.sp
121You should strongly consider the consequences of disabling
122mount-count-dependent checking entirely. Bad disk drives, cables,
123memory, and kernel bugs could all corrupt a filesystem without
124marking the filesystem dirty or in error. If you are using
125journaling on your filesystem, your filesystem will
126.B never
127be marked dirty, so it will not normally be checked. A
128filesystem error detected by the kernel will still force
129an fsck on the next reboot, but it may already be too late
130to prevent data loss at that point.
131.sp
132See also the
133.B \-i
134option for time-dependent checking.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000135.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000136.BI \-C " mount-count"
137Set the number of times the filesystem has been mounted.
Theodore Ts'oe0f72cf2006-05-14 18:09:12 -0400138If set to a greater value than the max-mount-counts parameter
139set by the
140.B \-c
141option,
142.BR e2fsck (8)
143will check the filesystem at the next reboot.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000144.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000145.BI \-e " error-behavior"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000146Change the behavior of the kernel code when errors are detected.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000147In all cases, a filesystem error will cause
148.BR e2fsck (8)
149to check the filesystem on the next boot.
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000150.I error-behavior
151can be one of the following:
Theodore Ts'oce57f142001-04-26 04:25:39 +0000152.RS 1.2i
153.TP 1.2i
154.B continue
155Continue normal execution.
156.TP
157.B remount-ro
158Remount filesystem read-only.
159.TP
160.B panic
161Cause a kernel panic.
162.RE
Theodore Ts'o3839e651997-04-26 13:21:57 +0000163.TP
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500164.BI \-E " extended-options"
165Set extended options for the filesystem. Extended options are comma
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500166separated, and may take an argument using the equals ('=') sign.
167The following extended options are supported:
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500168.RS 1.2i
169.TP
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500170.BI stride= stride-size
171Configure the filesystem for a RAID array with
172.I stride-size
173filesystem blocks. This is the number of blocks read or written to disk
174before moving to next disk. This mostly affects placement of filesystem
175metadata like bitmaps at
176.BR mke2fs (2)
Theodore Ts'o711d3842008-09-07 14:08:40 -0400177time to avoid placing them on a single disk, which can hurt the performance.
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500178It may also be used by block allocator.
179.TP
Theodore Ts'o10ff68d2008-08-29 21:21:19 -0400180.BI stripe_width= stripe-width
Theodore Ts'o0c17cb22008-02-18 22:56:25 -0500181Configure the filesystem for a RAID array with
182.I stripe-width
183filesystem blocks per stripe. This is typically be stride-size * N, where
184N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
185This allows the block allocator to prevent read-modify-write of the
186parity in a RAID stripe if possible when the data is written.
187.TP
Theodore Ts'o10ff68d2008-08-29 21:21:19 -0400188.BI hash_alg= hash-alg
189Set the default hash algorithm used for filesystems with hashed b-tree
190directories. Valid algorithms accepted are:
191.IR legacy ,
192.IR half_md4 ,
193and
194.IR tea .
195.TP
Theodore Ts'o9345f022010-09-18 19:38:22 -0400196.BI mount_opts= mount_option_string
197Set a set of default mount options which will be used when the file
198system is mounted. Unlike the bitmask-based default mount options which
199can be specified with the
200.B -o
201option,
202.I mount_option_string
203is an arbitrary string with a maximum length of 63 bytes, which is
204stored in the superblock.
205.IP
206The ext4 file system driver will first apply
207the bitmask-based default options, and then parse the
208.IR mount_option_string ,
209before parsing the mount options passed from the
210.BR mount (8)
211program.
212.IP
213This superblock setting is only honored in 2.6.35+ kernels;
214and not at all by the ext2 and ext3 file system drivers.
215.TP
Theodore Ts'o6cb27402008-01-26 19:06:35 -0500216.B test_fs
217Set a flag in the filesystem superblock indicating that it may be
218mounted using experimental kernel code, such as the ext4dev filesystem.
219.TP
220.B ^test_fs
221Clear the test_fs flag, indicating the filesystem should only be mounted
222using production-level filesystem code.
223.RE
224.TP
Theodore Ts'o177ab2b2002-01-27 18:23:49 -0500225.B \-f
226Force the tune2fs operation to complete even in the face of errors. This
227option is useful when removing the
228.B has_journal
229filesystem feature from a filesystem which has
230an external journal (or is corrupted
231such that it appears to have an external journal), but that
232external journal is not available.
233.sp
234.B WARNING:
235Removing an external journal from a filesystem which was not cleanly unmounted
236without first replaying the external journal can result in
237severe data loss and filesystem corruption.
238.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000239.BI \-g " group"
Theodore Ts'ofebac232007-07-11 23:20:17 -0400240Set the group which can use the reserved filesystem blocks.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000241The
Theodore Ts'of3db3561997-04-26 13:34:30 +0000242.I group
Theodore Ts'oce57f142001-04-26 04:25:39 +0000243parameter can be a numerical gid or a group name. If a group name is given,
Theodore Ts'oe1c6b2f2000-12-02 06:19:33 +0000244it is converted to a numerical gid before it is stored in the superblock.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000245.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000246.B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
247Adjust the maximal time between two filesystem checks.
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400248No suffix or
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000249.B d
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400250will interpret the number
251.I interval-between-checks
252as days,
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000253.B m
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400254as months, and
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000255.B w
Theodore Ts'oc5fbf382009-10-24 14:25:39 -0400256as weeks. A value of zero will disable the time-dependent checking.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000257.sp
258It is strongly recommended that either
259.B \-c
260(mount-count-dependent) or
261.B \-i
262(time-dependent) checking be enabled to force periodic full
263.BR e2fsck (8)
264checking of the filesystem. Failure to do so may lead to filesystem
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400265corruption (due to bad disks, cables, memory, or kernel bugs) going
266unnoticed, ultimately resulting in data loss or corruption.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000267.TP
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000268.B \-j
Theodore Ts'oce57f142001-04-26 04:25:39 +0000269Add an ext3 journal to the filesystem. If the
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000270.B \-J
Theodore Ts'o8d641742001-05-14 04:12:27 +0000271option is not specified, the default journal parameters will be used to create
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000272an appropriately sized journal (given the size of the filesystem)
Theodore Ts'oce57f142001-04-26 04:25:39 +0000273stored within the filesystem. Note that you must be using a kernel
274which has ext3 support in order to actually make use of the journal.
Theodore Ts'o91d71c42004-09-19 07:34:35 -0400275.IP
276If this option is used to create a journal on a mounted filesystem, an
277immutable file,
278.BR .journal ,
279will be created in the top-level directory of the filesystem, as it is
280the only safe way to create the journal inode while the filesystem is
281mounted. While the ext3 journal is visible, it is not safe to
282delete it, or modify it while the filesystem is mounted; for this
283reason the file is marked immutable.
284While checking unmounted filesystems,
285.BR e2fsck (8)
286will automatically move
287.B .journal
288files to the invisible, reserved journal inode. For all filesystems
289except for the root filesystem, this should happen automatically and
290naturally during the next reboot cycle. Since the root filesystem is
291mounted read-only,
292.BR e2fsck (8)
293must be run from a rescue floppy in order to effect this transition.
294.IP
295On some distributions, such as Debian, if an initial ramdisk is used,
296the initrd scripts will automatically convert an ext2 root filesystem
297to ext3 if the
298.BR /etc/fstab
299file specifies the ext3 filesystem for the root filesystem in order to
300avoid requiring the use of a rescue floppy to add an ext3 journal to
301the root filesystem.
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000302.TP
Theodore Ts'o8d641742001-05-14 04:12:27 +0000303.BR \-J " journal-options"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000304Override the default ext3 journal parameters. Journal options are comma
Theodore Ts'o08dd8302001-01-14 16:25:58 +0000305separated, and may take an argument using the equals ('=') sign.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000306The following journal options are supported:
307.RS 1.2i
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000308.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000309.BI size= journal-size
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000310Create a journal stored in the filesystem of size
Theodore Ts'o251395d2001-05-14 04:43:05 +0000311.I journal-size
312megabytes. The size of the journal must be at least 1024 filesystem blocks
313(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
314and may be no more than 102,400 filesystem blocks.
315There must be enough free space in the filesystem to create a journal of
Theodore Ts'odc2ec522001-01-18 01:51:15 +0000316that size.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000317@JDEV@.TP
318@JDEV@.BI device= external-journal
Theodore Ts'o251395d2001-05-14 04:43:05 +0000319@JDEV@Attach the filesystem to the journal block device located on
320@JDEV@.IR external-journal .
Theodore Ts'oce57f142001-04-26 04:25:39 +0000321@JDEV@The external
322@JDEV@journal must have been already created using the command
Theodore Ts'o251395d2001-05-14 04:43:05 +0000323@JDEV@.IP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000324@JDEV@.B mke2fs -O journal_dev
Theodore Ts'oe9a2d072001-06-14 07:15:02 +0000325@JDEV@.I external-journal
Theodore Ts'o251395d2001-05-14 04:43:05 +0000326@JDEV@.IP
327@JDEV@Note that
328@JDEV@.I external-journal
329@JDEV@must be formatted with the same block
330@JDEV@size as filesystems which will be using it.
Theodore Ts'o3024d882006-03-27 11:53:00 -0500331@JDEV@In addition, while there is support for attaching
332@JDEV@multiple filesystems to a single external journal,
333@JDEV@the Linux kernel and
334@JDEV@.BR e2fsck (8)
335@JDEV@do not currently support shared external journals yet.
Andreas Dilger2d155762001-08-17 03:48:11 -0600336@JDEV@.IP
337@JDEV@Instead of specifying a device name directly,
338@JDEV@.I external-journal
339@JDEV@can also be specified by either
340@JDEV@.BI LABEL= label
341@JDEV@or
342@JDEV@.BI UUID= UUID
343@JDEV@to locate the external journal by either the volume label or UUID
344@JDEV@stored in the ext2 superblock at the start of the journal. Use
345@JDEV@.BR dumpe2fs (8)
346@JDEV@to display a journal device's volume label and UUID. See also the
347@JDEV@.B -L
348@JDEV@option of
349@JDEV@.BR tune2fs (8).
Theodore Ts'oce57f142001-04-26 04:25:39 +0000350.RE
351@JDEV@.IP
352@JDEV@Only one of the
353@JDEV@.BR size " or " device
354@JDEV@options can be given for a filesystem.
Theodore Ts'o08dd8302001-01-14 16:25:58 +0000355.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000356.B \-l
Theodore Ts'oc927bec2009-04-18 11:39:22 -0400357List the contents of the filesystem superblock, including the current
358values of the parameters that can be set via this program.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000359.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000360.BI \-L " volume-label"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000361Set the volume label of the filesystem.
Theodore Ts'oa789d841998-03-30 01:20:55 +0000362Ext2 filesystem labels can be at most 16 characters long; if
363.I volume-label
364is longer than 16 characters,
365.B tune2fs
Andreas Dilger2d155762001-08-17 03:48:11 -0600366will truncate it and print a warning. The volume label can be used
367by
368.BR mount (8),
369.BR fsck (8),
370and
371.BR /etc/fstab (5)
372(and possibly others) by specifying
373.BI LABEL= volume_label
374instead of a block special device name like
375.BR /dev/hda5 .
Theodore Ts'oce57f142001-04-26 04:25:39 +0000376.TP
377.BI \-m " reserved-blocks-percentage"
Theodore Ts'ofebac232007-07-11 23:20:17 -0400378Set the percentage of the filesystem which may only be allocated
379by privileged processes. Reserving some number of filesystem blocks
380for use by privileged processes is done
381to avoid filesystem fragmentation, and to allow system
382daemons, such as
383.BR syslogd (8),
384to continue to function correctly after non-privileged processes are
385prevented from writing to the filesystem. Normally, the default percentage
386of reserved blocks is 5%.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000387.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000388.BI \-M " last-mounted-directory"
Theodore Ts'oce57f142001-04-26 04:25:39 +0000389Set the last-mounted directory for the filesystem.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000390.TP
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400391.BR \-o " [^]\fImount-option\fR[,...]"
392Set or clear the indicated default mount options in the filesystem.
Theodore Ts'o81393672005-04-16 14:05:09 -0400393Default mount options can be overridden by mount options specified
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400394either in
395.BR /etc/fstab (5)
396or on the command line arguments to
397.BR mount (8).
398Older kernels may not support this feature; in particular,
399kernels which predate 2.4.20 will almost certainly ignore the
400default mount options field in the superblock.
401.IP
402More than one mount option can be cleared or set by separating
403features with commas. Mount options prefixed with a
404caret character ('^') will be cleared in the filesystem's superblock;
405mount options without a prefix character or prefixed with a plus
406character ('+') will be added to the filesystem.
407.IP
408The following mount options can be set or cleared using
409.BR tune2fs :
410.RS 1.2i
411.TP
412.B debug
413Enable debugging code for this filesystem.
414.TP
415.B bsdgroups
416Emulate BSD behaviour when creating new files: they will take the group-id
417of the directory in which they were created. The standard System V behaviour
Theodore Ts'o77be4d22003-03-06 12:39:55 -0500418is the default, where newly created files take on the fsgid of the current
Theodore Ts'o81393672005-04-16 14:05:09 -0400419process, unless the directory has the setgid bit set, in which case it takes
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400420the gid from the parent directory, and also gets the setgid bit set if it is
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400421a directory itself.
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400422.TP
423.B user_xattr
424Enable user-specified extended attributes.
425.TP
426.B acl
427Enable Posix Access Control Lists.
428.TP
429.B uid16
430Disables 32-bit UIDs and GIDs. This is for interoperability with
431older kernels which only store and expect 16-bit values.
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400432.TP
433.B journal_data
434When the filesystem is mounted with journalling enabled, all data
435(not just metadata) is committed into the journal prior to being written
436into the main filesystem.
437.TP
438.B journal_data_ordered
439When the filesystem is mounted with journalling enabled, all data is forced
Theodore Ts'occdd1d62004-04-11 17:02:44 -0400440directly out to the main file system prior to its metadata being committed
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400441to the journal.
442.TP
443.B journal_data_writeback
444When the filesystem is mounted with journalling enabled, data may be
Theodore Ts'occdd1d62004-04-11 17:02:44 -0400445written into the main filesystem after its metadata has been committed
Theodore Ts'o2bae5432002-10-25 16:21:03 -0400446to the journal. This may increase throughput, however, it may allow old
447data to appear in files after a crash and journal recovery.
Theodore Ts'o9345f022010-09-18 19:38:22 -0400448.TP
449.B nobarrier
450The file system will be mounted with barrier operations in the journal
451disabled. (This option is currently only supported by the ext4 file
452system driver in 2.6.35+ kernels.)
453.TP
454.B block_validity
455The file system will be mounted with the block_validity option enabled,
456which causes extra checks to be performed after reading or writing from
457the file system. This prevents corrupted metadata blocks from causing
458file system damage by overwriting parts of the inode table or block
459group descriptors. This comes at the cost of increased memory and CPU
460overhead, so it is enabled only for debugging purposes. (This option is
461currently only supported by the ext4 file system driver in 2.6.35+
462kernels.)
463.TP
464.B discard
465The file system will be mouinted with the discard mount option. This will
466cause the file system driver to attempt to use the trim/discard feature
467of some storage devices (such as SSD's and thin-provisioned drives
468available in some enterprise storage arrays) to inform the storage
469device that blocks belonging to deleted files can be reused for other
470purposes. (This option is currently only supported by the ext4 file
471system driver in 2.6.35+ kernels.)
472.TP
473.B nodelalloc
474The file system will be mounted with the nodelalloc mount option. This
475will disable the delayed allocation feature. (This option is currently
476only supported by the ext4 file system driver in 2.6.35+ kernels.)
Theodore Ts'oa0c3fd52002-10-15 17:43:43 -0400477.RE
478.TP
Theodore Ts'o251395d2001-05-14 04:43:05 +0000479.BR \-O " [^]\fIfeature\fR[,...]"
480Set or clear the indicated filesystem features (options) in the filesystem.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000481More than one filesystem feature can be cleared or set by separating
482features with commas. Filesystem features prefixed with a
483caret character ('^') will be cleared in the filesystem's superblock;
484filesystem features without a prefix character or prefixed with a plus
485character ('+') will be added to the filesystem.
486.IP
487The following filesystem features can be set or cleared using
Theodore Ts'o251395d2001-05-14 04:43:05 +0000488.BR tune2fs :
Theodore Ts'oce57f142001-04-26 04:25:39 +0000489.RS 1.2i
490.TP
Theodore Ts'occbed852003-04-11 13:32:31 -0400491.B dir_index
492Use hashed b-trees to speed up lookups in large directories.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000493.TP
Andreas Dilger25bc8c72011-06-11 11:29:54 -0400494.B dir_nlink
495Allow more than 65000 subdirectories per directory.
496.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000497.B filetype
Theodore Ts'o251395d2001-05-14 04:43:05 +0000498Store file type information in directory entries.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000499.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400500.B flex_bg
501Allow bitmaps and inode tables for a block group to be placed
Theodore Ts'o7a9f0552009-09-07 15:17:51 -0400502anywhere on the storage media. \fBTune2fs\fR will not reorganize
503the location of the inode tables and allocation bitmaps, as
504.BR mke2fs (8)
505will do when it creates a freshly formated file system with
506.B flex_bg
507enabled.
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400508.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000509.B has_journal
Theodore Ts'o82b39c92002-09-29 19:08:38 -0400510Use a journal to ensure filesystem consistency even across unclean shutdowns.
511Setting the filesystem feature is equivalent to using the
Theodore Ts'oce57f142001-04-26 04:25:39 +0000512.B \-j
Theodore Ts'o82b39c92002-09-29 19:08:38 -0400513option.
Theodore Ts'occbed852003-04-11 13:32:31 -0400514.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400515.B large_file
516Filesystem can contain files that are greater than 2GB. (Modern kernels
517set this feature automatically when a file > 2GB is created.)
Theodore Ts'o037914e2008-02-26 17:31:06 -0500518.TP
519.B resize_inode
520Reserve space so the block group descriptor table may grow in the
521future.
522.B Tune2fs
523only supports clearing this filesystem feature.
Jose R. Santos4e988cb2007-10-21 21:03:41 -0500524.TP
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400525.B sparse_super
526Limit the number of backup superblocks to save space on large filesystems.
527.TP
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400528.B uninit_bg
Jose R. Santos4e988cb2007-10-21 21:03:41 -0500529Allow the kernel to initialize bitmaps and inode tables and keep a high
530watermark for the unused inodes in a filesystem, to reduce
531.BR e2fsck (8)
Andreas Dilger4237c732008-03-30 14:13:03 -0400532time. This first e2fsck run after enabling this feature will take the
533full time, but subsequent e2fsck runs will take only a fraction of the
534original time, depending on how full the file system is.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000535.RE
536.IP
Theodore Ts'o39567c42001-09-19 15:28:21 -0400537After setting or clearing
Theodore Ts'o037914e2008-02-26 17:31:06 -0500538.BR sparse_super ,
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400539.BR uninit_bg ,
Theodore Ts'o037914e2008-02-26 17:31:06 -0500540.BR filetype ,
541or
542.B resize_inode
Theodore Ts'o39567c42001-09-19 15:28:21 -0400543filesystem features,
Theodore Ts'oce57f142001-04-26 04:25:39 +0000544.BR e2fsck (8)
Theodore Ts'o251395d2001-05-14 04:43:05 +0000545must be run on the filesystem to return the filesystem to a consistent state.
Theodore Ts'o39567c42001-09-19 15:28:21 -0400546.B Tune2fs
547will print a message requesting that the system administrator run
548.BR e2fsck (8)
Theodore Ts'o45e18ad2004-09-17 17:31:16 -0400549if necessary. After setting the
550.B dir_index
551feature,
552.B e2fsck -D
553can be run to convert existing directories to the hashed B-tree format.
Andreas Dilger4237c732008-03-30 14:13:03 -0400554Enabling certain filesystem features may prevent the filesystem from being
Theodore Ts'o73ebdf92009-09-07 14:53:44 -0400555mounted by kernels which do not support those features. In particular, the
Theodore Ts'o2930dad2008-04-17 23:31:44 -0400556.BR uninit_bg
Andreas Dilger4237c732008-03-30 14:13:03 -0400557and
558.BR flex_bg
559features are only supported by the ext4 filesystem.
Theodore Ts'oce57f142001-04-26 04:25:39 +0000560.TP
561.BI \-r " reserved-blocks-count"
562Set the number of reserved filesystem blocks.
563.TP
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500564.BI \-T " time-last-checked"
565Set the time the filesystem was last checked using
566.BR e2fsck .
Theodore Ts'o402b95d2008-03-21 09:25:23 -0400567The time is interpreted using the current (local) timezone.
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500568This can be useful in scripts which use a Logical Volume Manager to make
569a consistent snapshot of a filesystem, and then check the filesystem
570during off hours to make sure it hasn't been corrupted due to
571hardware problems, etc. If the filesystem was clean, then this option can
572be used to set the last checked time on the original filesystem. The format
573of
574.I time-last-checked
575is the international date format, with an optional time specifier, i.e.
Theodore Ts'o9a85c2a2006-09-12 02:33:08 -0400576YYYYMMDD[HH[MM[SS]]]. The keyword
Theodore Ts'od4de4aa2001-12-26 08:58:01 -0500577.B now
578is also accepted, in which case the last checked time will be set to the
579current time.
580.TP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000581.BI \-u " user"
582Set the user who can use the reserved filesystem blocks.
583.I user
584can be a numerical uid or a user name. If a user name is given, it
585is converted to a numerical uid before it is stored in the superblock.
Theodore Ts'o896938d1999-10-23 01:04:50 +0000586.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000587.BI \-U " UUID"
Theodore Ts'o8d641742001-05-14 04:12:27 +0000588Set the universally unique identifier (UUID) of the filesystem to
Theodore Ts'oce57f142001-04-26 04:25:39 +0000589.IR UUID .
Theodore Ts'of044b4d2002-08-17 13:32:21 -0400590The format of the UUID is a series of hex digits separated by hyphens,
Theodore Ts'oce57f142001-04-26 04:25:39 +0000591like this:
592"c1b9d5a2-f162-11cf-9ece-0020afc76f16".
593The
594.I UUID
595parameter may also be one of the following:
596.RS 1.2i
597.TP
598.I clear
599clear the filesystem UUID
600.TP
601.I random
602generate a new randomly-generated UUID
603.TP
604.I time
605generate a new time-based UUID
606.RE
607.IP
Andreas Dilger2d155762001-08-17 03:48:11 -0600608The UUID may be used by
609.BR mount (8),
610.BR fsck (8),
611and
612.BR /etc/fstab (5)
613(and possibly others) by specifying
614.BI UUID= uuid
615instead of a block special device name like
616.BR /dev/hda1 .
617.IP
Theodore Ts'oce57f142001-04-26 04:25:39 +0000618See
619.BR uuidgen (8)
620for more information.
621If the system does not have a good random number generator such as
622.I /dev/random
623or
624.IR /dev/urandom ,
625.B tune2fs
626will automatically use a time-based UUID instead of a randomly-generated UUID.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000627.SH BUGS
Theodore Ts'o63985322001-01-03 17:02:13 +0000628We haven't found any bugs yet. That doesn't mean there aren't any...
Theodore Ts'o3839e651997-04-26 13:21:57 +0000629.SH AUTHOR
630.B tune2fs
Theodore Ts'o2e5a1b92004-01-31 20:27:36 -0500631was written by Remy Card <Remy.Card@linux.org>. It is currently being
632maintained by Theodore Ts'o <tytso@alum.mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000633.B tune2fs
Theodore Ts'oa418d3a1997-04-26 14:00:26 +0000634uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000635This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
Theodore Ts'o66cf2f62001-06-14 06:42:44 +0000636Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000637.SH AVAILABILITY
638.B tune2fs
Theodore Ts'o12da49c2001-05-12 15:49:17 +0000639is part of the e2fsprogs package and is available from
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000640http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000641.SH SEE ALSO
Andreas Mohr0fd2f902008-02-28 20:50:05 -0500642.BR debugfs (8),
Theodore Ts'o3839e651997-04-26 13:21:57 +0000643.BR dumpe2fs (8),
644.BR e2fsck (8),
645.BR mke2fs (8)