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