1mke2fs.conf(5) File Formats Manual mke2fs.conf(5)
2
3
4
6 mke2fs.conf - Configuration file for mke2fs
7
9 mke2fs.conf is the configuration file for mke2fs(8). It controls the
10 default parameters used by mke2fs(8) when it is creating ext2 or ext3
11 filesystems.
12
13 The mke2fs.conf file uses an INI-style format. Stanzas, or top-level
14 sections, are delimited by square braces: [ ]. Within each section,
15 each line defines a relation, which assigns tags to values, or to a
16 subsection, which contains further relations or subsections. An exam‐
17 ple of the INI-style format used by this configuration file follows
18 below:
19
20 [section1]
21 tag1 = value_a
22 tag1 = value_b
23 tag2 = value_c
24
25 [section 2]
26 tag3 = {
27 subtag1 = subtag_value_a
28 subtag1 = subtag_value_b
29 subtag2 = subtag_value_c
30 }
31 tag1 = value_d
32 tag2 = value_e
33 }
34
35 Comments are delimited by a semicolon (';') or a hash ('#') character
36 at the beginning of the comment, and are terminated by the end of line
37 character.
38
39 Tags and values must be quoted using double quotes if they contain spa‐
40 ces. Within a quoted string, the standard backslash interpretations
41 apply: "\n" (for the newline character), "\t" (for the tab character),
42 "\b" (for the backspace character), and "\\" (for the backslash charac‐
43 ter).
44
45 The following stanzas are used in the mke2fs.conf file. They will be
46 described in more detail in future sections of this document.
47
48 [defaults]
49 Contains relations which define the default parameters used by
50 mke2fs(8). In general, these defaults may be overridden by a
51 definition in the fs_types stanza, or by an command-line option
52 provided by the user.
53
54 [fs_types]
55 Contains relations which define defaults that should be used for
56 specific filesystem types. The filesystem type can be specified
57 explicitly using the -T option to mke2fs(8).
58
60 The following relations are defined in the [defaults] stanza.
61
62 base_features
63 This relation specifies the filesystems features which are
64 enabled in newly created filesystems. It may be overridden by
65 the base_features relation found in the filesystem or usage type
66 subsection of the [fs_types] stanza.
67
68 default_features
69 This relation specifies a set of features that should be added
70 or removed to the features listed in the base_features relation.
71 It may be overridden by the filesystem-specific default_features
72 in the filesystem or usage type subsection of [fs_types], and by
73 the -O command-line option to mke2fs(8).
74
75 force_undo
76 This relation, if set to a boolean value of true, forces mke2fs
77 to always try to create an undo file, even if the undo file
78 might be huge and it might extend the time to create the
79 filesystem image because the inode table isn't being initialized
80 lazily.
81
82 fs_type
83 This relation specifies the default filesystem type if the user
84 does not specify it via the -t option, or if mke2fs is not
85 started using a program name of the form mkfs.fs-type. If both
86 the user and the mke2fs.conf file does not specify a default
87 filesystem type, mke2fs will use a default filesystem type of
88 ext3 if a journal was requested via a command-line option, or
89 ext2 if not.
90
91 blocksize
92 This relation specifies the default blocksize if the user does
93 not specify a blocksize on the command line, and the filesystem-
94 type specific section of the configuration file does not specify
95 a blocksize.
96
97 hash_alg
98 This relation specifies the default hash algorithm used for the
99 new filesystems with hashed b-tree directories. Valid algo‐
100 rithms accepted are: legacy, half_md4, and tea.
101
102 inode_ratio
103 This relation specifies the default inode ratio if the user does
104 not specify one on the command line, and the filesystem-type
105 specific section of the configuration file does not specify a
106 default inode ratio.
107
108 inode_size
109 This relation specifies the default inode size if the user does
110 not specify one on the command line, and the filesystem-type
111 specific section of the configuration file does not specify a
112 default inode size.
113
114 undo_dir
115 This relation specifies the directory where the undo file should
116 be stored. It can be overridden via the E2FSPROGS_UNDO_DIR
117 environment variable. If the directory location is set to the
118 value none, mke2fs will not create an undo file.
119
121 Each tag in the [fs_types] stanza names a filesystem type or usage type
122 which can be specified via the -t or -T options to mke2fs(8), respec‐
123 tively.
124
125 The mke2fs program constructs a list of fs_types by concatenating the
126 filesystem type (i.e., ext2, ext3, etc.) with the usage type list. For
127 most configuration options, mke2fs will look for a subsection in the
128 [fs_types] stanza corresponding with each entry in the constructed
129 list, with later entries overriding earlier filesystem or usage types.
130 For example, consider the following mke2fs.conf fragment:
131
132 [defaults]
133 base_features = sparse_super,filetype,resize_inode,dir_index
134 blocksize = 4096
135 inode_size = 256
136 inode_ratio = 16384
137
138 [fs_types]
139 ext3 = {
140 features = has_journal
141 }
142 ext4 = {
143 features = extents,flex_bg
144 inode_size = 256
145 }
146 small = {
147 blocksize = 1024
148 inode_ratio = 4096
149 }
150 floppy = {
151 features = ^resize_inode
152 blocksize = 1024
153 inode_size = 128
154 }
155
156 If mke2fs started with a program name of mke2fs.ext4, then the filesys‐
157 tem type of ext4 will be used. If the filesystem is smaller than 3
158 megabytes, and no usage type is specified, then mke2fs will use a
159 default usage type of floppy. This results in an fs_types list of
160 "ext4, floppy". Both the ext4 subsection and the floppy subsection
161 define an inode_size relation, but since the later entries in the
162 fs_types list supersede earlier ones, the configuration parameter for
163 fs_types.floppy.inode_size will be used, so the filesystem will have
164 an inode size of 128.
165
166 The exception to this resolution is the features tag, which is speci‐
167 fies a set of changes to the features used by the filesystem, and which
168 is cumulative. So in the above example, first the configuration rela‐
169 tion defaults.base_features would enable an initial feature set with
170 the sparse_super, filetype, resize_inode, and dir_index features
171 enabled. Then configuration relation fs_types.ext4.features would
172 enable the extents and flex_bg features, and finally the configuration
173 relation fs_types.floppy.features would remove the resize_inode fea‐
174 ture, resulting in a filesystem feature set consisting of the
175 sparse_super, filetype, resize_inode, dir_index, extents_and flex_bg
176 features.
177
178 For each filesystem type, the following tags may be used in that
179 fs_type's subsection:
180
181 base_features
182 This relation specifies the features which are initially enabled
183 for this filesystem type. Only one base_features will be used,
184 so if there are multiple entries in the fs_types list whose sub‐
185 sections define the base_features relation, only the last will
186 be used by mke2fs(8).
187
188 features
189 This relation specifies a comma-separated list of features edit
190 requests which modify the feature set used by the newly con‐
191 structed filesystem. The syntax is the same as the -O command-
192 line option to mke2fs(8); that is, a feature can be prefixed by
193 a caret ('^') symbol to disable a named feature. Each feature
194 relation specified in the fs_types list will be applied in the
195 order found in the fs_types list.
196
197 default_features
198 This relation specifies set of features which should be enabled
199 or disabled after applying the features listed in the base_fea‐
200 tures and features relations. It may be overridden by the -O
201 command-line option to mke2fs(8).
202
203 blocksize
204 This relation specifies the default blocksize if the user does
205 not specify a blocksize on the command line.
206
207 lazy_itable_init
208 This relation is a boolean which specifies whether the inode ta‐
209 ble should be lazily initialized. It only has meaning if the
210 uninit_bg feature is enabled. If lazy_itable_init is true and
211 the uninit_bg feature is enabled, the inode table will not
212 fully initialized by mke2fs(8). This speeds up filesystem ini‐
213 tialization noticeably, but it requires the kernel to finish
214 initializing the filesystem in the background when the filesys‐
215 tem is first mounted.
216
217 inode_ratio
218 This relation specifies the default inode ratio if the user does
219 not specify one on the command line.
220
221 inode_size
222 This relation specifies the default inode size if the user does
223 not specify one on the command line.
224
225 hash_alg
226 This relation specifies the default hash algorithm used for the
227 new filesystems with hashed b-tree directories. Valid algo‐
228 rithms accepted are: legacy, half_md4, and tea.
229
230 flex_bg_size
231 This relation specifies the number of block goups that will be
232 packed together to create one large virtual block group on an
233 ext4 filesystem. This improves meta-data locality and perfor‐
234 mance on meta-data heavy workloads. The number of goups must be
235 a power of 2 and may only be specified if the flex_bg filesystem
236 feature is enabled. options This relation specifies additional
237 extended options which should be treated by mke2fs(8) as if they
238 were prepended to the argument of the -E option. This can be
239 used to configure the default extended options used by mke2fs(8)
240 on a per-filesystem type basis.
241
243 /etc/mke2fs.conf
244 The configuration file for mke2fs(8).
245
247 mke2fs(8)
248
249
250
251E2fsprogs version 1.41.12 May 2010 mke2fs.conf(5)