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