]>
Commit | Line | Data |
---|---|---|
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. | |
4 | .\" | |
5 | .TH mke2fs.conf 5 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" | |
6 | .SH NAME | |
7 | mke2fs.conf \- Configuration file for mke2fs | |
8 | .SH DESCRIPTION | |
9 | .I mke2fs.conf | |
10 | is the configuration file for | |
11 | .BR mke2fs (8). | |
12 | It controls the default parameters used by | |
13 | .BR mke2fs (8) | |
626a2e74 | 14 | when it is creating ext2, ext3, or ext4 filesystems. |
9dc6ad1e TT |
15 | .PP |
16 | The | |
17 | .I mke2fs.conf | |
fac9525e TT |
18 | file uses an INI-style format. Stanzas, or top-level sections, are |
19 | delimited by square braces: [ ]. Within each section, each line | |
20 | defines a relation, which assigns tags to values, or to a subsection, | |
9dc6ad1e TT |
21 | which contains further relations or subsections. |
22 | .\" Tags can be assigned multiple values | |
23 | An example of the INI-style format used by this configuration file | |
24 | follows 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 | |
52 | Comments are delimited by a semicolon (';') or a hash ('#') character | |
53 | at the beginning of the comment, and are terminated by the end of | |
54 | line character. | |
55 | .P | |
56 | Tags and values must be quoted using double quotes if they contain | |
57 | spaces. Within a quoted string, the standard backslash interpretations | |
58 | apply: "\en" (for the newline character), | |
59 | "\et" (for the tab character), "\eb" (for the backspace character), | |
60 | and "\e\e" (for the backslash character). | |
9dc6ad1e | 61 | .P |
27b422f5 TT |
62 | Some relations expect a boolean value. The parser is quite liberal on |
63 | recognizing ``yes'', '`y'', ``true'', ``t'', ``1'', ``on'', etc. as a | |
64 | boolean true value, and ``no'', ``n'', ``false'', ``nil'', ``0'', | |
65 | ``off'' as a boolean false value. | |
66 | .P | |
9447f38a | 67 | The following stanzas are used in the |
9dc6ad1e TT |
68 | .I mke2fs.conf |
69 | file. They will be described in more detail in future sections of this | |
70 | document. | |
f83f4132 TT |
71 | .TP |
72 | .I [options] | |
73 | Contains relations which influence how mke2fs behaves. | |
74 | .TP | |
9dc6ad1e | 75 | .I [defaults] |
4c2b28ab | 76 | Contains relations which define the default parameters |
9dc6ad1e TT |
77 | used by |
78 | .BR mke2fs (8). | |
79 | In general, these defaults may be overridden by a definition in the | |
80 | .B fs_types | |
fac9525e | 81 | stanza, or by an command-line option provided by the user. |
9dc6ad1e TT |
82 | .TP |
83 | .I [fs_types] | |
84 | Contains relations which define defaults that should be used for specific | |
85 | filesystem types. The filesystem type can be specified explicitly using | |
86 | the | |
87 | .B -T | |
88 | option to | |
89 | .BR mke2fs (8). | |
f83f4132 TT |
90 | .SH THE [options] STANZA |
91 | The following relations are defined in the | |
92 | .I [options] | |
93 | stanza. | |
94 | .TP | |
95 | .I proceed_delay | |
96 | If this relation is set to a positive integer, then if mke2fs will | |
97 | proceed after waiting | |
98 | .I proceed_delay | |
99 | seconds, after asking the user for permission to proceed, even if the | |
100 | user has not answered the question. Defaults to 0, which means to wait | |
101 | until the user answers the question one way or another. | |
fac9525e | 102 | .SH THE [defaults] STANZA |
9dc6ad1e TT |
103 | The following relations are defined in the |
104 | .I [defaults] | |
fac9525e | 105 | stanza. |
9dc6ad1e TT |
106 | .TP |
107 | .I base_features | |
108 | This relation specifies the filesystems features which are enabled in | |
9447f38a | 109 | newly created filesystems. It may be overridden by the |
9dc6ad1e | 110 | .I base_features |
3d43836f | 111 | relation found in the filesystem or usage type subsection of |
9dc6ad1e TT |
112 | the |
113 | .I [fs_types] | |
fac9525e | 114 | stanza. |
9dc6ad1e TT |
115 | .TP |
116 | .I default_features | |
117 | This relation specifies a set of features that should be added or | |
118 | removed to the features listed in the | |
119 | .I base_features | |
9447f38a | 120 | relation. It may be overridden by the filesystem-specific |
9dc6ad1e | 121 | .I default_features |
3d43836f | 122 | in the filesystem or usage type subsection of |
9dc6ad1e TT |
123 | .IR [fs_types] , |
124 | and by the | |
125 | .B -O | |
126 | command-line option | |
127 | to | |
128 | .BR mke2fs (8). | |
129 | .TP | |
3daf5926 | 130 | .I enable_periodic_fsck |
27b422f5 TT |
131 | This boolean relation specifies whether periodic filesystem checks should be |
132 | enforced at boot time. If set to true, checks will be forced every | |
3daf5926 ES |
133 | 180 days, or after a random number of mounts. These values may |
134 | be changed later via the | |
135 | .B -i | |
136 | and | |
137 | .B -c | |
138 | command-line options to | |
139 | .BR tune2fs (8). | |
140 | .TP | |
b626b39a | 141 | .I force_undo |
27b422f5 | 142 | This boolean relation, if set to a value of true, forces |
b626b39a AK |
143 | .B mke2fs |
144 | to always try to create an undo file, even if the undo file might be | |
145 | huge and it might extend the time to create the filesystem image | |
146 | because the inode table isn't being initialized lazily. | |
147 | .TP | |
3d43836f TT |
148 | .I fs_type |
149 | This relation specifies the default filesystem type if the user does not | |
150 | specify it via the | |
151 | .B \-t | |
152 | option, or if | |
153 | .B mke2fs | |
154 | is not started using a program name of the form | |
155 | .BI mkfs. fs-type\fR. | |
156 | If both the user and the | |
157 | .B mke2fs.conf | |
158 | file does not specify a default filesystem type, mke2fs will use a | |
159 | default filesystem type of | |
160 | .IR ext3 | |
161 | if a journal was requested via a command-line option, or | |
162 | .I ext2 | |
163 | if not. | |
164 | .TP | |
9dc6ad1e TT |
165 | .I blocksize |
166 | This relation specifies the default blocksize if the user does not | |
167 | specify a blocksize on the command line, and the filesystem-type | |
168 | specific section of the configuration file does not specify a blocksize. | |
169 | .TP | |
d5f57d95 TT |
170 | .I hash_alg |
171 | This relation specifies the default hash algorithm used for the | |
172 | new filesystems with hashed b-tree directories. Valid algorithms | |
173 | accepted are: | |
174 | .IR legacy , | |
175 | .IR half_md4 , | |
176 | and | |
177 | .IR tea . | |
178 | .TP | |
9dc6ad1e TT |
179 | .I inode_ratio |
180 | This relation specifies the default inode ratio if the user does not | |
181 | specify one on the command line, and the filesystem-type | |
182 | specific section of the configuration file does not specify a default | |
183 | inode ratio. | |
067911ae AD |
184 | .TP |
185 | .I inode_size | |
186 | This relation specifies the default inode size if the user does not | |
187 | specify one on the command line, and the filesystem-type | |
188 | specific section of the configuration file does not specify a default | |
189 | inode size. | |
b626b39a | 190 | .TP |
d3859af3 AK |
191 | .I reserved_ratio |
192 | This relation specifies the default percentage of filesystem blocks | |
193 | reserved for the super-user, if the user does not | |
194 | specify one on the command line, and the filesystem-type | |
195 | specific section of the configuration file does not specify a default | |
196 | reserved ratio. This value can be a floating point number. | |
197 | .TP | |
b626b39a AK |
198 | .I undo_dir |
199 | This relation specifies the directory where the undo file should be | |
711d3846 | 200 | stored. It can be overridden via the |
b626b39a | 201 | .B E2FSPROGS_UNDO_DIR |
711d3846 | 202 | environment variable. If the directory location is set to the value |
b626b39a AK |
203 | .IR none , |
204 | .B mke2fs | |
205 | will not create an undo file. | |
fac9525e | 206 | .SH THE [fs_types] STANZA |
9dc6ad1e TT |
207 | Each tag in the |
208 | .I [fs_types] | |
3d43836f TT |
209 | stanza names a filesystem type or usage type which can be specified via the |
210 | .B \-t | |
211 | or | |
212 | .B \-T | |
213 | options to | |
214 | .BR mke2fs (8), | |
215 | respectively. | |
216 | .P | |
217 | The | |
218 | .B mke2fs | |
219 | program constructs a list of fs_types by concatenating the filesystem | |
220 | type (i.e., ext2, ext3, etc.) with the usage type list. For most | |
221 | configuration options, | |
222 | .B mke2fs | |
223 | will look for a subsection in the | |
224 | .I [fs_types] | |
225 | stanza corresponding with each entry in the constructed list, with later | |
226 | entries overriding earlier filesystem or usage types. | |
227 | For | |
228 | example, consider the following | |
229 | .B mke2fs.conf | |
230 | fragment: | |
9dc6ad1e | 231 | .P |
3d43836f TT |
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 | |
9dc6ad1e | 244 | [fs_types] |
3d43836f TT |
245 | .br |
246 | 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 | } | |
9dc6ad1e TT |
259 | .br |
260 | small = { | |
261 | .br | |
262 | blocksize = 1024 | |
263 | .br | |
264 | inode_ratio = 4096 | |
265 | .br | |
266 | } | |
267 | .br | |
268 | floppy = { | |
3d43836f TT |
269 | .br |
270 | features = ^resize_inode | |
9dc6ad1e TT |
271 | .br |
272 | blocksize = 1024 | |
3d43836f TT |
273 | .br |
274 | inode_size = 128 | |
9dc6ad1e TT |
275 | .br |
276 | } | |
277 | .P | |
3d43836f TT |
278 | If mke2fs started with a program name of |
279 | .BR mke2fs.ext4 , | |
280 | then the filesystem type of ext4 will be used. If the filesystem is | |
281 | smaller than 3 megabytes, and no usage type is specified, then | |
282 | .B mke2fs | |
283 | will use a default | |
284 | usage type of | |
285 | .IR floppy . | |
286 | This results in an fs_types list of "ext4, floppy". Both the ext4 | |
287 | subsection and the floppy subsection define an | |
288 | .I inode_size | |
711d3846 | 289 | relation, but since the later entries in the fs_types list supersede |
3d43836f TT |
290 | earlier ones, the configuration parameter for fs_types.floppy.inode_size |
291 | will be used, so the filesystem will have an inode size of 128. | |
292 | .P | |
293 | The exception to this resolution is the | |
294 | .I features | |
295 | tag, which is specifies a set of changes to the features used by the | |
296 | filesystem, and which is cumulative. So in the above example, first | |
297 | the configuration relation defaults.base_features would enable an | |
298 | initial feature set with the sparse_super, filetype, resize_inode, and | |
299 | dir_index features enabled. Then configuration relation | |
300 | fs_types.ext4.features would enable the extents and flex_bg | |
301 | features, and finally the configuration relation | |
302 | fs_types.floppy.features would remove | |
303 | the resize_inode feature, resulting in a filesystem feature set | |
304 | consisting of the sparse_super, filetype, resize_inode, dir_index, | |
305 | extents_and flex_bg features. | |
306 | .P | |
fac9525e | 307 | For each filesystem type, the following tags may be used in that |
9dc6ad1e TT |
308 | fs_type's subsection: |
309 | .TP | |
310 | .I base_features | |
3d43836f TT |
311 | This relation specifies the features which are initially enabled for this |
312 | filesystem type. Only one | |
313 | .I base_features | |
314 | will be used, so if there are multiple entries in the fs_types list | |
315 | whose subsections define the | |
316 | .I base_features | |
317 | relation, only the last will be used by | |
318 | .BR mke2fs (8). | |
319 | .TP | |
320 | .I features | |
321 | This relation specifies a comma-separated list of features edit | |
322 | requests which modify the feature set | |
323 | used by the newly constructed filesystem. The syntax is the same as the | |
324 | .B -O | |
325 | command-line option to | |
326 | .BR mke2fs (8); | |
327 | that is, a feature can be prefixed by a caret ('^') symbol to disable | |
328 | a named feature. Each | |
329 | .I feature | |
330 | relation specified in the fs_types list will be applied in the order | |
331 | found in the fs_types list. | |
9dc6ad1e TT |
332 | .TP |
333 | .I default_features | |
334 | This relation specifies set of features which should be enabled or | |
3d43836f | 335 | disabled after applying the features listed in the |
9dc6ad1e | 336 | .I base_features |
3d43836f TT |
337 | and |
338 | .I features | |
339 | relations. It may be overridden by the | |
9dc6ad1e TT |
340 | .B -O |
341 | command-line option to | |
342 | .BR mke2fs (8). | |
343 | .TP | |
493024ea TT |
344 | .I auto_64-bit_support |
345 | This relation is a boolean which specifies whether | |
346 | .BR mke2fs (8) | |
347 | should automatically add the 64bit feature if the number of blocks for | |
348 | the file system requires this feature to be enabled. The resize_inode | |
349 | feature is also automatically disabled since it doesn't support 64-bit | |
350 | block numbers. | |
351 | .TP | |
6a426c97 ES |
352 | .I default_mntopts |
353 | This relation specifies the set of mount options which should be enabled | |
354 | by default. These may be changed at a later time with the | |
355 | .B -o | |
356 | command-line option to | |
357 | .BR tune2fs (8). | |
358 | .TP | |
9dc6ad1e TT |
359 | .I blocksize |
360 | This relation specifies the default blocksize if the user does not | |
361 | specify a blocksize on the command line. | |
362 | .TP | |
a4396e9d | 363 | .I lazy_itable_init |
27b422f5 | 364 | This boolean relation specifies whether the inode table should |
a4396e9d TT |
365 | be lazily initialized. It only has meaning if the uninit_bg feature is |
366 | enabled. If lazy_itable_init is true and the uninit_bg feature is | |
367 | enabled, the inode table will | |
368 | not fully initialized by | |
369 | .BR mke2fs (8). | |
370 | This speeds up filesystem | |
711d3846 | 371 | initialization noticeably, but it requires the kernel to finish |
a4396e9d TT |
372 | initializing the filesystem in the background when the filesystem is |
373 | first mounted. | |
374 | .TP | |
b818205f TT |
375 | .I journal_location |
376 | This relation specifies the location of the journal. | |
377 | .TP | |
65c6c3e0 TT |
378 | .I num_backup_sb |
379 | This relation indicates whether file systems with the | |
380 | .B sparse_super2 | |
381 | feature enabled should be created with 0, 1, or 2 backup superblocks. | |
382 | .TP | |
3c6e91c5 TT |
383 | .I packed_meta_blocks |
384 | This boolean relation specifes whether the allocation bitmaps, inode | |
385 | table, and journal should be located at the beginning of the file system. | |
386 | .TP | |
9dc6ad1e TT |
387 | .I inode_ratio |
388 | This relation specifies the default inode ratio if the user does not | |
389 | specify one on the command line. | |
067911ae AD |
390 | .TP |
391 | .I inode_size | |
392 | This relation specifies the default inode size if the user does not | |
393 | specify one on the command line. | |
9ba40002 | 394 | .TP |
d3859af3 AK |
395 | .I reserved_ratio |
396 | This relation specifies the default percentage of filesystem blocks | |
397 | reserved for the super-user, if the user does not specify one on the command | |
398 | line. | |
399 | .TP | |
d5f57d95 TT |
400 | .I hash_alg |
401 | This relation specifies the default hash algorithm used for the | |
402 | new filesystems with hashed b-tree directories. Valid algorithms | |
403 | accepted are: | |
404 | .IR legacy , | |
405 | .IR half_md4 , | |
406 | and | |
407 | .IR tea . | |
408 | .TP | |
9ba40002 | 409 | .I flex_bg_size |
d4a93302 | 410 | This relation specifies the number of block groups that will be packed |
9ba40002 TT |
411 | together to create one large virtual block group on an ext4 filesystem. |
412 | This improves meta-data locality and performance on meta-data heavy | |
d4a93302 | 413 | workloads. The number of groups must be a power of 2 and may only be |
9ba40002 | 414 | specified if the flex_bg filesystem feature is enabled. |
b75a4ce1 | 415 | .TP |
2d36358d TT |
416 | .I options |
417 | This relation specifies additional extended options which should be | |
418 | treated by | |
419 | .BR mke2fs (8) | |
420 | as if they were prepended to the argument of the | |
421 | .B -E | |
422 | option. This can be used to configure the default extended options used | |
423 | by | |
424 | .BR mke2fs (8) | |
425 | on a per-filesystem type basis. | |
7fe5ff3c LC |
426 | .TP |
427 | .I discard | |
27b422f5 | 428 | This boolean relation specifies whether the |
7fe5ff3c LC |
429 | .BR mke2fs (8) |
430 | should attempt to discard device prior to filesystem creation. | |
2d34a25f TT |
431 | .TP |
432 | .I cluster_size | |
433 | This relation specifies the default cluster size if the bigalloc file | |
434 | system feature is enabled. It can be overridden via the | |
435 | .B \-C | |
436 | command line option to | |
437 | .BR mke2fs (8) | |
23a1b987 TT |
438 | .TP |
439 | .I make_hugefiles | |
440 | This boolean relation enables the creation of pre-allocated files as | |
441 | part of formatting the file system. | |
442 | .TP | |
443 | .I hugefiles_uid | |
444 | This relation controls the user ownership for all of the files and | |
445 | directories created by the | |
446 | .I make_hugefiles | |
447 | feature. | |
448 | .TP | |
449 | .I hugefiles_gid | |
450 | This relation controls the group ownership for all of the files and | |
451 | directories created by the | |
452 | .I make_hugefiles | |
453 | feature. | |
454 | .TP | |
455 | .I hugefiles_umask | |
456 | This relation specifies the umask used when creating the files and | |
457 | directories by the | |
458 | .I make_hugefiles | |
459 | feature. | |
460 | .TP | |
461 | .I num_hugefiles | |
462 | This relation specifies the number of huge files to be created. If this | |
463 | relation is not specified, or is set to zero, and the | |
464 | .I hugefiles_size | |
465 | relation is non-zero, then | |
466 | .I make_hugefiles | |
467 | will create as many huge files as can fit to fill the entire file system. | |
468 | .TP | |
469 | .I hugefiles_slack | |
470 | This relation specifies how much space should be reserved for other | |
471 | files. | |
472 | .TP | |
473 | .I hugefiles_size | |
474 | This relation specifies the size of the huge files. If this relation is | |
7efd2507 TT |
475 | not specified, the default is to fill the entire file system. |
476 | .TP | |
477 | .I hugefiles_align | |
478 | This relation specifies the alignment for the start block of the huge | |
479 | files. It also forces the size of huge files to be a multiple of the | |
480 | requested alignment. If this relation is not specified, no alignment | |
481 | requirement will be imposed on the huge files. | |
23a1b987 | 482 | .TP |
c42de75b TT |
483 | .I hugefiles_align_disk |
484 | Thie relations specifies whether the alignment should be relative to the | |
485 | beginning of the hard drive (assuming that the starting offset of the | |
486 | partition is available to mke2fs). The default value is false, which | |
487 | if will cause hugefile alignment to be relative to the beginning of the | |
488 | file system. | |
489 | .TP | |
23a1b987 TT |
490 | .I hugefiles_name |
491 | This relation specifies the base file name for the huge files. | |
492 | .TP | |
493 | .I hugefiles_digits | |
494 | This relation specifies the (zero-padded) width of the field for the | |
495 | huge file number. | |
496 | .TP | |
497 | .I zero_hugefiles | |
498 | This boolean relation specifies whether or not zero blocks will be | |
499 | written to the hugefiles while | |
500 | .BR mke2fs(8) | |
501 | is creating them. By default, zero blocks will be written to the huge | |
502 | files to avoid stale data from being made available to potentially | |
503 | untrusted user programs, unless the device supports a discard/trim | |
504 | operation which will take care of zeroing the device blocks. By | |
505 | .I zero_hugefiles | |
506 | to false, this step will always be skipped, which can be useful if it is | |
507 | known that the disk has been previously erased, or if the user programs | |
508 | that will have access to the huge files are trusted to not reveal stale | |
509 | data. | |
4c2b28ab TT |
510 | .SH THE [devices] STANZA |
511 | Each tag in the | |
512 | .I [devices] | |
513 | stanza names device name so that per-device defaults can be specified. | |
514 | .TP | |
515 | .I fs_type | |
516 | This relation specifies the default parameter for the | |
517 | .B \-t | |
518 | option, if this option isn't specified on the command line. | |
519 | .TP | |
520 | .I usage_types | |
521 | This relation specifies the default parameter for the | |
522 | .B \-T | |
523 | option, if this option isn't specified on the command line. | |
9dc6ad1e TT |
524 | .SH FILES |
525 | .TP | |
526 | .I /etc/mke2fs.conf | |
527 | The configuration file for | |
528 | .BR mke2fs (8). | |
529 | .SH SEE ALSO | |
530 | .BR mke2fs (8) |