blob: 19458ac306ec6f9b538d0b540ab601129f2f4848 [file] [log] [blame]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -05001.\" -*- 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.
4.\"
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
10is the configuration file for
11.BR mke2fs (8).
12It controls the default parameters used by
13.BR mke2fs (8)
Theodore Ts'o626a2e72013-06-15 21:19:39 -040014when it is creating ext2, ext3, or ext4 filesystems.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050015.PP
16The
17.I mke2fs.conf
Theodore Ts'ofac95252006-03-27 01:05:26 -050018file uses an INI-style format. Stanzas, or top-level sections, are
19delimited by square braces: [ ]. Within each section, each line
20defines a relation, which assigns tags to values, or to a subsection,
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050021which contains further relations or subsections.
22.\" Tags can be assigned multiple values
23An example of the INI-style format used by this configuration file
24follows below:
25.P
Theodore Ts'ofac95252006-03-27 01:05:26 -050026 [section1]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050027.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050028 tag1 = value_a
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050029.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050030 tag1 = value_b
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050031.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050032 tag2 = value_c
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050033.P
Theodore Ts'ofac95252006-03-27 01:05:26 -050034 [section 2]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050035.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050036 tag3 = {
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050037.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050038 subtag1 = subtag_value_a
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050039.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050040 subtag1 = subtag_value_b
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050041.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050042 subtag2 = subtag_value_c
43.br
44 }
45.br
46 tag1 = value_d
47.br
48 tag2 = value_e
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050049.br
50 }
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050051.P
Theodore Ts'ofac95252006-03-27 01:05:26 -050052Comments are delimited by a semicolon (';') or a hash ('#') character
53at the beginning of the comment, and are terminated by the end of
54line character.
55.P
56Tags and values must be quoted using double quotes if they contain
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),
60and "\e\e" (for the backslash character).
61.P
Theodore Ts'o27b422f2011-09-30 18:32:44 -040062Some 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
Theodore Ts'o9447f382006-05-22 17:59:37 -040067The following stanzas are used in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050068.I mke2fs.conf
69file. They will be described in more detail in future sections of this
70document.
Theodore Ts'of83f4132014-04-26 17:34:52 -040071.TP
72.I [options]
73Contains relations which influence how mke2fs behaves.
74.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050075.I [defaults]
Theodore Ts'o4c2b28a2011-06-14 14:17:56 -040076Contains relations which define the default parameters
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050077used by
78.BR mke2fs (8).
79In general, these defaults may be overridden by a definition in the
80.B fs_types
Theodore Ts'ofac95252006-03-27 01:05:26 -050081stanza, or by an command-line option provided by the user.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050082.TP
83.I [fs_types]
84Contains relations which define defaults that should be used for specific
85filesystem types. The filesystem type can be specified explicitly using
86the
87.B -T
88option to
89.BR mke2fs (8).
Theodore Ts'of83f4132014-04-26 17:34:52 -040090.SH THE [options] STANZA
91The following relations are defined in the
92.I [options]
93stanza.
94.TP
95.I proceed_delay
96If this relation is set to a positive integer, then if mke2fs will
97proceed after waiting
98.I proceed_delay
99seconds, after asking the user for permission to proceed, even if the
100user has not answered the question. Defaults to 0, which means to wait
101until the user answers the question one way or another.
Theodore Ts'ofac95252006-03-27 01:05:26 -0500102.SH THE [defaults] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500103The following relations are defined in the
104.I [defaults]
Theodore Ts'ofac95252006-03-27 01:05:26 -0500105stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500106.TP
107.I base_features
108This relation specifies the filesystems features which are enabled in
Theodore Ts'o9447f382006-05-22 17:59:37 -0400109newly created filesystems. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500110.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500111relation found in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500112the
113.I [fs_types]
Theodore Ts'ofac95252006-03-27 01:05:26 -0500114stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500115.TP
116.I default_features
117This relation specifies a set of features that should be added or
118removed to the features listed in the
119.I base_features
Theodore Ts'o9447f382006-05-22 17:59:37 -0400120relation. It may be overridden by the filesystem-specific
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500121.I default_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500122in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500123.IR [fs_types] ,
124and by the
125.B -O
126command-line option
127to
128.BR mke2fs (8).
129.TP
Eric Sandeen3daf5922011-02-17 15:55:15 -0600130.I enable_periodic_fsck
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400131This boolean relation specifies whether periodic filesystem checks should be
132enforced at boot time. If set to true, checks will be forced every
Eric Sandeen3daf5922011-02-17 15:55:15 -0600133180 days, or after a random number of mounts. These values may
134be changed later via the
135.B -i
136and
137.B -c
138command-line options to
139.BR tune2fs (8).
140.TP
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530141.I force_undo
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400142This boolean relation, if set to a value of true, forces
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530143.B mke2fs
144to always try to create an undo file, even if the undo file might be
145huge and it might extend the time to create the filesystem image
146because the inode table isn't being initialized lazily.
147.TP
Theodore Ts'o3d438362008-02-19 08:32:58 -0500148.I fs_type
149This relation specifies the default filesystem type if the user does not
150specify it via the
151.B \-t
152option, or if
153.B mke2fs
154is not started using a program name of the form
155.BI mkfs. fs-type\fR.
156If both the user and the
157.B mke2fs.conf
158file does not specify a default filesystem type, mke2fs will use a
159default filesystem type of
160.IR ext3
161if a journal was requested via a command-line option, or
162.I ext2
163if not.
164.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500165.I blocksize
166This relation specifies the default blocksize if the user does not
167specify a blocksize on the command line, and the filesystem-type
168specific section of the configuration file does not specify a blocksize.
169.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400170.I hash_alg
171This relation specifies the default hash algorithm used for the
172new filesystems with hashed b-tree directories. Valid algorithms
173accepted are:
174.IR legacy ,
175.IR half_md4 ,
176and
177.IR tea .
178.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500179.I inode_ratio
180This relation specifies the default inode ratio if the user does not
181specify one on the command line, and the filesystem-type
182specific section of the configuration file does not specify a default
183inode ratio.
Andreas Dilger067911a2006-07-15 22:08:20 -0400184.TP
185.I inode_size
186This relation specifies the default inode size if the user does not
187specify one on the command line, and the filesystem-type
188specific section of the configuration file does not specify a default
189inode size.
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530190.TP
Aditya Kalid3859af2011-05-10 14:51:31 -0700191.I reserved_ratio
192This relation specifies the default percentage of filesystem blocks
193reserved for the super-user, if the user does not
194specify one on the command line, and the filesystem-type
195specific section of the configuration file does not specify a default
196reserved ratio. This value can be a floating point number.
197.TP
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530198.I undo_dir
199This relation specifies the directory where the undo file should be
Theodore Ts'o711d3842008-09-07 14:08:40 -0400200stored. It can be overridden via the
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530201.B E2FSPROGS_UNDO_DIR
Theodore Ts'o711d3842008-09-07 14:08:40 -0400202environment variable. If the directory location is set to the value
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530203.IR none ,
204.B mke2fs
205will not create an undo file.
Theodore Ts'ofac95252006-03-27 01:05:26 -0500206.SH THE [fs_types] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500207Each tag in the
208.I [fs_types]
Theodore Ts'o3d438362008-02-19 08:32:58 -0500209stanza names a filesystem type or usage type which can be specified via the
210.B \-t
211or
212.B \-T
213options to
214.BR mke2fs (8),
215respectively.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500216.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500217The
218.B mke2fs
219program constructs a list of fs_types by concatenating the filesystem
220type (i.e., ext2, ext3, etc.) with the usage type list. For most
221configuration options,
222.B mke2fs
223will look for a subsection in the
224.I [fs_types]
225stanza corresponding with each entry in the constructed list, with later
226entries overriding earlier filesystem or usage types.
227For
228example, consider the following
229.B mke2fs.conf
230fragment:
231.P
232[defaults]
233.br
234 base_features = sparse_super,filetype,resize_inode,dir_index
235.br
236 blocksize = 4096
237.br
238 inode_size = 256
239.br
240 inode_ratio = 16384
241.br
242
243.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500244[fs_types]
245.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500246 ext3 = {
247.br
248 features = has_journal
249.br
250 }
251.br
252 ext4 = {
253.br
254 features = extents,flex_bg
255.br
256 inode_size = 256
257.br
258 }
259.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500260 small = {
261.br
262 blocksize = 1024
263.br
264 inode_ratio = 4096
265.br
266 }
267.br
268 floppy = {
269.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500270 features = ^resize_inode
271.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500272 blocksize = 1024
273.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500274 inode_size = 128
275.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500276 }
277.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500278If mke2fs started with a program name of
279.BR mke2fs.ext4 ,
280then the filesystem type of ext4 will be used. If the filesystem is
281smaller than 3 megabytes, and no usage type is specified, then
282.B mke2fs
283will use a default
284usage type of
285.IR floppy .
286This results in an fs_types list of "ext4, floppy". Both the ext4
287subsection and the floppy subsection define an
288.I inode_size
Theodore Ts'o711d3842008-09-07 14:08:40 -0400289relation, but since the later entries in the fs_types list supersede
Theodore Ts'o3d438362008-02-19 08:32:58 -0500290earlier ones, the configuration parameter for fs_types.floppy.inode_size
291will be used, so the filesystem will have an inode size of 128.
292.P
293The exception to this resolution is the
294.I features
295tag, which is specifies a set of changes to the features used by the
296filesystem, and which is cumulative. So in the above example, first
297the configuration relation defaults.base_features would enable an
298initial feature set with the sparse_super, filetype, resize_inode, and
299dir_index features enabled. Then configuration relation
300fs_types.ext4.features would enable the extents and flex_bg
301features, and finally the configuration relation
302fs_types.floppy.features would remove
303the resize_inode feature, resulting in a filesystem feature set
304consisting of the sparse_super, filetype, resize_inode, dir_index,
305extents_and flex_bg features.
306.P
Theodore Ts'ofac95252006-03-27 01:05:26 -0500307For each filesystem type, the following tags may be used in that
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500308fs_type's subsection:
309.TP
310.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500311This relation specifies the features which are initially enabled for this
312filesystem type. Only one
313.I base_features
314will be used, so if there are multiple entries in the fs_types list
315whose subsections define the
316.I base_features
317relation, only the last will be used by
318.BR mke2fs (8).
319.TP
320.I features
321This relation specifies a comma-separated list of features edit
322requests which modify the feature set
323used by the newly constructed filesystem. The syntax is the same as the
324.B -O
325command-line option to
326.BR mke2fs (8);
327that is, a feature can be prefixed by a caret ('^') symbol to disable
328a named feature. Each
329.I feature
330relation specified in the fs_types list will be applied in the order
331found in the fs_types list.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500332.TP
333.I default_features
334This relation specifies set of features which should be enabled or
Theodore Ts'o3d438362008-02-19 08:32:58 -0500335disabled after applying the features listed in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500336.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500337and
338.I features
339relations. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500340.B -O
341command-line option to
342.BR mke2fs (8).
343.TP
Theodore Ts'o493024e2010-06-13 14:00:00 -0400344.I auto_64-bit_support
345This relation is a boolean which specifies whether
346.BR mke2fs (8)
347should automatically add the 64bit feature if the number of blocks for
348the file system requires this feature to be enabled. The resize_inode
349feature is also automatically disabled since it doesn't support 64-bit
350block numbers.
351.TP
Eric Sandeen6a426c92011-02-17 15:56:17 -0600352.I default_mntopts
353This relation specifies the set of mount options which should be enabled
354by default. These may be changed at a later time with the
355.B -o
356command-line option to
357.BR tune2fs (8).
358.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500359.I blocksize
360This relation specifies the default blocksize if the user does not
361specify a blocksize on the command line.
362.TP
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400363.I lazy_itable_init
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400364This boolean relation specifies whether the inode table should
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400365be lazily initialized. It only has meaning if the uninit_bg feature is
366enabled. If lazy_itable_init is true and the uninit_bg feature is
367enabled, the inode table will
368not fully initialized by
369.BR mke2fs (8).
370This speeds up filesystem
Theodore Ts'o711d3842008-09-07 14:08:40 -0400371initialization noticeably, but it requires the kernel to finish
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400372initializing the filesystem in the background when the filesystem is
373first mounted.
374.TP
Theodore Ts'ob8182052014-01-28 12:58:56 -0500375.I journal_location
376This relation specifies the location of the journal.
377.TP
Theodore Ts'o65c6c3e2014-01-11 22:11:42 -0500378.I num_backup_sb
379This relation indicates whether file systems with the
380.B sparse_super2
381feature enabled should be created with 0, 1, or 2 backup superblocks.
382.TP
Theodore Ts'o3c6e91c2014-01-28 14:44:23 -0500383.I packed_meta_blocks
384This boolean relation specifes whether the allocation bitmaps, inode
385table, and journal should be located at the beginning of the file system.
386.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500387.I inode_ratio
388This relation specifies the default inode ratio if the user does not
389specify one on the command line.
Andreas Dilger067911a2006-07-15 22:08:20 -0400390.TP
391.I inode_size
392This relation specifies the default inode size if the user does not
393specify one on the command line.
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400394.TP
Aditya Kalid3859af2011-05-10 14:51:31 -0700395.I reserved_ratio
396This relation specifies the default percentage of filesystem blocks
397reserved for the super-user, if the user does not specify one on the command
398line.
399.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400400.I hash_alg
401This relation specifies the default hash algorithm used for the
402new filesystems with hashed b-tree directories. Valid algorithms
403accepted are:
404.IR legacy ,
405.IR half_md4 ,
406and
407.IR tea .
408.TP
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400409.I flex_bg_size
Eric Sandeend4a93302011-03-10 10:09:35 -0600410This relation specifies the number of block groups that will be packed
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400411together to create one large virtual block group on an ext4 filesystem.
412This improves meta-data locality and performance on meta-data heavy
Eric Sandeend4a93302011-03-10 10:09:35 -0600413workloads. The number of groups must be a power of 2 and may only be
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400414specified if the flex_bg filesystem feature is enabled.
David Prévotb75a4ce2012-03-26 10:45:51 -0700415.TP
Theodore Ts'o2d363582008-05-14 18:09:37 -0400416.I options
417This relation specifies additional extended options which should be
418treated by
419.BR mke2fs (8)
420as if they were prepended to the argument of the
421.B -E
422option. This can be used to configure the default extended options used
423by
424.BR mke2fs (8)
425on a per-filesystem type basis.
Lukas Czerner7fe5ff32010-11-18 14:38:41 +0100426.TP
427.I discard
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400428This boolean relation specifies whether the
Lukas Czerner7fe5ff32010-11-18 14:38:41 +0100429.BR mke2fs (8)
430should attempt to discard device prior to filesystem creation.
Theodore Ts'o2d34a252011-06-14 14:30:22 -0400431.TP
432.I cluster_size
433This relation specifies the default cluster size if the bigalloc file
434system feature is enabled. It can be overridden via the
435.B \-C
436command line option to
437.BR mke2fs (8)
Theodore Ts'o23a1b982014-01-20 23:06:07 -0500438.TP
439.I make_hugefiles
440This boolean relation enables the creation of pre-allocated files as
441part of formatting the file system.
442.TP
443.I hugefiles_uid
444This relation controls the user ownership for all of the files and
445directories created by the
446.I make_hugefiles
447feature.
448.TP
449.I hugefiles_gid
450This relation controls the group ownership for all of the files and
451directories created by the
452.I make_hugefiles
453feature.
454.TP
455.I hugefiles_umask
456This relation specifies the umask used when creating the files and
457directories by the
458.I make_hugefiles
459feature.
460.TP
461.I num_hugefiles
462This relation specifies the number of huge files to be created. If this
463relation is not specified, or is set to zero, and the
464.I hugefiles_size
465relation is non-zero, then
466.I make_hugefiles
467will create as many huge files as can fit to fill the entire file system.
468.TP
469.I hugefiles_slack
470This relation specifies how much space should be reserved for other
471files.
472.TP
473.I hugefiles_size
474This relation specifies the size of the huge files. If this relation is
Theodore Ts'o7efd2502014-02-04 12:30:00 -0500475not specified, the default is to fill the entire file system.
476.TP
477.I hugefiles_align
478This relation specifies the alignment for the start block of the huge
479files. It also forces the size of huge files to be a multiple of the
480requested alignment. If this relation is not specified, no alignment
481requirement will be imposed on the huge files.
Theodore Ts'o23a1b982014-01-20 23:06:07 -0500482.TP
Theodore Ts'oc42de752014-07-08 20:02:48 -0400483.I hugefiles_align_disk
484Thie relations specifies whether the alignment should be relative to the
485beginning of the hard drive (assuming that the starting offset of the
486partition is available to mke2fs). The default value is false, which
487if will cause hugefile alignment to be relative to the beginning of the
488file system.
489.TP
Theodore Ts'o23a1b982014-01-20 23:06:07 -0500490.I hugefiles_name
491This relation specifies the base file name for the huge files.
492.TP
493.I hugefiles_digits
494This relation specifies the (zero-padded) width of the field for the
495huge file number.
496.TP
497.I zero_hugefiles
498This boolean relation specifies whether or not zero blocks will be
499written to the hugefiles while
500.BR mke2fs(8)
501is creating them. By default, zero blocks will be written to the huge
502files to avoid stale data from being made available to potentially
503untrusted user programs, unless the device supports a discard/trim
504operation which will take care of zeroing the device blocks. By
505.I zero_hugefiles
506to false, this step will always be skipped, which can be useful if it is
507known that the disk has been previously erased, or if the user programs
508that will have access to the huge files are trusted to not reveal stale
509data.
Theodore Ts'o4c2b28a2011-06-14 14:17:56 -0400510.SH THE [devices] STANZA
511Each tag in the
512.I [devices]
513stanza names device name so that per-device defaults can be specified.
514.TP
515.I fs_type
516This relation specifies the default parameter for the
517.B \-t
518option, if this option isn't specified on the command line.
519.TP
520.I usage_types
521This relation specifies the default parameter for the
522.B \-T
523option, if this option isn't specified on the command line.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500524.SH FILES
525.TP
526.I /etc/mke2fs.conf
527The configuration file for
528.BR mke2fs (8).
529.SH SEE ALSO
530.BR mke2fs (8)