Home : Computers : Linux : Man Pages : mke2fs.conf

mke2fs.conf


DESCRIPTION

       mke2fs.conf  is  the configuration file for mke2fs(8).  It controls the
       default parameters used by mke2fs(8) when it is creating ext2, ext3, or
       ext4 filesystems.

       The  mke2fs.conf  file uses an INI-style format.  Stanzas, or top-level
       sections, are delimited by square braces: [ ].   Within  each  section,
       each  line  defines  a  relation, which assigns tags to values, or to a
       subsection, which contains further relations or subsections.  An  exam-
       ple  of  the  INI-style  format used by this configuration file follows
       below:

            [section1]
                 tag1 = value_a
                 tag1 = value_b
                 tag2 = value_c

            [section 2]
                 tag3 = {
                      subtag1 = subtag_value_a
                      subtag1 = subtag_value_b
                      subtag2 = subtag_value_c
                 }
                 tag1 = value_d
                 tag2 = value_e
            }

       Comments are delimited by a semicolon (';') or a hash  ('#')  character
       at  the beginning of the comment, and are terminated by the end of line
       character.

       Tags and values must be quoted using double quotes if they contain spa-
       ces.   Within  a  quoted string, the standard backslash interpretations
       apply: "\n" (for the newline character), "\t" (for the tab  character),
       "\b" (for the backspace character), and "\\" (for the backslash charac-
       ter).

       Some relations expect a boolean value.  The parser is quite liberal  on
       recognizing  ``yes'',  '`y'', ``true'', ``t'', ``1'', ``on'', etc. as a
       boolean true value,  and  ``no'',  ``n'',  ``false'',  ``nil'',  ``0'',
       ``off'' as a boolean false value.

       The  following  stanzas are used in the mke2fs.conf file.  They will be
       described in more detail in future sections of this document.

       [defaults]
              Contains relations which define the default parameters  used  by
              mke2fs(8).   In  general,  these defaults may be overridden by a
              definition in the fs_types stanza, or by an command-line  option
              provided by the user.

       [fs_types]
              This relation specifies a set of features that should  be  added
              or removed to the features listed in the base_features relation.
              It may be overridden by the filesystem-specific default_features
              in the filesystem or usage type subsection of [fs_types], and by
              the -O command-line option to mke2fs(8).

       enable_periodic_fsck
              This boolean  relation  specifies  whether  periodic  filesystem
              checks  should be enforced at boot time.  If set to true, checks
              will be forced every 180 days,  or  after  a  random  number  of
              mounts.   These  values  may  be changed later via the -i and -c
              command-line options to tune2fs(8).

       force_undo
              This boolean relation, if set to a value of true, forces  mke2fs
              to  always  try  to  create  an undo file, even if the undo file
              might be huge and  it  might  extend  the  time  to  create  the
              filesystem image because the inode table isn't being initialized
              lazily.

       fs_type
              This relation specifies the default filesystem type if the  user
              does  not  specify  it  via  the  -t option, or if mke2fs is not
              started using a program name of the form mkfs.fs-type.  If  both
              the  user  and  the  mke2fs.conf file does not specify a default
              filesystem type, mke2fs will use a default  filesystem  type  of
              ext3  if  a  journal was requested via a command-line option, or
              ext2 if not.

       blocksize
              This relation specifies the default blocksize if the  user  does
              not specify a blocksize on the command line, and the filesystem-
              type specific section of the configuration file does not specify
              a blocksize.

       hash_alg
              This  relation specifies the default hash algorithm used for the
              new filesystems with hashed  b-tree  directories.   Valid  algo-
              rithms accepted are: legacy, half_md4, and tea.

       inode_ratio
              This relation specifies the default inode ratio if the user does
              not specify one on the command  line,  and  the  filesystem-type
              specific  section  of  the configuration file does not specify a
              default inode ratio.

       inode_size
              This relation specifies the default inode size if the user  does
              not  specify  one  on  the command line, and the filesystem-type
              specific section of the configuration file does  not  specify  a
              default inode size.

       Each tag in the [fs_types] stanza names a filesystem type or usage type
       which  can  be specified via the -t or -T options to mke2fs(8), respec-
       tively.

       The mke2fs program constructs a list of fs_types by  concatenating  the
       filesystem type (i.e., ext2, ext3, etc.) with the usage type list.  For
       most configuration options, mke2fs will look for a  subsection  in  the
       [fs_types]  stanza  corresponding  with  each  entry in the constructed
       list, with later entries overriding earlier filesystem or usage  types.
       For example, consider the following mke2fs.conf fragment:

       [defaults]
            base_features = sparse_super,filetype,resize_inode,dir_index
            blocksize = 4096
            inode_size = 256
            inode_ratio = 16384

       [fs_types]
            ext3 = {
                 features = has_journal
            }
            ext4 = {
                 features = extents,flex_bg
                 inode_size = 256
            }
            small = {
                 blocksize = 1024
                 inode_ratio = 4096
            }
            floppy = {
                 features = ^resize_inode
                 blocksize = 1024
                 inode_size = 128
            }

       If mke2fs started with a program name of mke2fs.ext4, then the filesys-
       tem type of ext4 will be used.  If the filesystem  is  smaller  than  3
       megabytes,  and  no  usage  type  is  specified, then mke2fs will use a
       default usage type of floppy.  This results  in  an  fs_types  list  of
       "ext4,  floppy".    Both  the ext4 subsection and the floppy subsection
       define an inode_size relation, but  since  the  later  entries  in  the
       fs_types  list  supersede earlier ones, the configuration parameter for
       fs_types.floppy.inode_size will be used, so the filesystem   will  have
       an inode size of 128.

       The  exception  to this resolution is the features tag, which is speci-
       fies a set of changes to the features used by the filesystem, and which
       is  cumulative.  So in the above example, first the configuration rela-
       tion defaults.base_features would enable an initial  feature  set  with
       the   sparse_super,  filetype,  resize_inode,  and  dir_index  features
       enabled.   Then  configuration  relation  fs_types.ext4.features  would
       enable  the extents and flex_bg features, and finally the configuration

       features
              This relation specifies a comma-separated list of features  edit
              requests  which  modify  the  feature set used by the newly con-
              structed filesystem.  The syntax is the same as the -O  command-
              line  option to mke2fs(8); that is, a feature can be prefixed by
              a caret ('^') symbol to disable a named feature.   Each  feature
              relation  specified  in the fs_types list will be applied in the
              order found in the fs_types list.

       default_features
              This relation specifies set of features which should be  enabled
              or  disabled after applying the features listed in the base_fea-
              tures and features relations.  It may be overridden  by  the  -O
              command-line option to mke2fs(8).

       auto_64-bit_support
              This  relation  is  a  boolean which specifies whether mke2fs(8)
              should automatically add the 64bit  feature  if  the  number  of
              blocks  for the file system requires this feature to be enabled.
              The resize_inode feature is also automatically disabled since it
              doesn't support 64-bit block numbers.

       default_mntopts
              This relation specifies the set of mount options which should be
              enabled by default.  These may be changed at a later  time  with
              the -o command-line option to tune2fs(8).

       blocksize
              This  relation  specifies the default blocksize if the user does
              not specify a blocksize on the command line.

       lazy_itable_init
              This boolean relation specifies whether the inode  table  should
              be  lazily  initialized.   It  only has meaning if the uninit_bg
              feature  is  enabled.   If  lazy_itable_init  is  true  and  the
              uninit_bg  feature  is  enabled,  the inode table will not fully
              initialized by mke2fs(8).  This speeds up filesystem initializa-
              tion noticeably, but it requires the kernel to finish initializ-
              ing the filesystem in the  background  when  the  filesystem  is
              first mounted.

       inode_ratio
              This relation specifies the default inode ratio if the user does
              not specify one on the command line.

       inode_size
              This relation specifies the default inode size if the user  does
              not specify one on the command line.

       reserved_ratio
              This  relation  specifies  the  default percentage of filesystem
              filesystem feature is enabled.

       options
              This relation specifies additional extended options which should
              be  treated  by mke2fs(8) as if they were prepended to the argu-
              ment of the -E option.   This  can  be  used  to  configure  the
              default  extended  options used by mke2fs(8) on a per-filesystem
              type basis.

       discard
              This boolean relation specifies  whether  the  mke2fs(8)  should
              attempt to discard device prior to filesystem creation.

       cluster_size
              This relation specifies the default cluster size if the bigalloc
              file system feature is enabled.  It can be overridden via the -C
              command line option to mke2fs(8)


THE [devices] STANZA

       Each  tag  in the [devices] stanza names device name so that per-device
       defaults can be specified.

       fs_type
              This relation specifies the default parameter for the -t option,
              if this option isn't specified on the command line.

       usage_types
              This relation specifies the default parameter for the -T option,
              if this option isn't specified on the command line.


FILES

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


SEE ALSO

       mke2fs(8)


E2fsprogs version 1.42.9 December 2013 mke2fs.conf(5)



Subscribe to us on YouTube