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),
respectively.
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 filesystem 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 supercede
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 specifies a set of changes to the features used by the
filesystem, and which is cumulative. So in the above example, first
the configuration relation 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 relation
fs_types.floppy.features would remove
the resize_inode feature, resulting in a filesystem feature set
consisting of the sparse_super, filetype, resize_inode, dir_index,
extents_and flex_bg features.
For each filesystem type, the following tags may be used in that
fs_type's subsection:
- base_features
-
This relation specifies the features which are initially enabled for this
filesystem type. Only one
base_features
will be used, so if there are multiple entries in the fs_types list
whose subsections define the
base_features
relation, only the last will be used by
mke2fs(8).
- features
-
This relation specifies a comma-separated list of features edit
requests which modify the feature set
used by the newly constructed 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_features
and
features
relations. It may be overridden by the
-O
command-line option to
mke2fs(8).
- blocksize
-
This relation specifies the default blocksize if the user does not
specify a blocksize on the command line.
- lazy_itable_init
-
This relation is a boolean which 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
initialization noitceably, but it requires the kernel to finish
initializing 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.
- flex_bg_size
-
This relation specifies the number of block goups that will be packed
together to create one large virtual block group on an ext4 filesystem.
This improves meta-data locality and performance on meta-data heavy
workloads. The number of goups must be a power of 2 and may only be
specified if the flex_bg 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 argument of the
-E
option. This can be used to configure the default extended options used
by
mke2fs(8)
on a per-filesystem type basis.