blob: cb643eb70b35a83f04ba51269f155df71e6e0c5d [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)
14when it is creating ext2 or ext3 filesystems.
15.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'o9447f382006-05-22 17:59:37 -040062The following stanzas are used in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050063.I mke2fs.conf
64file. They will be described in more detail in future sections of this
65document.
66.TP
67.I [defaults]
68Contains relations which define the default parameters
69used by
70.BR mke2fs (8).
71In general, these defaults may be overridden by a definition in the
72.B fs_types
Theodore Ts'ofac95252006-03-27 01:05:26 -050073stanza, or by an command-line option provided by the user.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050074.TP
75.I [fs_types]
76Contains relations which define defaults that should be used for specific
77filesystem types. The filesystem type can be specified explicitly using
78the
79.B -T
80option to
81.BR mke2fs (8).
Theodore Ts'ofac95252006-03-27 01:05:26 -050082.SH THE [defaults] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050083The following relations are defined in the
84.I [defaults]
Theodore Ts'ofac95252006-03-27 01:05:26 -050085stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050086.TP
87.I base_features
88This relation specifies the filesystems features which are enabled in
Theodore Ts'o9447f382006-05-22 17:59:37 -040089newly created filesystems. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050090.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -050091relation found in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050092the
93.I [fs_types]
Theodore Ts'ofac95252006-03-27 01:05:26 -050094stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050095.TP
96.I default_features
97This relation specifies a set of features that should be added or
98removed to the features listed in the
99.I base_features
Theodore Ts'o9447f382006-05-22 17:59:37 -0400100relation. It may be overridden by the filesystem-specific
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500101.I default_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500102in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500103.IR [fs_types] ,
104and by the
105.B -O
106command-line option
107to
108.BR mke2fs (8).
109.TP
Eric Sandeen3daf5922011-02-17 15:55:15 -0600110.I enable_periodic_fsck
111This relation specifies whether periodic filesystem checks should be
112enforced at boot time. If enabled, checks will be forced every
113180 days, or after a random number of mounts. These values may
114be changed later via the
115.B -i
116and
117.B -c
118command-line options to
119.BR tune2fs (8).
120.TP
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530121.I force_undo
122This relation, if set to a boolean value of true, forces
123.B mke2fs
124to always try to create an undo file, even if the undo file might be
125huge and it might extend the time to create the filesystem image
126because the inode table isn't being initialized lazily.
127.TP
Theodore Ts'o3d438362008-02-19 08:32:58 -0500128.I fs_type
129This relation specifies the default filesystem type if the user does not
130specify it via the
131.B \-t
132option, or if
133.B mke2fs
134is not started using a program name of the form
135.BI mkfs. fs-type\fR.
136If both the user and the
137.B mke2fs.conf
138file does not specify a default filesystem type, mke2fs will use a
139default filesystem type of
140.IR ext3
141if a journal was requested via a command-line option, or
142.I ext2
143if not.
144.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500145.I blocksize
146This relation specifies the default blocksize if the user does not
147specify a blocksize on the command line, and the filesystem-type
148specific section of the configuration file does not specify a blocksize.
149.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400150.I hash_alg
151This relation specifies the default hash algorithm used for the
152new filesystems with hashed b-tree directories. Valid algorithms
153accepted are:
154.IR legacy ,
155.IR half_md4 ,
156and
157.IR tea .
158.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500159.I inode_ratio
160This relation specifies the default inode ratio 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
163inode ratio.
Andreas Dilger067911a2006-07-15 22:08:20 -0400164.TP
165.I inode_size
166This relation specifies the default inode size if the user does not
167specify one on the command line, and the filesystem-type
168specific section of the configuration file does not specify a default
169inode size.
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530170.TP
171.I undo_dir
172This relation specifies the directory where the undo file should be
Theodore Ts'o711d3842008-09-07 14:08:40 -0400173stored. It can be overridden via the
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530174.B E2FSPROGS_UNDO_DIR
Theodore Ts'o711d3842008-09-07 14:08:40 -0400175environment variable. If the directory location is set to the value
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530176.IR none ,
177.B mke2fs
178will not create an undo file.
Theodore Ts'ofac95252006-03-27 01:05:26 -0500179.SH THE [fs_types] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500180Each tag in the
181.I [fs_types]
Theodore Ts'o3d438362008-02-19 08:32:58 -0500182stanza names a filesystem type or usage type which can be specified via the
183.B \-t
184or
185.B \-T
186options to
187.BR mke2fs (8),
188respectively.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500189.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500190The
191.B mke2fs
192program constructs a list of fs_types by concatenating the filesystem
193type (i.e., ext2, ext3, etc.) with the usage type list. For most
194configuration options,
195.B mke2fs
196will look for a subsection in the
197.I [fs_types]
198stanza corresponding with each entry in the constructed list, with later
199entries overriding earlier filesystem or usage types.
200For
201example, consider the following
202.B mke2fs.conf
203fragment:
204.P
205[defaults]
206.br
207 base_features = sparse_super,filetype,resize_inode,dir_index
208.br
209 blocksize = 4096
210.br
211 inode_size = 256
212.br
213 inode_ratio = 16384
214.br
215
216.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500217[fs_types]
218.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500219 ext3 = {
220.br
221 features = has_journal
222.br
223 }
224.br
225 ext4 = {
226.br
227 features = extents,flex_bg
228.br
229 inode_size = 256
230.br
231 }
232.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500233 small = {
234.br
235 blocksize = 1024
236.br
237 inode_ratio = 4096
238.br
239 }
240.br
241 floppy = {
242.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500243 features = ^resize_inode
244.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500245 blocksize = 1024
246.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500247 inode_size = 128
248.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500249 }
250.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500251If mke2fs started with a program name of
252.BR mke2fs.ext4 ,
253then the filesystem type of ext4 will be used. If the filesystem is
254smaller than 3 megabytes, and no usage type is specified, then
255.B mke2fs
256will use a default
257usage type of
258.IR floppy .
259This results in an fs_types list of "ext4, floppy". Both the ext4
260subsection and the floppy subsection define an
261.I inode_size
Theodore Ts'o711d3842008-09-07 14:08:40 -0400262relation, but since the later entries in the fs_types list supersede
Theodore Ts'o3d438362008-02-19 08:32:58 -0500263earlier ones, the configuration parameter for fs_types.floppy.inode_size
264will be used, so the filesystem will have an inode size of 128.
265.P
266The exception to this resolution is the
267.I features
268tag, which is specifies a set of changes to the features used by the
269filesystem, and which is cumulative. So in the above example, first
270the configuration relation defaults.base_features would enable an
271initial feature set with the sparse_super, filetype, resize_inode, and
272dir_index features enabled. Then configuration relation
273fs_types.ext4.features would enable the extents and flex_bg
274features, and finally the configuration relation
275fs_types.floppy.features would remove
276the resize_inode feature, resulting in a filesystem feature set
277consisting of the sparse_super, filetype, resize_inode, dir_index,
278extents_and flex_bg features.
279.P
Theodore Ts'ofac95252006-03-27 01:05:26 -0500280For each filesystem type, the following tags may be used in that
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500281fs_type's subsection:
282.TP
283.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500284This relation specifies the features which are initially enabled for this
285filesystem type. Only one
286.I base_features
287will be used, so if there are multiple entries in the fs_types list
288whose subsections define the
289.I base_features
290relation, only the last will be used by
291.BR mke2fs (8).
292.TP
293.I features
294This relation specifies a comma-separated list of features edit
295requests which modify the feature set
296used by the newly constructed filesystem. The syntax is the same as the
297.B -O
298command-line option to
299.BR mke2fs (8);
300that is, a feature can be prefixed by a caret ('^') symbol to disable
301a named feature. Each
302.I feature
303relation specified in the fs_types list will be applied in the order
304found in the fs_types list.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500305.TP
306.I default_features
307This relation specifies set of features which should be enabled or
Theodore Ts'o3d438362008-02-19 08:32:58 -0500308disabled after applying the features listed in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500309.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500310and
311.I features
312relations. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500313.B -O
314command-line option to
315.BR mke2fs (8).
316.TP
317.I blocksize
318This relation specifies the default blocksize if the user does not
319specify a blocksize on the command line.
320.TP
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400321.I lazy_itable_init
322This relation is a boolean which specifies whether the inode table should
323be lazily initialized. It only has meaning if the uninit_bg feature is
324enabled. If lazy_itable_init is true and the uninit_bg feature is
325enabled, the inode table will
326not fully initialized by
327.BR mke2fs (8).
328This speeds up filesystem
Theodore Ts'o711d3842008-09-07 14:08:40 -0400329initialization noticeably, but it requires the kernel to finish
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400330initializing the filesystem in the background when the filesystem is
331first mounted.
332.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500333.I inode_ratio
334This relation specifies the default inode ratio if the user does not
335specify one on the command line.
Andreas Dilger067911a2006-07-15 22:08:20 -0400336.TP
337.I inode_size
338This relation specifies the default inode size if the user does not
339specify one on the command line.
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400340.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400341.I hash_alg
342This relation specifies the default hash algorithm used for the
343new filesystems with hashed b-tree directories. Valid algorithms
344accepted are:
345.IR legacy ,
346.IR half_md4 ,
347and
348.IR tea .
349.TP
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400350.I flex_bg_size
351This relation specifies the number of block goups that will be packed
352together to create one large virtual block group on an ext4 filesystem.
353This improves meta-data locality and performance on meta-data heavy
354workloads. The number of goups must be a power of 2 and may only be
355specified if the flex_bg filesystem feature is enabled.
Theodore Ts'o2d363582008-05-14 18:09:37 -0400356.I options
357This relation specifies additional extended options which should be
358treated by
359.BR mke2fs (8)
360as if they were prepended to the argument of the
361.B -E
362option. This can be used to configure the default extended options used
363by
364.BR mke2fs (8)
365on a per-filesystem type basis.
Lukas Czerner7fe5ff32010-11-18 14:38:41 +0100366.TP
367.I discard
368This relation is a boolean which specifies whether the
369.BR mke2fs (8)
370should attempt to discard device prior to filesystem creation.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500371.SH FILES
372.TP
373.I /etc/mke2fs.conf
374The configuration file for
375.BR mke2fs (8).
376.SH SEE ALSO
377.BR mke2fs (8)