1mke2fs.conf(5)                File Formats Manual               mke2fs.conf(5)
2
3
4

NAME

6       mke2fs.conf - Configuration file for mke2fs
7

DESCRIPTION

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 file systems.
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 be‐
18       low:
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       [options]
54              Contains relations which influence how mke2fs behaves.
55
56       [defaults]
57              Contains relations which define the default parameters  used  by
58              mke2fs(8).   In  general,  these defaults may be overridden by a
59              definition in the fs_types stanza, or by a  command-line  option
60              provided by the user.
61
62       [fs_types]
63              Contains relations which define defaults that should be used for
64              specific file system and usage types.  The file system type  and
65              usage type can be specified explicitly using the -tand-T options
66              to mke2fs(8), respectively.
67
68       [devices]
69              Contains relations which define defaults for specific devices.
70

THE [options] STANZA

72       The following relations are defined in the [options] stanza.
73
74       proceed_delay
75              If this relation is set to a positive integer, then mke2fs  will
76              wait  proceed_delay seconds after asking the user for permission
77              to proceed and then continue, even if the user has not  answered
78              the question.  Defaults to 0, which means to wait until the user
79              answers the question one way or another.
80
81       sync_kludge
82              If this relation is set to a positive integer, then while  writ‐
83              ing  the  inode  table, mke2fs will request the operating system
84              flush out pending writes to initialize  the  inode  table  every
85              sync_kludge  block groups.   This is needed to work around buggy
86              kernels that don't handle writeback throttling correctly.
87

THE [defaults] STANZA

89       The following relations are defined in the [defaults] stanza.
90
91       creator_os
92              This relation specifies the "creator operating system"  for  the
93              file  system  unless  it is overridden on the command line.  The
94              default value is the OS for which the mke2fs executable was com‐
95              piled.
96
97       fs_type
98              This relation specifies the default file system type if the user
99              does not specify it via the -t  option,  or  if  mke2fs  is  not
100              started  using a program name of the form mkfs.fs-type.  If both
101              the user and the mke2fs.conf file do not specify a default  file
102              system  type, mke2fs will use a default file system type of ext3
103              if a journal was requested via a command-line option, or ext2 if
104              not.
105
106       undo_dir
107              This relation specifies the directory where the undo file should
108              be stored.  It can be overridden via the E2FSPROGS_UNDO_DIR  en‐
109              vironment  variable.   If  the  directory location is set to the
110              value none, mke2fs will not create an undo file.
111
112       In addition, any tags that can be specified in a per-file  system  tags
113       subsection  as  defined  below (e.g., blocksize, hash_alg, inode_ratio,
114       inode_size, reserved_ratio, etc.) can also be specified in the defaults
115       stanza  to  specify  the  default value to be used if the user does not
116       specify one on the command line, and the file system-type specific sec‐
117       tion of the configuration file does not specify a default value.
118

THE [fs_types] STANZA

