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 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       [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       fs_type
92              This relation specifies the default filesystem type if the  user
93              does  not  specify  it  via  the  -t option, or if mke2fs is not
94              started using a program name of the form mkfs.fs-type.  If  both
95              the  user  and  the  mke2fs.conf  file  do not specify a default
96              filesystem type, mke2fs will use a default  filesystem  type  of
97              ext3  if  a  journal was requested via a command-line option, or
98              ext2 if not.
99
100       undo_dir
101              This relation specifies the directory where the undo file should
102              be  stored.   It  can  be  overridden via the E2FSPROGS_UNDO_DIR
103              environment variable.  If the directory location is set  to  the
104              value none, mke2fs will not create an undo file.
105
106       In  addition,  any tags that can be specified in a per-file system tags
107       subsection as defined below (e.g.,  blocksize,  hash_alg,  inode_ratio,
108       inode_size, reserved_ratio, etc.) can also be specified in the defaults
109       stanza to specify the default value to be used if  the  user  does  not
110       specify  one on the command line, and the filesystem-type specific sec‐
111       tion of the configuration file does not specify a default value.
112

THE [fs_types] STANZA

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

THE [devices] STANZA

399       Each  tag  in the [devices] stanza names device name so that per-device
400       defaults can be specified.
401
402       fs_type
403              This relation specifies the default parameter for the -t option,
404              if this option isn't specified on the command line.
405
406       usage_types
407              This relation specifies the default parameter for the -T option,
408              if this option isn't specified on the command line.
409

FILES

411       /etc/mke2fs.conf
412              The configuration file for mke2fs(8).
413

SEE ALSO

415       mke2fs(8)
416
417
418
419E2fsprogs version 1.45.6          March 2020                    mke2fs.conf(5)
Impressum