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, ext3, or
11 ext4 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 Some relations expect a boolean value. The parser is quite liberal on
46 recognizing ``yes'', '`y'', ``true'', ``t'', ``1'', ``on'', etc. as a
47 boolean true value, and ``no'', ``n'', ``false'', ``nil'', ``0'',
48 ``off'' as a boolean false value.
49
50 The following stanzas are used in the mke2fs.conf file. They will be
51 described in more detail in future sections of this document.
52
53 [defaults]
54 Contains relations which define the default parameters used by
55 mke2fs(8). In general, these defaults may be overridden by a
56 definition in the fs_types stanza, or by an command-line option
57 provided by the user.
58
59 [fs_types]
60 Contains relations which define defaults that should be used for
61 specific filesystem types. The filesystem type can be specified
62 explicitly using the -T option to mke2fs(8).
63
65 The following relations are defined in the [defaults] stanza.
66
67 base_features
68 This relation specifies the filesystems features which are
69 enabled in newly created filesystems. It may be overridden by
70 the base_features relation found in the filesystem or usage type
71 subsection of the [fs_types] stanza.
72
73 default_features
74 This relation specifies a set of features that should be added
75 or removed to the features listed in the base_features relation.
76 It may be overridden by the filesystem-specific default_features
77 in the filesystem or usage type subsection of [fs_types], and by
78 the -O command-line option to mke2fs(8).
79
80 enable_periodic_fsck
81 This boolean relation specifies whether periodic filesystem
82 checks should be enforced at boot time. If set to true, checks
83 will be forced every 180 days, or after a random number of
84 mounts. These values may be changed later via the -i and -c
85 command-line options to tune2fs(8).
86
87 force_undo
88 This boolean relation, if set to a value of true, forces mke2fs
89 to always try to create an undo file, even if the undo file
90 might be huge and it might extend the time to create the
91 filesystem image because the inode table isn't being initialized
92 lazily.
93
94 fs_type
95 This relation specifies the default filesystem type if the user
96 does not specify it via the -t option, or if mke2fs is not
97 started using a program name of the form mkfs.fs-type. If both
98 the user and the mke2fs.conf file does not specify a default
99 filesystem type, mke2fs will use a default filesystem type of
100 ext3 if a journal was requested via a command-line option, or
101 ext2 if not.
102
103 blocksize
104 This relation specifies the default blocksize if the user does
105 not specify a blocksize on the command line, and the filesystem-
106 type specific section of the configuration file does not specify
107 a blocksize.
108
109 hash_alg
110 This relation specifies the default hash algorithm used for the
111 new filesystems with hashed b-tree directories. Valid algo‐
112 rithms accepted are: legacy, half_md4, and tea.
113
114 inode_ratio
115 This relation specifies the default inode ratio if the user does
116 not specify one on the command line, and the filesystem-type
117 specific section of the configuration file does not specify a
118 default inode ratio.
119
120 inode_size
121 This relation specifies the default inode size if the user does
122 not specify one on the command line, and the filesystem-type
123 specific section of the configuration file does not specify a
124 default inode size.
125
126 reserved_ratio
127 This relation specifies the default percentage of filesystem
128 blocks reserved for the super-user, if the user does not specify
129 one on the command line, and the filesystem-type specific sec‐
130 tion of the configuration file does not specify a default
131 reserved ratio. This value can be a floating point number.
132
133 undo_dir
134 This relation specifies the directory where the undo file should
135 be stored. It can be overridden via the E2FSPROGS_UNDO_DIR
136 environment variable. If the directory location is set to the
137 value none, mke2fs will not create an undo file.
138
140 Each tag in the [fs_types] stanza names a filesystem type or usage type
141 which can be specified via the -t or -T options to mke2fs(8), respec‐
142 tively.
143
144 The mke2fs program constructs a list of fs_types by concatenating the
145 filesystem type (i.e., ext2, ext3, etc.) with the usage type list. For
146 most configuration options, mke2fs will look for a subsection in the
147 [fs_types] stanza corresponding with each entry in the constructed
148 list, with later entries overriding earlier filesystem or usage types.
149 For example, consider the following mke2fs.conf fragment:
150
151 [defaults]
152 base_features = sparse_super,filetype,resize_inode,dir_index
153 blocksize = 4096
154 inode_size = 256
155 inode_ratio = 16384
156
157 [fs_types]
158 ext3 = {
159 features = has_journal
160 }
161 ext4 = {
162 features = extents,flex_bg
163 inode_size = 256
164 }
165 small = {
166 blocksize = 1024
167 inode_ratio = 4096
168 }
169 floppy = {
170 features = ^resize_inode
171 blocksize = 1024
172 inode_size = 128
173 }
174
175 If mke2fs started with a program name of mke2fs.ext4, then the filesys‐
176 tem type of ext4 will be used. If the filesystem is smaller than 3
177 megabytes, and no usage type is specified, then mke2fs will use a
178 default usage type of floppy. This results in an fs_types list of
179 "ext4, floppy". Both the ext4 subsection and the floppy subsection
180 define an inode_size relation, but since the later entries in the
181 fs_types list supersede earlier ones, the configuration parameter for
182 fs_types.floppy.inode_size will be used, so the filesystem will have
183 an inode size of 128.
184
185 The exception to this resolution is the features tag, which is speci‐
186 fies a set of changes to the features used by the filesystem, and which
187 is cumulative. So in the above example, first the configuration rela‐
188 tion defaults.base_features would enable an initial feature set with
189 the sparse_super, filetype, resize_inode, and dir_index features
190 enabled. Then configuration relation fs_types.ext4.features would
191 enable the extents and flex_bg features, and finally the configuration
192 relation fs_types.floppy.features would remove the resize_inode fea‐
193 ture, resulting in a filesystem feature set consisting of the
194 sparse_super, filetype, resize_inode, dir_index, extents_and flex_bg
195 features.
196
197 For each filesystem type, the following tags may be used in that
198 fs_type's subsection:
199
200 base_features
201 This relation specifies the features which are initially enabled
202 for this filesystem type. Only one base_features will be used,
203 so if there are multiple entries in the fs_types list whose sub‐
204 sections define the base_features relation, only the last will
205 be used by mke2fs(8).
206
207 features
208 This relation specifies a comma-separated list of features edit
209 requests which modify the feature set used by the newly con‐
210 structed filesystem. The syntax is the same as the -O command-
211 line option to mke2fs(8); that is, a feature can be prefixed by
212 a caret ('^') symbol to disable a named feature. Each feature
213 relation specified in the fs_types list will be applied in the
214 order found in the fs_types list.
215
216 default_features
217 This relation specifies set of features which should be enabled
218 or disabled after applying the features listed in the base_fea‐
219 tures and features relations. It may be overridden by the -O
220 command-line option to mke2fs(8).
221
222 auto_64-bit_support
223 This relation is a boolean which specifies whether mke2fs(8)
224 should automatically add the 64bit feature if the number of
225 blocks for the file system requires this feature to be enabled.
226 The resize_inode feature is also automatically disabled since it
227 doesn't support 64-bit block numbers.
228
229 default_mntopts
230 This relation specifies the set of mount options which should be
231 enabled by default. These may be changed at a later time with
232 the -o command-line option to tune2fs(8).
233
234 blocksize
235 This relation specifies the default blocksize if the user does
236 not specify a blocksize on the command line.
237
238 lazy_itable_init
239 This boolean relation specifies whether the inode table should
240 be lazily initialized. It only has meaning if the uninit_bg
241 feature is enabled. If lazy_itable_init is true and the
242 uninit_bg feature is enabled, the inode table will not fully
243 initialized by mke2fs(8). This speeds up filesystem initializa‐
244 tion noticeably, but it requires the kernel to finish initializ‐
245 ing the filesystem in the background when the filesystem is
246 first mounted.
247
248 inode_ratio
249 This relation specifies the default inode ratio if the user does
250 not specify one on the command line.
251
252 inode_size
253 This relation specifies the default inode size if the user does
254 not specify one on the command line.
255
256 reserved_ratio
257 This relation specifies the default percentage of filesystem
258 blocks reserved for the super-user, if the user does not specify
259 one on the command line.
260
261 hash_alg
262 This relation specifies the default hash algorithm used for the
263 new filesystems with hashed b-tree directories. Valid algo‐
264 rithms accepted are: legacy, half_md4, and tea.
265
266 flex_bg_size
267 This relation specifies the number of block groups that will be
268 packed together to create one large virtual block group on an
269 ext4 filesystem. This improves meta-data locality and perfor‐
270 mance on meta-data heavy workloads. The number of groups must
271 be a power of 2 and may only be specified if the flex_bg
272 filesystem feature is enabled.
273
274 options
275 This relation specifies additional extended options which should
276 be treated by mke2fs(8) as if they were prepended to the argu‐
277 ment of the -E option. This can be used to configure the
278 default extended options used by mke2fs(8) on a per-filesystem
279 type basis.
280
281 discard
282 This boolean relation specifies whether the mke2fs(8) should
283 attempt to discard device prior to filesystem creation.
284
285 cluster_size
286 This relation specifies the default cluster size if the bigalloc
287 file system feature is enabled. It can be overridden via the -C
288 command line option to mke2fs(8)
289
291 Each tag in the [devices] stanza names device name so that per-device
292 defaults can be specified.
293
294 fs_type
295 This relation specifies the default parameter for the -t option,
296 if this option isn't specified on the command line.
297
298 usage_types
299 This relation specifies the default parameter for the -T option,
300 if this option isn't specified on the command line.
301
303 /etc/mke2fs.conf
304 The configuration file for mke2fs(8).
305
307 mke2fs(8)
308
309
310
311E2fsprogs version 1.42.9 December 2013 mke2fs.conf(5)