120       Each  tag  in  the  [fs_types] stanza names a file system type or usage
121       type which can be specified via the -t or -T options to mke2fs(8),  re‐
122       spectively.
123
124       The  mke2fs  program constructs a list of fs_types by concatenating the
125       file system type (i.e., ext2, ext3, etc.) with  the  usage  type  list.
126       For  most  configuration  options, mke2fs will look for a subsection in
127       the [fs_types] stanza corresponding with each entry in the  constructed
128       list, with later entries overriding earlier file system or usage types.
129       For example, consider the following mke2fs.conf fragment:
130
131       [defaults]
132            base_features = sparse_super,filetype,resize_inode,dir_index
133            blocksize = 4096
134            inode_size = 256
135            inode_ratio = 16384
136
137       [fs_types]
138            ext3 = {
139                 features = has_journal
140            }
141            ext4 = {
142                 features = extents,flex_bg
143                 inode_size = 256
144            }
145            small = {
146                 blocksize = 1024
147                 inode_ratio = 4096
148            }
149            floppy = {
150                 features = ^resize_inode
151                 blocksize = 1024
152                 inode_size = 128
153            }
154
155       If mke2fs started with a program name of  mke2fs.ext4,  then  the  file
156       system type of ext4 will be used.  If the file system is smaller than 3
157       megabytes, and no usage type is specified, then mke2fs will use  a  de‐
158       fault usage type of floppy.  This results in an fs_types list of "ext4,
159       floppy".   Both the ext4 subsection and the floppy subsection define an
160       inode_size  relation,  but since the later entries in the fs_types list
161       supersede   earlier   ones,    the    configuration    parameter    for
162       fs_types.floppy.inode_size  will be used, so the file system  will have
163       an inode size of 128.
164
165       The exception to this resolution is the features tag, which specifies a
166       set  of  changes  to the features used by the file system, and which is
167       cumulative.  So in the above example, first the configuration  relation
168       defaults.base_features  would  enable  an  initial feature set with the
169       sparse_super, filetype, resize_inode, and dir_index  features  enabled.
170       Then configuration relation fs_types.ext4.features would enable the ex‐
171       tents and flex_bg features,  and  finally  the  configuration  relation
172       fs_types.floppy.features would remove the resize_inode feature, result‐
173       ing in a file system feature set consisting of the sparse_super,  file‐
174       type, dir_index, extents_and flex_bg features.
175
176       For  each  file  system  type,  the  following tags may be used in that
177       fs_type's subsection.   These tags may also be used in the default sec‐
178       tion:
179
180       base_features
181              This relation specifies the features which are initially enabled
182              for this file system type.  Only one base_features will be used,
183              so if there are multiple entries in the fs_types list whose sub‐
184              sections define the base_features relation, only the  last  will
185              be used by mke2fs(8).
186
187       enable_periodic_fsck
188              This  boolean  relation  specifies  whether periodic file system
189              checks should be enforced at boot time.  If set to true,  checks
190              will  be  forced  every  180  days,  or after a random number of
191              mounts.  These values may be changed later via  the  -i  and  -c
192              command-line options to tune2fs(8).
193
194       errors Change the behavior of the kernel code when errors are detected.
195              In all cases, a file system error will cause e2fsck(8) to  check
196              the file system on the next boot.  errors can be one of the fol‐
197              lowing:
198
199                   continue    Continue normal execution.
200
201                   remount-ro  Remount file system read-only.
202
203                   panic       Cause a kernel panic.
204
205       features
206              This relation specifies a comma-separated list of features  edit
207              requests  which  modify  the  feature set used by the newly con‐
208              structed file system.  The syntax is the same as the -O command-
209              line  option to mke2fs(8); that is, a feature can be prefixed by
210              a caret ('^') symbol to disable a named feature.   Each  feature
211              relation  specified  in the fs_types list will be applied in the
212              order found in the fs_types list.
213
214       force_undo
215              This boolean relation, if set to a value of true, forces  mke2fs
216              to  always  try  to  create  an undo file, even if the undo file
217              might be huge and it might extend the time to  create  the  file
218              system  image  because  the  inode table isn't being initialized
219              lazily.
220
221       default_features
222              This relation specifies set of features which should be  enabled
223              or  disabled after applying the features listed in the base_fea‐
224              tures and features relations.  It may be overridden  by  the  -O
225              command-line option to mke2fs(8).
226
227       auto_64-bit_support
228              This  relation  is  a  boolean which specifies whether mke2fs(8)
229              should automatically add the 64bit  feature  if  the  number  of
230              blocks  for the file system requires this feature to be enabled.
231              The resize_inode feature is also automatically disabled since it
232              doesn't support 64-bit block numbers.
233
234       default_mntopts
235              This relation specifies the set of mount options which should be
236              enabled by default.  These may be changed at a later  time  with
237              the -o command-line option to tune2fs(8).
238
239       blocksize
240              This  relation  specifies the default blocksize if the user does
241              not specify a blocksize on the command line.
242
243       lazy_itable_init
244              This boolean relation specifies whether the inode  table  should
245              be  lazily  initialized.   It  only has meaning if the uninit_bg
246              feature  is  enabled.   If  lazy_itable_init  is  true  and  the
247              uninit_bg feature is enabled,  the inode table will not be fully
248              initialized by mke2fs(8).  This speeds up file  system  initial‐
249              ization  noticeably,  but  it requires the kernel to finish ini‐
250              tializing the file system in the background when the file system
251              is first mounted.
252
253       lazy_journal_init
254              This boolean relation specifies whether the journal inode should
255              be lazily initialized. It only has meaning  if  the  has_journal
256              feature  is  enabled.  If lazy_journal_init is true, the journal
257              inode will not be fully zeroed out by mke2fs.   This  speeds  up
258              file  system  initialization  noticeably, but carries some small
259              risk if the system crashes before the journal has been overwrit‐
260              ten entirely one time.
261
262       journal_location
263              This relation specifies the location of the journal.
264
265       num_backup_sb
266              This relation indicates whether file systems with the sparse_su‐
267              per2 feature enabled should be created with 0, 1,  or  2  backup
268              superblocks.
269
270       packed_meta_blocks
271              This  boolean relation specifies whether the allocation bitmaps,
272              inode table, and journal should be located at the  beginning  of
273              the file system.
274
275       inode_ratio
276              This relation specifies the default inode ratio if the user does
277              not specify one on the command line.
278
279       inode_size
280              This relation specifies the default inode size if the user  does
281              not specify one on the command line.
282
283       reserved_ratio
284              This  relation  specifies  the default percentage of file system
285              blocks reserved for the super-user, if the user does not specify
286              one on the command line.
287
288       hash_alg
289              This  relation specifies the default hash algorithm used for the
290              new file systems with hashed b-tree  directories.   Valid  algo‐
291              rithms accepted are: legacy, half_md4, and tea.
292
293       flex_bg_size
294              This  relation specifies the number of block groups that will be
295              packed together to create one large virtual block  group  on  an
296              ext4  file system.  This improves meta-data locality and perfor‐
297              mance on meta-data heavy workloads.  The number of  groups  must
298              be  a  power  of 2 and may only be specified if the flex_bg file
299              system feature is enabled.
300
301       options
302              This relation specifies additional extended options which should
303              be  treated  by mke2fs(8) as if they were prepended to the argu‐
304              ment of the -E option.  This can be used to  configure  the  de‐
305              fault  extended  options  used by mke2fs(8) on a per-file system
306              type basis.
307
308       discard
309              This boolean relation specifies whether the mke2fs(8) should at‐
310              tempt to discard device prior to file system creation.
311
312       cluster_size
313              This relation specifies the default cluster size if the bigalloc
314              file system feature is enabled.  It can be overridden via the -C
315              command line option to mke2fs(8)
316
317       make_hugefiles
318              This  boolean  relation  enables  the  creation of pre-allocated
319              files as part of formatting the file system.   The  extent  tree
320              blocks for these pre-allocated files will be placed near the be‐
321              ginning of the file system, so that if all of the other metadata
322              blocks  are  also  configured to be placed near the beginning of
323              the file system (by disabling the backup superblocks, using  the
324              packed_meta_blocks option, etc.), the data blocks of the pre-al‐
325              located files will be contiguous.
326
327       hugefiles_dir
328              This relation specifies the directory where huge files are  cre‐
329              ated, relative to the file system root.
330
331       hugefiles_uid
332              This  relation  controls the user ownership for all of the files
333              and directories created by the make_hugefiles feature.
334
335       hugefiles_gid
336              This relation controls the group ownership for all of the  files
337              and directories created by the make_hugefiles feature.
338
339       hugefiles_umask
340              This  relation  specifies the umask used when creating the files
341              and directories by the make_hugefiles feature.
342
343       num_hugefiles
344              This relation specifies the number of huge files to be  created.
345              If  this  relation  is not specified, or is set to zero, and the
346              hugefiles_size relation is non-zero,  then  make_hugefiles  will
347              create  as  many  huge  files as can fit to fill the entire file
348              system.
349
350       hugefiles_slack
351              This relation specifies how much space should  be  reserved  for
352              other files.
353
354       hugefiles_size
355              This relation specifies the size of the huge files.  If this re‐
356              lation is not specified, the default is to fill the entire  file
357              system.
358
359       hugefiles_align
360              This relation specifies the alignment for the start block of the
361              huge files.  It also forces the size of huge files to be a  mul‐
362              tiple of the requested alignment.  If this relation is not spec‐
363              ified, no alignment requirement will  be  imposed  on  the  huge
364              files.
365
366       hugefiles_align_disk
367              This  relations  specifies whether the alignment should be rela‐
368              tive to the beginning of  the  hard  drive  (assuming  that  the
369              starting  offset  of the partition is available to mke2fs).  The
370              default value is false, which will cause hugefile  alignment  to
371              be relative to the beginning of the file system.
372
373       hugefiles_name
374              This relation specifies the base file name for the huge files.
375
376       hugefiles_digits
377              This relation specifies the (zero-padded) width of the field for
378              the huge file number.
379
380       warn_y2038_dates
381              This boolean relation specifies  whether  mke2fs  will  issue  a
382              warning when creating a file system with 128 byte inodes (and so
383              therefore will not support dates after January 19th, 2038).  The
384              default  value  is true, except for file systems created for the
385              GNU Hurd since it only supports 128-byte inodes.
386
387       zero_hugefiles
388              This boolean relation specifies whether or not zero blocks  will
389              be  written  to  the hugefiles while mke2fs(8) is creating them.
390              By default, zero blocks will be written to  the  huge  files  to
391              avoid  stale  data  from being made available to potentially un‐
392              trusted user programs, unless the device supports a discard/trim
393              operation which will take care of zeroing the device blocks.  By
394              setting zero_hugefiles  to  false,  this  step  will  always  be
395              skipped,  which  can  be useful if it is known that the disk has
396              been previously erased, or if the user programs that  will  have
397              access to the huge files are trusted to not reveal stale data.
398
399       encoding
400              This  relation  defines the file name encoding to be used if the
401              casefold feature is enabled.   Currently the only valid encoding
402              is  utf8-12.1  or  utf8,  which requests the most recent Unicode
403              version; since 12.1 is the only available Unicode version,  utf8
404              and  utf8-12.1  have the same result.  encoding_flags This rela‐
405              tion defines encoding-specific flags.  For utf8  encodings,  the
406              only available flag is strict, which will cause attempts to cre‐
407              ate file names containing invalid Unicode characters to  be  re‐
408              jected by the kernel.  Strict mode is not enabled by default.
409

THE [devices] STANZA

411       Each  tag  in the [devices] stanza names device name so that per-device
412       defaults can be specified.
413
414       fs_type
415              This relation specifies the default parameter for the -t option,
416              if this option isn't specified on the command line.
417
418       usage_types
419              This relation specifies the default parameter for the -T option,
420              if this option isn't specified on the command line.
421

FILES

423       /etc/mke2fs.conf
424              The configuration file for mke2fs(8).
425

SEE ALSO

427       mke2fs(8)
428
429
430
431E2fsprogs version 1.46.5         December 2021                  mke2fs.conf(5)
Impressum