]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - misc/mke2fs.conf.5.in
tune2fs: don't recover journal if device is busy.
[thirdparty/e2fsprogs.git] / misc / mke2fs.conf.5.in
CommitLineData
9dc6ad1e
TT
1.\" -*- nroff -*-
2.\" Copyright 2006 by Theodore Ts'o. All Rights Reserved.
3.\" This file may be copied under the terms of the GNU Public License.
f9b16db8 4.\"
9dc6ad1e
TT
5.TH mke2fs.conf 5 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6.SH NAME
7mke2fs.conf \- Configuration file for mke2fs
8.SH DESCRIPTION
9.I mke2fs.conf
f9b16db8
TT
10is the configuration file for
11.BR mke2fs (8).
12It controls the default parameters used by
9dc6ad1e 13.BR mke2fs (8)
626a2e74 14when it is creating ext2, ext3, or ext4 filesystems.
9dc6ad1e
TT
15.PP
16The
17.I mke2fs.conf
f9b16db8
TT
18file uses an INI-style format. Stanzas, or top-level sections, are
19delimited by square braces: [ ]. Within each section, each line
fac9525e 20defines a relation, which assigns tags to values, or to a subsection,
f9b16db8 21which contains further relations or subsections.
9dc6ad1e 22.\" Tags can be assigned multiple values
f9b16db8 23An example of the INI-style format used by this configuration file
9dc6ad1e
TT
24follows below:
25.P
fac9525e 26 [section1]
9dc6ad1e 27.br
fac9525e 28 tag1 = value_a
9dc6ad1e 29.br
fac9525e 30 tag1 = value_b
9dc6ad1e 31.br
fac9525e 32 tag2 = value_c
9dc6ad1e 33.P
fac9525e 34 [section 2]
9dc6ad1e 35.br
fac9525e 36 tag3 = {
9dc6ad1e 37.br
fac9525e 38 subtag1 = subtag_value_a
9dc6ad1e 39.br
fac9525e 40 subtag1 = subtag_value_b
9dc6ad1e 41.br
fac9525e 42 subtag2 = subtag_value_c
9dc6ad1e 43.br
fac9525e 44 }
9dc6ad1e 45.br
fac9525e 46 tag1 = value_d
9dc6ad1e 47.br
fac9525e 48 tag2 = value_e
9dc6ad1e 49.br
fac9525e
TT
50 }
51.P
f9b16db8
TT
52Comments are delimited by a semicolon (';') or a hash ('#') character
53at the beginning of the comment, and are terminated by the end of
fac9525e
TT
54line character.
55.P
56Tags and values must be quoted using double quotes if they contain
f9b16db8
TT
57spaces. Within a quoted string, the standard backslash interpretations
58apply: "\en" (for the newline character),
59"\et" (for the tab character), "\eb" (for the backspace character),
fac9525e 60and "\e\e" (for the backslash character).
9dc6ad1e 61.P
27b422f5
TT
62Some relations expect a boolean value. The parser is quite liberal on
63recognizing ``yes'', '`y'', ``true'', ``t'', ``1'', ``on'', etc. as a
64boolean true value, and ``no'', ``n'', ``false'', ``nil'', ``0'',
65``off'' as a boolean false value.
66.P
f9b16db8 67The following stanzas are used in the
9dc6ad1e
TT
68.I mke2fs.conf
69file. They will be described in more detail in future sections of this
70document.
f83f4132
TT
71.TP
72.I [options]
73Contains relations which influence how mke2fs behaves.
74.TP
9dc6ad1e 75.I [defaults]
4c2b28ab 76Contains relations which define the default parameters
9dc6ad1e
TT
77used by
78.BR mke2fs (8).
79In general, these defaults may be overridden by a definition in the
80.B fs_types
75dd3c47 81stanza, or by a command-line option provided by the user.
f9b16db8 82.TP
9dc6ad1e
TT
83.I [fs_types]
84Contains relations which define defaults that should be used for specific
f9b16db8
TT
85file system and usage types. The file system type and usage type can be
86specified explicitly using
87the
88.BR \-t and \-T
89options to
90.BR mke2fs (8),
91respectively.
75dd3c47
TN
92.TP
93.I [devices]
94Contains relations which define defaults for specific devices.
f83f4132
TT
95.SH THE [options] STANZA
96The following relations are defined in the
97.I [options]
98stanza.
99.TP
100.I proceed_delay
101If this relation is set to a positive integer, then if mke2fs will
102proceed after waiting
103.I proceed_delay
104seconds, after asking the user for permission to proceed, even if the
105user has not answered the question. Defaults to 0, which means to wait
106until the user answers the question one way or another.
fac9525e 107.SH THE [defaults] STANZA
f9b16db8 108The following relations are defined in the
9dc6ad1e 109.I [defaults]
fac9525e 110stanza.
9dc6ad1e 111.TP
3d43836f
TT
112.I fs_type
113This relation specifies the default filesystem type if the user does not
114specify it via the
115.B \-t
116option, or if
117.B mke2fs
118is not started using a program name of the form
119.BI mkfs. fs-type\fR.
120If both the user and the
121.B mke2fs.conf
f9b16db8 122file do not specify a default filesystem type, mke2fs will use a
3d43836f
TT
123default filesystem type of
124.IR ext3
125if a journal was requested via a command-line option, or
126.I ext2
127if not.
128.TP
b626b39a
AK
129.I undo_dir
130This relation specifies the directory where the undo file should be
711d3846 131stored. It can be overridden via the
b626b39a 132.B E2FSPROGS_UNDO_DIR
711d3846 133environment variable. If the directory location is set to the value
b626b39a
AK
134.IR none ,
135.B mke2fs
136will not create an undo file.
f9b16db8
TT
137.PP
138In addition, any tags that can be specified in a per-file system tags
139subsection as defined below (e.g.,
140.IR blocksize ,
141.IR hash_alg ,
142.IR inode_ratio ,
143.IR inode_size ,
144.IR reserved_ratio ,
145etc.) can also be specified in the
146.I defaults
147stanza to specify the default value to be used if the user does not
148specify one on the command line, and the filesystem-type
149specific section of the configuration file does not specify a default value.
fac9525e 150.SH THE [fs_types] STANZA
9dc6ad1e 151Each tag in the
f9b16db8 152.I [fs_types]
3d43836f
TT
153stanza names a filesystem type or usage type which can be specified via the
154.B \-t
155or
156.B \-T
157options to
158.BR mke2fs (8),
159respectively.
160.P
161The
162.B mke2fs
163program constructs a list of fs_types by concatenating the filesystem
164type (i.e., ext2, ext3, etc.) with the usage type list. For most
165configuration options,
166.B mke2fs
167will look for a subsection in the
168.I [fs_types]
169stanza corresponding with each entry in the constructed list, with later
170entries overriding earlier filesystem or usage types.
171For
172example, consider the following
173.B mke2fs.conf
174fragment:
9dc6ad1e 175.P
3d43836f
TT
176[defaults]
177.br
178 base_features = sparse_super,filetype,resize_inode,dir_index
179.br
180 blocksize = 4096
181.br
182 inode_size = 256
183.br
184 inode_ratio = 16384
185.br
186
187.br
9dc6ad1e 188[fs_types]
3d43836f
TT
189.br
190 ext3 = {
191.br
192 features = has_journal
193.br
194 }
195.br
196 ext4 = {
197.br
198 features = extents,flex_bg
199.br
200 inode_size = 256
201.br
202 }
9dc6ad1e
TT
203.br
204 small = {
205.br
206 blocksize = 1024
207.br
208 inode_ratio = 4096
209.br
210 }
211.br
212 floppy = {
3d43836f
TT
213.br
214 features = ^resize_inode
9dc6ad1e
TT
215.br
216 blocksize = 1024
3d43836f
TT
217.br
218 inode_size = 128
9dc6ad1e
TT
219.br
220 }
221.P
3d43836f
TT
222If mke2fs started with a program name of
223.BR mke2fs.ext4 ,
224then the filesystem type of ext4 will be used. If the filesystem is
225smaller than 3 megabytes, and no usage type is specified, then
226.B mke2fs
227will use a default
228usage type of
229.IR floppy .
230This results in an fs_types list of "ext4, floppy". Both the ext4
231subsection and the floppy subsection define an
232.I inode_size
711d3846 233relation, but since the later entries in the fs_types list supersede
3d43836f
TT
234earlier ones, the configuration parameter for fs_types.floppy.inode_size
235will be used, so the filesystem will have an inode size of 128.
236.P
237The exception to this resolution is the
238.I features
f9b16db8 239tag, which specifies a set of changes to the features used by the
3d43836f
TT
240filesystem, and which is cumulative. So in the above example, first
241the configuration relation defaults.base_features would enable an
242initial feature set with the sparse_super, filetype, resize_inode, and
243dir_index features enabled. Then configuration relation
244fs_types.ext4.features would enable the extents and flex_bg
245features, and finally the configuration relation
246fs_types.floppy.features would remove
247the resize_inode feature, resulting in a filesystem feature set
f9b16db8 248consisting of the sparse_super, filetype, dir_index,
3d43836f
TT
249extents_and flex_bg features.
250.P
f9b16db8
TT
251For each filesystem type, the following tags may be used in that
252fs_type's subsection. These tags may also be used in the
253.I default
254section:
9dc6ad1e
TT
255.TP
256.I base_features
3d43836f
TT
257This relation specifies the features which are initially enabled for this
258filesystem type. Only one
259.I base_features
260will be used, so if there are multiple entries in the fs_types list
261whose subsections define the
262.I base_features
263relation, only the last will be used by
264.BR mke2fs (8).
265.TP
75dd3c47
TN
266.I enable_periodic_fsck
267This boolean relation specifies whether periodic filesystem checks should be
268enforced at boot time. If set to true, checks will be forced every
269180 days, or after a random number of mounts. These values may
270be changed later via the
271.B -i
272and
273.B -c
274command-line options to
275.BR tune2fs (8).
276.TP
cd32129d
DW
277.I errors
278Change the behavior of the kernel code when errors are detected.
279In all cases, a filesystem error will cause
280.BR e2fsck (8)
281to check the filesystem on the next boot.
282.I errors
283can be one of the following:
284.RS 1.2i
285.TP 1.2i
286.B continue
287Continue normal execution.
288.TP
289.B remount-ro
290Remount filesystem read-only.
291.TP
292.B panic
293Cause a kernel panic.
294.RE
295.TP
3d43836f
TT
296.I features
297This relation specifies a comma-separated list of features edit
298requests which modify the feature set
299used by the newly constructed filesystem. The syntax is the same as the
300.B -O
301command-line option to
302.BR mke2fs (8);
303that is, a feature can be prefixed by a caret ('^') symbol to disable
304a named feature. Each
305.I feature
306relation specified in the fs_types list will be applied in the order
307found in the fs_types list.
9dc6ad1e 308.TP
75dd3c47
TN
309.I force_undo
310This boolean relation, if set to a value of true, forces
311.B mke2fs
312to always try to create an undo file, even if the undo file might be
313huge and it might extend the time to create the filesystem image
314because the inode table isn't being initialized lazily.
315.TP
9dc6ad1e 316.I default_features
f9b16db8 317This relation specifies set of features which should be enabled or
3d43836f 318disabled after applying the features listed in the
9dc6ad1e 319.I base_features
3d43836f
TT
320and
321.I features
322relations. It may be overridden by the
9dc6ad1e
TT
323.B -O
324command-line option to
325.BR mke2fs (8).
326.TP
493024ea
TT
327.I auto_64-bit_support
328This relation is a boolean which specifies whether
329.BR mke2fs (8)
330should automatically add the 64bit feature if the number of blocks for
331the file system requires this feature to be enabled. The resize_inode
332feature is also automatically disabled since it doesn't support 64-bit
333block numbers.
334.TP
6a426c97
ES
335.I default_mntopts
336This relation specifies the set of mount options which should be enabled
337by default. These may be changed at a later time with the
338.B -o
339command-line option to
340.BR tune2fs (8).
341.TP
9dc6ad1e
TT
342.I blocksize
343This relation specifies the default blocksize if the user does not
344specify a blocksize on the command line.
345.TP
a4396e9d 346.I lazy_itable_init
f9b16db8 347This boolean relation specifies whether the inode table should
a4396e9d
TT
348be lazily initialized. It only has meaning if the uninit_bg feature is
349enabled. If lazy_itable_init is true and the uninit_bg feature is
350enabled, the inode table will
f9b16db8 351not be fully initialized by
a4396e9d
TT
352.BR mke2fs (8).
353This speeds up filesystem
711d3846 354initialization noticeably, but it requires the kernel to finish
a4396e9d
TT
355initializing the filesystem in the background when the filesystem is
356first mounted.
357.TP
75dd3c47
TN
358.I lazy_journal_init
359This boolean relation specifies whether the journal inode should be
360lazily initialized. It only has meaning if the has_journal feature is
361enabled. If lazy_journal_init is true, the journal inode will not be
362fully zeroed out by
363.BR mke2fs .
364This speeds up filesystem initialization noticeably, but carries some
365small risk if the system crashes before the journal has been overwritten
366entirely one time.
367.TP
b818205f
TT
368.I journal_location
369This relation specifies the location of the journal.
370.TP
65c6c3e0
TT
371.I num_backup_sb
372This relation indicates whether file systems with the
373.B sparse_super2
374feature enabled should be created with 0, 1, or 2 backup superblocks.
375.TP
3c6e91c5 376.I packed_meta_blocks
ce20096f 377This boolean relation specifies whether the allocation bitmaps, inode
3c6e91c5
TT
378table, and journal should be located at the beginning of the file system.
379.TP
9dc6ad1e
TT
380.I inode_ratio
381This relation specifies the default inode ratio if the user does not
382specify one on the command line.
067911ae
AD
383.TP
384.I inode_size
385This relation specifies the default inode size if the user does not
386specify one on the command line.
9ba40002 387.TP
d3859af3
AK
388.I reserved_ratio
389This relation specifies the default percentage of filesystem blocks
390reserved for the super-user, if the user does not specify one on the command
391line.
392.TP
d5f57d95
TT
393.I hash_alg
394This relation specifies the default hash algorithm used for the
395new filesystems with hashed b-tree directories. Valid algorithms
396accepted are:
397.IR legacy ,
398.IR half_md4 ,
399and
400.IR tea .
401.TP
9ba40002 402.I flex_bg_size
d4a93302 403This relation specifies the number of block groups that will be packed
9ba40002
TT
404together to create one large virtual block group on an ext4 filesystem.
405This improves meta-data locality and performance on meta-data heavy
d4a93302 406workloads. The number of groups must be a power of 2 and may only be
9ba40002 407specified if the flex_bg filesystem feature is enabled.
b75a4ce1 408.TP
2d36358d
TT
409.I options
410This relation specifies additional extended options which should be
411treated by
412.BR mke2fs (8)
413as if they were prepended to the argument of the
414.B -E
415option. This can be used to configure the default extended options used
416by
417.BR mke2fs (8)
418on a per-filesystem type basis.
7fe5ff3c
LC
419.TP
420.I discard
27b422f5 421This boolean relation specifies whether the
7fe5ff3c
LC
422.BR mke2fs (8)
423should attempt to discard device prior to filesystem creation.
2d34a25f
TT
424.TP
425.I cluster_size
426This relation specifies the default cluster size if the bigalloc file
427system feature is enabled. It can be overridden via the
428.B \-C
429command line option to
430.BR mke2fs (8)
23a1b987
TT
431.TP
432.I make_hugefiles
433This boolean relation enables the creation of pre-allocated files as
fff2d127
TT
434part of formatting the file system. The extent tree blocks for these
435pre-allocated files will be placed near the beginning of the file
436system, so that if all of the other metadata blocks are also configured
437to be placed near the beginning of the file system (by disabling the
438backup superblocks, using the packed_meta_blocks option, etc.), the data
439blocks of the pre-allocated files will be contiguous.
23a1b987 440.TP
75dd3c47
TN
441.I hugefiles_dir
442This relation specifies the directory where huge files are created,
443relative to the filesystem root.
444.TP
23a1b987
TT
445.I hugefiles_uid
446This relation controls the user ownership for all of the files and
447directories created by the
448.I make_hugefiles
449feature.
450.TP
451.I hugefiles_gid
452This relation controls the group ownership for all of the files and
453directories created by the
454.I make_hugefiles
455feature.
456.TP
457.I hugefiles_umask
458This relation specifies the umask used when creating the files and
459directories by the
460.I make_hugefiles
461feature.
462.TP
463.I num_hugefiles
464This relation specifies the number of huge files to be created. If this
465relation is not specified, or is set to zero, and the
466.I hugefiles_size
467relation is non-zero, then
468.I make_hugefiles
469will create as many huge files as can fit to fill the entire file system.
470.TP
471.I hugefiles_slack
472This relation specifies how much space should be reserved for other
473files.
474.TP
475.I hugefiles_size
476This relation specifies the size of the huge files. If this relation is
7efd2507
TT
477not specified, the default is to fill the entire file system.
478.TP
479.I hugefiles_align
480This relation specifies the alignment for the start block of the huge
481files. It also forces the size of huge files to be a multiple of the
482requested alignment. If this relation is not specified, no alignment
483requirement will be imposed on the huge files.
23a1b987 484.TP
c42de75b 485.I hugefiles_align_disk
78b7cd3b 486This relations specifies whether the alignment should be relative to the
c42de75b
TT
487beginning of the hard drive (assuming that the starting offset of the
488partition is available to mke2fs). The default value is false, which
f9b16db8 489will cause hugefile alignment to be relative to the beginning of the
c42de75b
TT
490file system.
491.TP
23a1b987
TT
492.I hugefiles_name
493This relation specifies the base file name for the huge files.
494.TP
495.I hugefiles_digits
496This relation specifies the (zero-padded) width of the field for the
497huge file number.
498.TP
499.I zero_hugefiles
500This boolean relation specifies whether or not zero blocks will be
501written to the hugefiles while
502.BR mke2fs(8)
503is creating them. By default, zero blocks will be written to the huge
504files to avoid stale data from being made available to potentially
505untrusted user programs, unless the device supports a discard/trim
f9b16db8 506operation which will take care of zeroing the device blocks. By setting
23a1b987
TT
507.I zero_hugefiles
508to false, this step will always be skipped, which can be useful if it is
509known that the disk has been previously erased, or if the user programs
510that will have access to the huge files are trusted to not reveal stale
511data.
4c2b28ab
TT
512.SH THE [devices] STANZA
513Each tag in the
f9b16db8 514.I [devices]
4c2b28ab
TT
515stanza names device name so that per-device defaults can be specified.
516.TP
517.I fs_type
518This relation specifies the default parameter for the
519.B \-t
520option, if this option isn't specified on the command line.
521.TP
522.I usage_types
523This relation specifies the default parameter for the
524.B \-T
525option, if this option isn't specified on the command line.
9dc6ad1e
TT
526.SH FILES
527.TP
528.I /etc/mke2fs.conf
f9b16db8 529The configuration file for
9dc6ad1e
TT
530.BR mke2fs (8).
531.SH SEE ALSO
532.BR mke2fs (8)