mke2fs.conf(5)
๐ mke2fs.conf โ the manual, but make it make sense ๐
okay bestie, so this is mke2fs.conf(5), aka the File Formats Manual page for the config file that runs the whole show behind mke2fs(8). it's giving โจthe blueprintโจ. let's get into it.
๐ธ NAME ๐ธ
mke2fs.conf โ configuration file for mke2fs
๐ DESCRIPTION ๐
okay so mke2fs.conf is the configuration file for mke2fs(8). no cap. it controls the default parameters that mke2fs(8) uses when it's out here creating ext2, ext3, or ext4 file systems. main character energy fr fr ๐
the mke2fs.conf file uses an INI-style format. Stanzas (that's the fancy word for top-level sections, iykyk) are delimited by square braces: [ ]. inside each section, every line defines a relation, which assigns tags to values, or to a subsection โ and a subsection contains further relations or subsections. here's an example of the INI-style format this config file uses, 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
}
heads up: that trailing } at the end is literally in the original. don't @ me, i just work here ๐ซถ
comments are delimited by a semicolon (;) or a hash (#) character at the beginning of the comment, and they're terminated by the end-of-line character. periodt.
tags and values must be quoted using double quotes if they contain spaces. 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 character). ๐
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. so like. it's flexible. it ate and left no crumbs ๐
the following stanzas are used in the mke2fs.conf file. they will be described in more detail in future sections of this document. ๐
[options]โ contains relations which influence howmke2fs(8)behaves.[defaults]โ contains relations which define the default parameters used bymke2fs(8). in general, these defaults may be overridden by a definition in the[fs_types]stanza, or by a command-line option provided by the user.[fs_types]โ contains relations which define defaults that should be used for specific file system and usage types. the file system type and usage type can be specified explicitly using the-tand-Toptions tomke2fs(8), respectively.[devices]โ contains relations which define defaults for specific devices.
โจ THE [options] STANZA โจ
the following relations are defined in the [options] stanza.
proceed_delayโ if this relation is set to a positive integer, thenmke2fs(8)will waitproceed_delayseconds after asking the user for permission to proceed and then continue, even if the user has not answered the question. defaults to0, which means to wait until the user answers the question one way or another. ๐ญsync_kludgeโ if this relation is set to a positive integer, then while writing the inode table,mke2fs(8)will request the operating system flush out pending writes to initialize the inode table everysync_kludgeblock groups. this is needed to work around buggy kernels that don't handle writeback throttling correctly. ๐
๐ THE [defaults] STANZA ๐
the following relations are defined in the [defaults] stanza.
creator_osโ this relation specifies the "creator operating system" for the file system unless it is overridden on the command line. the default value is the OS for which themke2fs(8)executable was compiled. ๐งfs_typeโ this relation specifies the default file system type if the user does not specify it via the-toption, or ifmke2fs(8)is not started using a program name of the formmkfs.fs-type. if both the user and themke2fs.conffile do not specify a default file system type,mke2fswill use a default file system type ofext3if a journal was requested via a command-line option, orext2if not.undo_dirโ this relation specifies the directory where the undo file should be stored. it can be overridden via theE2FSPROGS_UNDO_DIRenvironment variable. if the directory location is set to the valuenone,mke2fs(8)will not create an undo file.
in addition, any tags that can be specified in a per-file system tags subsection as defined below (e.g., blocksize, hash_alg, inode_ratio, inode_size, reserved_ratio, etc.) can also be specified in the defaults stanza to specify the default value to be used if the user does not specify one on the command line, and the file system-type specific section of the configuration file does not specify a default value. ๐
๐ฆ THE [fs_types] STANZA ๐ฆ
each tag in the [fs_types] stanza names a file system type or usage type which can be specified via the -t or -T options to mke2fs(8), respectively.
the mke2fs(8) program constructs a list of fs_types by concatenating the file system type (i.e., ext2, ext3, etc.) with the usage type list. for most configuration options, mke2fs(8) will look for a subsection in the [fs_types] stanza corresponding with each entry in the constructed list, with later entries overriding earlier file system 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 file system type of ext4 will be used. if the file system 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 file system will have an inode size of 128. ๐ฅ
the exception to this resolution is the features tag, which specifies a set of changes to the features used by the file system, 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 file system feature set consisting of the sparse_super, filetype, dir_index, extents and flex_bg features. slay ๐
for each file system type, the following tags may be used in that fs_type's subsection. these tags may also be used in the default section:
base_featuresโ this relation specifies the features which are initially enabled for this file system type. only onebase_featureswill be used, so if there are multiple entries in the fs_types list whose subsections define thebase_featuresrelation, only the last will be used bymke2fs(8).enable_periodic_fsckโ this boolean relation specifies whether periodic file system 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-iand-ccommand-line options totune2fs(8).errorsโ change the behavior of the kernel code when errors are detected. in all cases, a file system error will causee2fsck(8)to check the file system on the next boot.errorscan be one of the following:continueโ continue normal execution.remount-roโ remount file system read-only.panicโ cause a kernel panic. ๐
featuresโ this relation specifies a comma-separated list of features edit requests which modify the feature set used by the newly constructed file system. the syntax is the same as the-Ocommand-line option tomke2fs(8); that is, a feature can be prefixed by a caret (^) symbol to disable a named feature. eachfeaturesrelation specified in the[fs_types]list will be applied in the order found in the[fs_types]list.force_undoโ this boolean relation, if set to a value of true, forcesmke2fsto always try to create an undo file, even if the undo file might be huge and it might extend the time to create the file system image because the inode table isn't being initialized lazily. ๐ญdefault_featuresโ this relation specifies set of features which should be enabled or disabled after applying the features listed in thebase_featuresandfeaturesrelations. it may be overridden by the-Ocommand-line option tomke2fs(8).auto_64-bit_supportโ this relation is a boolean which specifies whethermke2fs(8)should automatically add the64bitfeature if the number of blocks for the file system requires this feature to be enabled. theresize_inodefeature 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-ocommand-line option totune2fs(8).blocksizeโ this relation specifies the default block size if the user does not specify a block size on the command line.lazy_itable_initโ this boolean relation specifies whether the inode table should be lazily initialized. it only has meaning if theuninit_bgfeature is enabled. iflazy_itable_initis true and theuninit_bgfeature is enabled, the inode table will not be fully initialized bymke2fs(8). this speeds up file system initialization noticeably, but it requires the kernel to finish initializing the file system in the background when the file system is first mounted. โจ
bestie we're not done yet โ there's more coming, don't go anywhere ๐ซถ
lazy_journal_initโ a boolean, and it's exactly what it sounds like: should that journal inode be initialized lazily? ๐ฆ Heads up tho, it only does anything if thehas_journalfeature is turned on. Iflazy_journal_initis true,mke2fswill not fully zero out the journal inode. The way that speeds up file system initialization is noticeable โจ, but bestie, it carries some small risk if the system crashes before the journal has been overwritten entirely one time. Small risk, real risk. iykyk ๐journal_locationโ this relation specifies the location of the journal. ๐num_backup_sbโ tells you whether file systems with thesparse_super2feature enabled should be created with0,1, or2backup superblocks. Pick your number, queen ๐packed_meta_blocksโ a boolean: should the allocation bitmaps, inode table, and journal all be located at the beginning of the file system? ๐inode_ratioโ the default inode ratio, used when the user does not specify one on the command line. No cap, it's just the fallback vibe. ๐งinode_sizeโ the default inode size, again only when the user does not specify one on the command line. ๐ธreserved_ratioโ the default percentage of file system blocks reserved for the super-user, if the user does not specify one on the command line. ๐hash_algโ the default hash algorithm for new file systems with hashed b-tree directories. Valid algorithms accepted are:legacy,half_md4, andtea. That's the whole menu, bestie ๐flex_bg_sizeโ the number of block groups that will be packed together to create one large virtual block group on anext4file system. It improves meta-data locality and performance on meta-data heavy workloads ๐ฅ. Two rules tho: the number of groups must be a power of 2, and it may only be specified if theflex_bgfile system feature is enabled.optionsโ extra extended options thatmke2fs(8)should treat as if they were prepended to the argument of the-Eoption. Basically: set your default extended options per-file-system-type and let it cook. ๐discardโ a boolean. Shouldmke2fs(8)attempt to discard the device prior to file system creation? ๐๏ธset_raid_strideโ should the file system's RAID stride size be set from the block device, if available? Valid values are:always,disk,never. The default value isalways. โญset_raid_stripeโ same energy, different setting: should the file system's RAID stripe size be set from the block device if available? Valid values are:always,disk,never. The default value isdisk. ๐cluster_sizeโ the default cluster size when thebigallocfile system feature is enabled. It can be overridden via the-Ccommand line option tomke2fs(8). ๐make_hugefilesโ a boolean that enables the creation of pre-allocated files as part of formatting the file system. The extent tree blocks for these pre-allocated files get placed near the beginning of the file system, so that if all of the other metadata blocks are also configured to be placed near the beginning of the file system (by disabling the backup superblocks, using thepacked_meta_blocksoption, etc.), the data blocks of the pre-allocated files will be contiguous. It's giving organized. It's giving main character energy. ๐hugefiles_dirโ the directory where huge files are created, relative to the file system root. ๐hugefiles_uidโ controls the user ownership for all of the files and directories created by themake_hugefilesfeature. ๐hugefiles_gidโ controls the group ownership for all of the files and directories created by themake_hugefilesfeature. ๐ฏhugefiles_umaskโ the umask used when creating the files and directories by themake_hugefilesfeature. ๐ญnum_hugefilesโ how many huge files to create. If this relation is not specified, or is set to zero, and thehugefiles_sizerelation is non-zero, thenmake_hugefileswill create as many huge files as can fit to fill the entire file system. Go off, fill the whole thing ๐hugefiles_slackโ how much space should be reserved for other files. Gotta leave room for the rest of them ๐ซถhugefiles_sizeโ the size of the huge files. If this relation is not specified, the default is to fill the entire file system. ๐ธhugefiles_alignโ the alignment for the start block of the huge files. It also forces the size of huge files to be a multiple of the requested alignment. If this relation is not specified, no alignment requirement will be imposed on the huge files. ๐hugefiles_align_diskโ should the alignment be relative to the beginning of the hard drive (assuming that the starting offset of the partition is available tomke2fs(8))? The default value isfalse, which will cause hugefile alignment to be relative to the beginning of the file system. ๐ฝhugefiles_nameโ the base file name for the huge files. โจhugefiles_digitsโ the (zero-padded) width of the field for the huge file number. Sofile00001vibes, notfile1vibes ๐ขwarn_y2038_datesโ a boolean: willmke2fs(8)issue a warning when creating a file system with 128 byte inodes (and so therefore will not support dates after January 19th, 2038)? The default value istrue, except for file systems created for the GNU Hurd, since it only supports 128-byte inodes. โฐzero_hugefilesโ a boolean: should zero blocks be written to the hugefiles whilemke2fs(8)is creating them? By default, zero blocks will be written to the huge files to avoid stale data from being made available to potentially untrusted user programs โ unless the device supports a discard/trim operation which will take care of zeroing the device blocks. By settingzero_hugefilestofalse, this step will always be skipped, which can be useful if it is known that the disk has been previously erased, or if the user programs that will have access to the huge files are trusted to not reveal stale data. ๐
Bestie, read that one twice. Settingzero_hugefilestofalsemeans no zeroing, ever, and stale data could be visible to whatever can read those files. Only do it if you actually know the disk was erased or you fully trust the programs touching those files. ๐
encodingโ defines the file name encoding to be used if thecasefoldfeature is enabled. Currently the only valid encoding isutf8-12.1orutf8, which requests the most recent Unicode version; since 12.1 is the only available Unicode version,utf8andutf8-12.1have the same result. ๐encoding_flagsโ defines encoding-specific flags. Forutf8encodings, the only available flag isstrict, which will cause attempts to create file names containing invalid Unicode characters to be rejected by the kernel. Strict mode is not enabled by default. ๐ซ
๐ THE [devices] STANZA ๐
Each tag in the [devices] stanza names a device name, so that per-device defaults can be specified. Per-device defaults?? The customization is unmatched ๐
fs_typeโ the default parameter for the-toption, if this option isn't specified on the command line. ๐ธusage_typesโ the default parameter for the-Toption, if this option isn't specified on the command line. ๐ฆ
๐ FILES ๐
/etc/mke2fs.confโ the configuration file formke2fs(8). This is the file, the one we've been talking about this entire time ๐ซถ
๐ SEE ALSO ๐
And that's the whole page, bestie, we ate and left no crumbs ๐
โจ This was E2fsprogs version 1.47.4, dated March 2025, and yes, it's the mke2fs.conf(5) manual page โ go configure something iconic ๐๐๐ฆ
๐ฆ where this page comes from
- alpine 3.24: e2fsprogs-doc 1.47.4-r0 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND MIT
- arch rolling: e2fsprogs 1.47.4-1 ยท GPL AND LGPL AND MIT
- nixpkgs unstable: e2fsprogs 1.47.4
- ubuntu stonking: e2fsprogs 1.47.4-1 ยท GPL-2.0-only
- Copyright 2006 by Theodore Ts'o. All Rights Reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms