e2fsck.conf(5)
๐ NAME ๐
e2fsck.conf โ bestie, it's the configuration file for e2fsck. That's the whole name. Short. Iconic. ๐
โจ DESCRIPTION โจ
okay so e2fsck.conf is THE config file for e2fsck(8), no cap. It controls the default behavior of e2fsck(8) while it's out here checking ext2, ext3, or ext4 file systems. ๐ฆ
The e2fsck.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. Here's a little example of the INI-style format this config file uses, so you can see the vibe ๐
[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. so basically a ; or # and you're free to yap ๐
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). periodt.
The following stanzas are used in the e2fsck.conf file. They will be described in more detail in future sections of this document. ๐
[options]โ This stanza contains general configuration parameters fore2fsck's behavior.[defaults]โ Contains relations which define the default parameters used bye2fsck(8). In general, these defaults may be overridden by command-line options provided by the user.[problems]โ This stanza allows the administrator to reconfigure howe2fsckhandles various file system inconsistencies.[scratch_files]โ This stanza controls whene2fsckwill attempt to use scratch files to reduce the need for memory.
๐ THE [options] STANZA ๐
The following relations are defined in the [options] stanza. buckle up bestie, there's a lot of them and they're all lowkey important ๐
allow_cancellationโ If this relation is set to a boolean value of true, then if the user interruptse2fsckusing^C, and the file system is not explicitly flagged as containing errors,e2fsckwill exit with an exit status of0instead of32. This setting defaults to false. ๐accept_time_fudgeโ unfortunately ๐ญ, due to Windows' unfortunate design decision to configure the hardware clock to tick localtime, instead of the more proper and less error-prone UTC time, many users end up in the situation where the system clock is incorrectly set at the time whene2fsckis run.
Historically this was usually due to some distributions having buggy init scripts and/or installers that didn't correctly detect this case and take appropriate countermeasures. Unfortunately, this is occasionally true even today, usually due to a buggy or misconfigured virtualization manager or the installer not having access to a network time server during the installation process. So by default, we allow the superblock times to be fudged by up to 24 hours. This can be disabled by setting accept_time_fudge to the boolean value of false. This setting defaults to true.
broken_system_clockโ Thee2fsck(8)program has some heuristics that assume that the system clock is correct. In addition, many system programs make similar assumptions. For example, the UUID library depends on time not going backwards in order for it to be able to make its guarantees about issuing universally unique ID's. Systems with broken system clocks are, well, broken. However, broken system clocks, particularly in embedded systems, do exist. E2fsck will attempt to use heuristics to determine if the time can not be trusted; and to skip time-based checks if this is true. If this boolean is set to true, thene2fsckwill always assume that the system clock can not be trusted. ๐ฐ๏ธโจbuggy_init_scriptsโ This boolean relation is an alias foraccept_time_fudgefor backwards compatibility; it used to be that the behavior defined byaccept_time_fudgeabove defaulted tofalse, andbuggy_init_scriptswould enable superblock time field to be wrong by up to 24 hours. When we changed the default, we also renamed this boolean relation toaccept_time_fudge.clear_test_fs_flagโ This boolean relation controls whether or note2fsck(8)will offer to clear thetest_fsflag if the ext4 file system is available on the system. It defaults to true.defer_check_on_batteryโ This boolean relation controls whether or not the interval between file system checks (either based on time or number of mounts) should be doubled if the system is running on battery. This setting defaults to true. ๐indexed_dir_slack_percentageโ Whene2fsck(8)repacks a indexed directory, reserve the specified percentage of empty space in each leaf nodes so that a few new entries can be added to the directory without splitting leaf nodes, so that the average fill ratio of directories can be maintained at a higher, more efficient level. This relation defaults to 20 percent.inode_count_fullmapโ If this boolean relation is true, trade off using memory for speed when checking a file system with a large number of hard-linked files. The amount of memory required is proportional to the number of inodes in the file system. For large file systems, this can be gigabytes of memory. (For example a 40TB file system with 2.8 billion inodes will consume an additional 5.7 GB memory if this optimization is enabled.) This setting defaults to false. ๐ง ๐ฅlog_dirโ If thelog_filenameorproblem_log_filenamerelations contains a relative pathname, then the log file will be placed in the directory named by thelog_dirrelation.log_dir_fallbackโ This relation contains an alternate directory that will be used if the directory specified bylog_diris not available or is not writable.log_dir_waitโ If this boolean relation is true, them if the directories specified bylog_dirorlog_dir_fallbackare not available or are not yet writable,e2fsckwill save the output in a memory buffer, and a child process will periodically test to see if the log directory has become available after the boot sequence has mounted the requested file system for reading/writing. This implements the functionality provided bylogsave(8)fore2fscklog files. ๐ซถlog_filenameโ This relation specifies the file name where a copy ofe2fsck's output will be written. If certain problem reports are suppressed using themax_count_problemsrelation, (or on a per-problem basis using themax_countrelation), the full set of problem reports will be written to the log file. The filename may contain various percent-expressions (%D,%T,%N, etc.) which will be expanded so that the file name for the log file can include things like date, time, device name, and other run-time parameters. See the LOGGING section for more details.max_count_problemsโ This relation specifies the maximum number of problem reports of a particular type will be printed to stdout before further problem reports of that type are squelched. This can be useful if the console is slow (i.e., connected to a serial port) and so a large amount of output could end up delaying the boot process for a long time (potentially hours). ๐ญno_optimize_extentsโ If this boolean relation is true, do not offer to optimize the extent tree by reducing the tree's width or depth. This setting defaults to false.problem_log_filenameโ This relation specifies the file name where a log of problem codes found bye2fsckbe written. The filename may contain various percent-expressions (%D,%T,%N, etc.) which will be expanded so that the file name for the log file can include things like date, time, device name, and other run-time parameters. See the LOGGING section for more details.readahead_mem_pctโ Use this percentage of memory to try to read in metadata blocks ahead of the maine2fsckthread. This should reduce run times, depending on the speed of the underlying storage and the amount of free memory. There is no default, but seereadahead_kbfor more details.readahead_kbโ Use this amount of memory to read in metadata blocks ahead of the main checking thread. Setting this value to zero disables readahead entirely. By default, this is set the size of two block groups' inode tables (typically 4MiB on a regular ext4 file system); if this amount is more than 1/50th of total physical memory, readahead is disabled. ๐โ๏ธ๐จreport_featuresโ If this boolean relation is true,e2fsckwill print the file system features as part of its verbose reporting (i.e., if the-voption is specified)report_timeโ If this boolean relation is true,e2fsckwill run as if the options-ttare always specified. This will causee2fsckto print timing statistics on a pass by pass basis for full file system checks. โฑ๏ธreport_verboseโ If this boolean relation is true,e2fsckwill run as if the option-vis always specified. This will causee2fsckto print some additional information at the end of each full file system check.
๐ THE [defaults] STANZA ๐
The following relations are defined in the [defaults] stanza.
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,e2fsckwill not create an undo file. ๐
more parts incoming, bestie โ don't go anywhere ๐
โจ THE [problems] STANZA โจ
Okay bestie, this one is the danger zone ๐จ so pay attention.
Every tag in the [problems] stanza is the name of a problem code, written with a leading 0x and then six hex digits. The value you give that tag is a subsection, and inside that subsection the relations you set override the default treatment of that particular problem code. It's giving "custom rules for this one specific problem" energy ๐
๐ซ Heads up, fr fr: putting inappropriate settings in this stanza can make e2fsck behave incorrectly, or even crash. Most system administrators should not be touching this section without referring to the source code first. Like, that's not a vibe, that's a warning. ๐ญ
Inside each problem code's subsection, you've got these tags to play with:
descriptionโ lets you override the message that gets printed when this file system inconsistency is detected. You're basically rewriting the drama. ๐ฌpreen_okโ a boolean that overrides the default behavior controlling whether this file system problem should be automatically fixed when e2fsck is running in preen mode. โmax_countโ an integer that overrides themax_count_problemsparameter (the one set in the options section) for this particular problem. Like a personal cap just for this one. ๐ขno_okโ a boolean that overrides the default behavior determining whether or not the file system will be marked as inconsistent if the user declines to fix the reported problem. ๐ โ๏ธno_defaultโ a boolean that overrides whether the default answer for this problem (or question) should be"no". ๐ซpreen_nomessageโ a boolean that overrides the default behavior controlling whether or not the description for this file system problem should be suppressed when e2fsck is running in preen mode. ๐คซno_nomsgโ a boolean that overrides the default behavior controlling whether or not the description for this file system problem should be suppressed when a problem is forced not to be fixed โ either because e2fsck is run with the-noption, or because theforce_noflag has been set for the problem. ๐คforce_noโ this boolean option, if set totrue, forces a problem to never be fixed. That is, it will be as if the user responds'no'to the question of'should this problem be fixed?'. And theforce_nooption even overrides the-yoption given on the command-line (just for the specific problem, of course). Iconic levels of stubborn. ๐not_a_fixโ this boolean option, if set totrue, marks the problem as one where if the user gives permission to make the requested change, it does not mean that the file system had a problem which has since been fixed. This is used for requests to optimize the file system's data structure, such as pruning an extent tree. ๐ณ
๐ธ THE [scratch_files] STANZA ๐ธ
These are the relations that live in the [scratch_files] stanza, bestie:
directoryโ if the directory named by this relation exists and is writeable, then e2fsck will attempt to use this directory to store scratch files instead of using in-memory data structures. ๐numdirs_thresholdโ if this relation is set, then in-memory data structures will be used if the number of directories in the file system are fewer than the amount specified. ๐dirinfoโ this relation controls whether or not the scratch file directory is used instead of an in-memory data structure for directory information. It defaults totrue. ๐๏ธicountโ this relation controls whether or not the scratch file directory is used instead of an in-memory data structure when tracking inode counts. It defaults totrue. ๐ข
๐ LOGGING ๐
E2fsck has the facility to save the information from an e2fsck run in a directory so that a system administrator can review its output at their leisure. The way this works is that info captured during the automatic e2fsck preen run โ and a manually started e2fsck run โ can be saved for posterity. ๐ซถ This facility is controlled by the log_filename, log_dir, log_dir_fallback, and log_dir_wait relations in the [options] stanza.
The filename in log_filename may contain the following percent-expressions, which get expanded like this:
%dโ the current day of the month%Dโ the current date; this is a equivalent of%Y%m%d%hโ the hostname of the system.%Hโ the current hour in 24-hour format (00..23)%mโ the current month as a two-digit number (01..12)%Mโ the current minute (00..59)%Nโ the name of the block device containing the file system, with any directory pathname stripped off.%pโ the pid of the e2fsck process%sโ the current time expressed as the number of seconds since1970-01-01 00:00:00 UTC%Sโ the current second (00..59)%Tโ the current time; this is equivalent of%H%M%S%uโ the name of the user running e2fsck.%Uโ this percent expression does not expand to anything, but it signals that any following date or time expressions should be expressed in UTC time instead of the local timezone. Timezone plot twist. ๐%yโ the last two digits of the current year (00..99)%Yโ the current year (i.e.,2012).
๐งช EXAMPLES ๐งช
Okay so here's a recipe that will prevent e2fsck from aborting during the boot process when a file system contains orphaned files. (Of course, this is not always a good idea, since critical files that are needed for the security of the system could potentially end up in lost+found, and starting the system without first having a system administrator check things out may be dangerous.) โ ๏ธ
[problems]
0x040002 = {
preen_ok = true
description = "@u @i %i. "
}
And this next recipe will cause an e2fsck logfile to be written to the directory /var/log/e2fsck, with a filename that contains the device name, the hostname of the system, the date, and time: e.g., "e2fsck-sda3.server.INFO.20120314-112142". ๐ If the directory containing /var/log is located on the root file system which is initially mounted read-only, then the output will be saved in memory and written out once the root file system has been remounted read/write. ๐ To avoid too much detail from being written to the serial console (which could potentially slow down the boot sequence), only print no more than 16 instances of each type of file system corruption.
[options]
max_count_problems = 16
log_dir = /var/log/e2fsck
log_filename = e2fsck-%N.%h.INFO.%D-%T
log_dir_wait = true
๐ FILES ๐
/etc/e2fsck.confโ the configuration file fore2fsck(8). ๐
๐ SEE ALSO ๐
And that's the whole page, bestie!! ๐ This was E2fsprogs version 1.47.4, dated March 2025, and you just read e2fsck.conf(5) all the way to the end. Not everyone can say that. Go configure something responsibly. ๐
โจ๐ฆ
๐ฆ 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