]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - misc/tune2fs.8.in
chattr.1.in: Clarify man page.
[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
a7ac1df3 7tune2fs \- adjust tunable filesystem parameters on ext2/ext3 filesystems
3839e657
TT
8.SH SYNOPSIS
9.B tune2fs
10[
caf8ce4c 11.B \-l
f3db3566
TT
12]
13[
caf8ce4c 14.B \-c
f3db3566
TT
15.I max-mount-counts
16]
17[
caf8ce4c 18.B \-e
f3db3566
TT
19.I errors-behavior
20]
21[
177ab2be
TT
22.B \-f
23]
24[
caf8ce4c 25.B \-i
f3db3566
TT
26.I interval-between-checks
27]
28[
08dd830d 29.B \-j
dc2ec525
TT
30]
31[
32.B \-J
08dd830d
TT
33.I journal-options
34]
35[
caf8ce4c 36.B \-m
f3db3566
TT
37.I reserved-blocks-percentage
38]
a0c3fd5e
TT
39[
40.B \-o
c65e54b0 41.RI [^]mount-options [,...]
a0c3fd5e 42]
f3db3566 43[
caf8ce4c 44.B \-r
f3db3566
TT
45.I reserved-blocks-count
46]
47[
caf8ce4c
TT
48.B \-s
49.I sparse-super-flag
521e3685
TT
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[
caf8ce4c 64.B \-L
1e3472c5
TT
65.I volume-name
66]
67[
caf8ce4c 68.B \-M
1e3472c5
TT
69.I last-mounted-directory
70]
71[
896938d5 72.B \-O
ce57f14f 73.RI [^] feature [,...]
896938d5
TT
74]
75[
d4de4aa9
TT
76.B \-T
77.I time-last-checked
78]
79[
caf8ce4c 80.B \-U
1e3472c5
TT
81.I UUID
82]
3839e657
TT
83device
84.SH DESCRIPTION
85.BI tune2fs
a7ac1df3
TT
86allows the system administrator to adjust various tunable filesystem
87parameters on Linux ext2/ext3 filesystems.
3839e657
TT
88.SH OPTIONS
89.TP
caf8ce4c 90.BI \-c " max-mount-counts"
ce57f14f 91Adjust the maximal mounts count between two filesystem checks. If
45d9e2ff 92.I max-mount-counts
ce57f14f 93is 0 then the number of times the filesystem is mounted will be disregarded
66cf2f60
TT
94by
95.BR e2fsck (8)
96and the kernel.
97.sp
98Staggering the mount-counts at which filesystems are forcibly
99checked will avoid all filesystems being checked at one time
100when using journaled filesystems.
101.sp
102You should strongly consider the consequences of disabling
103mount-count-dependent checking entirely. Bad disk drives, cables,
104memory, and kernel bugs could all corrupt a filesystem without
105marking the filesystem dirty or in error. If you are using
106journaling on your filesystem, your filesystem will
107.B never
108be marked dirty, so it will not normally be checked. A
109filesystem error detected by the kernel will still force
110an fsck on the next reboot, but it may already be too late
111to prevent data loss at that point.
112.sp
113See also the
114.B \-i
115option for time-dependent checking.
3839e657 116.TP
ce57f14f
TT
117.BI \-C " mount-count"
118Set the number of times the filesystem has been mounted.
119Can be used in conjunction with -c to force an fsck on
120the filesystem at the next reboot.
121.TP
caf8ce4c 122.BI \-e " error-behavior"
ce57f14f 123Change the behavior of the kernel code when errors are detected.
66cf2f60
TT
124In all cases, a filesystem error will cause
125.BR e2fsck (8)
126to check the filesystem on the next boot.
583ccdc3
TT
127.I error-behavior
128can be one of the following:
ce57f14f
TT
129.RS 1.2i
130.TP 1.2i
131.B continue
132Continue normal execution.
133.TP
134.B remount-ro
135Remount filesystem read-only.
136.TP
137.B panic
138Cause a kernel panic.
139.RE
3839e657 140.TP
177ab2be
TT
141.B \-f
142Force the tune2fs operation to complete even in the face of errors. This
143option is useful when removing the
144.B has_journal
145filesystem feature from a filesystem which has
146an external journal (or is corrupted
147such that it appears to have an external journal), but that
148external journal is not available.
149.sp
150.B WARNING:
151Removing an external journal from a filesystem which was not cleanly unmounted
152without first replaying the external journal can result in
153severe data loss and filesystem corruption.
154.TP
caf8ce4c 155.BI \-g " group"
ce57f14f
TT
156Set the group which can use reserved filesystem blocks.
157The
f3db3566 158.I group
ce57f14f 159parameter can be a numerical gid or a group name. If a group name is given,
e1c6b2f0 160it is converted to a numerical gid before it is stored in the superblock.
f3db3566 161.TP
ce57f14f
TT
162.B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
163Adjust the maximal time between two filesystem checks.
caf8ce4c
TT
164No postfix or
165.B d
166result in days,
167.B m
168in months, and
169.B w
66cf2f60
TT
170in weeks. A value of zero will disable the time-dependent checking.
171.sp
172It is strongly recommended that either
173.B \-c
174(mount-count-dependent) or
175.B \-i
176(time-dependent) checking be enabled to force periodic full
177.BR e2fsck (8)
178checking of the filesystem. Failure to do so may lead to filesystem
179corruption due to bad disks, cables, memory, or kernel bugs to go
180unnoticed until they cause data loss or corruption.
3839e657 181.TP
66cf2f60 182.B \-j
ce57f14f 183Add an ext3 journal to the filesystem. If the
dc2ec525 184.B \-J
8d641749 185option is not specified, the default journal parameters will be used to create
dc2ec525 186an appropriately sized journal (given the size of the filesystem)
ce57f14f
TT
187stored within the filesystem. Note that you must be using a kernel
188which has ext3 support in order to actually make use of the journal.
dc2ec525 189.TP
8d641749 190.BR \-J " journal-options"
ce57f14f 191Override the default ext3 journal parameters. Journal options are comma
08dd830d 192separated, and may take an argument using the equals ('=') sign.
ce57f14f
TT
193The following journal options are supported:
194.RS 1.2i
dc2ec525 195.TP
ce57f14f 196.BI size= journal-size
dc2ec525 197Create a journal stored in the filesystem of size
251395db
TT
198.I journal-size
199megabytes. The size of the journal must be at least 1024 filesystem blocks
200(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
201and may be no more than 102,400 filesystem blocks.
202There must be enough free space in the filesystem to create a journal of
dc2ec525 203that size.
ce57f14f
TT
204@JDEV@.TP
205@JDEV@.BI device= external-journal
251395db
TT
206@JDEV@Attach the filesystem to the journal block device located on
207@JDEV@.IR external-journal .
ce57f14f
TT
208@JDEV@The external
209@JDEV@journal must have been already created using the command
251395db 210@JDEV@.IP
ce57f14f 211@JDEV@.B mke2fs -O journal_dev
e9a2d071 212@JDEV@.I external-journal
251395db
TT
213@JDEV@.IP
214@JDEV@Note that
215@JDEV@.I external-journal
216@JDEV@must be formatted with the same block
217@JDEV@size as filesystems which will be using it.
2d15576d
AD
218@JDEV@.IP
219@JDEV@Instead of specifying a device name directly,
220@JDEV@.I external-journal
221@JDEV@can also be specified by either
222@JDEV@.BI LABEL= label
223@JDEV@or
224@JDEV@.BI UUID= UUID
225@JDEV@to locate the external journal by either the volume label or UUID
226@JDEV@stored in the ext2 superblock at the start of the journal. Use
227@JDEV@.BR dumpe2fs (8)
228@JDEV@to display a journal device's volume label and UUID. See also the
229@JDEV@.B -L
230@JDEV@option of
231@JDEV@.BR tune2fs (8).
ce57f14f
TT
232.RE
233@JDEV@.IP
234@JDEV@Only one of the
235@JDEV@.BR size " or " device
236@JDEV@options can be given for a filesystem.
08dd830d 237.TP
caf8ce4c 238.B \-l
ce57f14f
TT
239List the contents of the filesystem superblock.
240.TP
241.BI \-L " volume-label"
242Set the volume label of the filesystem.
243Ext2 filesystem labels can be at most 16 characters long; if
244.I volume-label
245is longer than 16 characters,
246.B tune2fs
2d15576d
AD
247will truncate it and print a warning. The volume label can be used
248by
249.BR mount (8),
250.BR fsck (8),
251and
252.BR /etc/fstab (5)
253(and possibly others) by specifying
254.BI LABEL= volume_label
255instead of a block special device name like
256.BR /dev/hda5 .
3839e657 257.TP
caf8ce4c 258.BI \-m " reserved-blocks-percentage"
ce57f14f
TT
259Set the percentage of reserved filesystem blocks.
260.TP
261.BI \-M " last-mounted-directory"
262Set the last-mounted directory for the filesystem.
263.TP
a0c3fd5e
TT
264.BR \-o " [^]\fImount-option\fR[,...]"
265Set or clear the indicated default mount options in the filesystem.
266Default mount options can be overriden by mount options specified
267either in
268.BR /etc/fstab (5)
269or on the command line arguments to
270.BR mount (8).
271Older kernels may not support this feature; in particular,
272kernels which predate 2.4.20 will almost certainly ignore the
273default mount options field in the superblock.
274.IP
275More than one mount option can be cleared or set by separating
276features with commas. Mount options prefixed with a
277caret character ('^') will be cleared in the filesystem's superblock;
278mount options without a prefix character or prefixed with a plus
279character ('+') will be added to the filesystem.
280.IP
281The following mount options can be set or cleared using
282.BR tune2fs :
283.RS 1.2i
284.TP
285.B debug
286Enable debugging code for this filesystem.
287.TP
288.B bsdgroups
289Emulate BSD behaviour when creating new files: they will take the group-id
290of the directory in which they were created. The standard System V behaviour
77be4d2d 291is the default, where newly created files take on the fsgid of the current
a0c3fd5e
TT
292process, unless the directry has the setgid bit set, in which case it takes
293the gid from the parent directory, and also gets the setgid bit set if it is
294directory itself.
295.TP
296.B user_xattr
297Enable user-specified extended attributes.
298.TP
299.B acl
300Enable Posix Access Control Lists.
301.TP
302.B uid16
303Disables 32-bit UIDs and GIDs. This is for interoperability with
304older kernels which only store and expect 16-bit values.
2bae543e
TT
305.TP
306.B journal_data
307When the filesystem is mounted with journalling enabled, all data
308(not just metadata) is committed into the journal prior to being written
309into the main filesystem.
310.TP
311.B journal_data_ordered
312When the filesystem is mounted with journalling enabled, all data is forced
313directly out to the main file system prior to its metadata being commutted
314to the journal.
315.TP
316.B journal_data_writeback
317When the filesystem is mounted with journalling enabled, data may be
318written into the main filesystem after its metadata has been commutted
319to the journal. This may increase throughput, however, it may allow old
320data to appear in files after a crash and journal recovery.
a0c3fd5e
TT
321.RE
322.TP
251395db
TT
323.BR \-O " [^]\fIfeature\fR[,...]"
324Set or clear the indicated filesystem features (options) in the filesystem.
ce57f14f
TT
325More than one filesystem feature can be cleared or set by separating
326features with commas. Filesystem features prefixed with a
327caret character ('^') will be cleared in the filesystem's superblock;
328filesystem features without a prefix character or prefixed with a plus
329character ('+') will be added to the filesystem.
330.IP
331The following filesystem features can be set or cleared using
251395db 332.BR tune2fs :
ce57f14f
TT
333.RS 1.2i
334.TP
ccbed85a
TT
335.B dir_index
336Use hashed b-trees to speed up lookups in large directories.
ce57f14f
TT
337.TP
338.B filetype
251395db 339Store file type information in directory entries.
ce57f14f
TT
340.TP
341.B has_journal
82b39c9f
TT
342Use a journal to ensure filesystem consistency even across unclean shutdowns.
343Setting the filesystem feature is equivalent to using the
ce57f14f 344.B \-j
82b39c9f 345option.
ccbed85a
TT
346.TP
347.B sparse_super
348Limit the number of backup superblocks to save space on large filesystems.
ce57f14f
TT
349.RE
350.IP
39567c44
TT
351After setting or clearing
352.B sparse_super
353and
354.B filetype
355filesystem features,
ce57f14f 356.BR e2fsck (8)
251395db 357must be run on the filesystem to return the filesystem to a consistent state.
39567c44
TT
358.B Tune2fs
359will print a message requesting that the system administrator run
360.BR e2fsck (8)
361if necessary.
ce57f14f
TT
362.IP
363.B Warning:
251395db
TT
364Linux kernels before 2.0.39 and many 2.1 series kernels do not support
365the filesystems that use any of these features.
366Enabling certain filesystem features may prevent the filesystem from
367being mounted by kernels which do not support those features.
f3db3566 368.TP
caf8ce4c 369.BI \-r " reserved-blocks-count"
ce57f14f 370Set the number of reserved filesystem blocks.
f3db3566 371.TP
251395db
TT
372.BR \-s " [" 0 | 1 ]
373Turn the sparse super feature off or on. Turning this feature on
ce57f14f
TT
374saves space on really big filesystems. This is the same as using the
375.B "\-O sparse_super"
376option.
377.IP
a29f4d30 378.B Warning:
251395db 379Linux kernels before 2.0.39 do not support this feature. Neither do
a29f4d30 380all Linux 2.1 kernels; please don't use this unless you know what you're
ce57f14f
TT
381doing! You need to run
382.BR e2fsck (8)
383on the filesystem after changing this feature in order to have a valid
384filesystem.
521e3685 385.TP
d4de4aa9
TT
386.BI \-T " time-last-checked"
387Set the time the filesystem was last checked using
388.BR e2fsck .
389This can be useful in scripts which use a Logical Volume Manager to make
390a consistent snapshot of a filesystem, and then check the filesystem
391during off hours to make sure it hasn't been corrupted due to
392hardware problems, etc. If the filesystem was clean, then this option can
393be used to set the last checked time on the original filesystem. The format
394of
395.I time-last-checked
396is the international date format, with an optional time specifier, i.e.
397YYYYMMDD[[HHMM]SS]. The keyword
398.B now
399is also accepted, in which case the last checked time will be set to the
400current time.
401.TP
caf8ce4c 402.BI \-u " user"
ce57f14f 403Set the user who can use the reserved filesystem blocks.
f3db3566 404.I user
e1c6b2f0
TT
405can be a numerical uid or a user name. If a user name is given, it
406is converted to a numerical uid before it is stored in the superblock.
1dde43f0 407.TP
ce57f14f 408.BI \-U " UUID"
8d641749 409Set the universally unique identifier (UUID) of the filesystem to
ce57f14f 410.IR UUID .
f044b4d8 411The format of the UUID is a series of hex digits separated by hyphens,
ce57f14f
TT
412like this:
413"c1b9d5a2-f162-11cf-9ece-0020afc76f16".
414The
415.I UUID
416parameter may also be one of the following:
417.RS 1.2i
1e3472c5 418.TP
ce57f14f
TT
419.I clear
420clear the filesystem UUID
1e3472c5 421.TP
ce57f14f
TT
422.I random
423generate a new randomly-generated UUID
896938d5 424.TP
ce57f14f
TT
425.I time
426generate a new time-based UUID
427.RE
428.IP
2d15576d
AD
429The UUID may be used by
430.BR mount (8),
431.BR fsck (8),
432and
433.BR /etc/fstab (5)
434(and possibly others) by specifying
435.BI UUID= uuid
436instead of a block special device name like
437.BR /dev/hda1 .
438.IP
ce57f14f
TT
439See
440.BR uuidgen (8)
441for more information.
442If the system does not have a good random number generator such as
443.I /dev/random
444or
445.IR /dev/urandom ,
446.B tune2fs
447will automatically use a time-based UUID instead of a randomly-generated UUID.
3839e657 448.SH BUGS
63985320 449We haven't found any bugs yet. That doesn't mean there aren't any...
3839e657
TT
450.SH AUTHOR
451.B tune2fs
2e5a1b9e
TT
452was written by Remy Card <Remy.Card@linux.org>. It is currently being
453maintained by Theodore Ts'o <tytso@alum.mit.edu>.
3839e657 454.B tune2fs
a418d3ad 455uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
3839e657 456This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
66cf2f60 457Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
3839e657
TT
458.SH AVAILABILITY
459.B tune2fs
12da49c9 460is part of the e2fsprogs package and is available from
348e43dc 461http://e2fsprogs.sourceforge.net.
3839e657
TT
462.SH SEE ALSO
463.BR dumpe2fs (8),
464.BR e2fsck (8),
465.BR mke2fs (8)