| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Copyright 2006 by Theodore Ts'o. All Rights Reserved. |
| 3 |
.\" This file may be copied under the terms of the GNU Public License. |
| 4 |
.\" |
| 5 |
.TH e2fsck.conf 5 "March 2025" "E2fsprogs version 1.47.4" |
| 6 |
.SH NAME |
| 7 |
e2fsck.conf \- Configuration file for e2fsck |
| 8 |
.SH DESCRIPTION |
| 9 |
.I e2fsck.conf |
| 10 |
is the configuration file for |
| 11 |
.BR e2fsck (8). |
| 12 |
It controls the default behavior of |
| 13 |
.BR e2fsck (8) |
| 14 |
while it is checking ext2, ext3, or ext4 file systems. |
| 15 |
.PP |
| 16 |
The |
| 17 |
.I e2fsck.conf |
| 18 |
file uses an INI-style format. Stanzas, or top-level sections, are |
| 19 |
delimited by square braces: [ ]. Within each section, each line |
| 20 |
defines a relation, which assigns tags to values, or to a subsection, |
| 21 |
which contains further relations or subsections. |
| 22 |
.\" Tags can be assigned multiple values |
| 23 |
An example of the INI-style format used by this configuration file |
| 24 |
follows below: |
| 25 |
.P |
| 26 |
[section1] |
| 27 |
.br |
| 28 |
tag1 = value_a |
| 29 |
.br |
| 30 |
tag1 = value_b |
| 31 |
.br |
| 32 |
tag2 = value_c |
| 33 |
.P |
| 34 |
[section 2] |
| 35 |
.br |
| 36 |
tag3 = { |
| 37 |
.br |
| 38 |
subtag1 = subtag_value_a |
| 39 |
.br |
| 40 |
subtag1 = subtag_value_b |
| 41 |
.br |
| 42 |
subtag2 = subtag_value_c |
| 43 |
.br |
| 44 |
} |
| 45 |
.br |
| 46 |
tag1 = value_d |
| 47 |
.br |
| 48 |
tag2 = value_e |
| 49 |
.br |
| 50 |
} |
| 51 |
.P |
| 52 |
Comments are delimited by a semicolon (';') or a hash ('#') character |
| 53 |
at the beginning of the comment, and are terminated by the end of |
| 54 |
line character. |
| 55 |
.P |
| 56 |
Tags and values must be quoted using double quotes if they contain |
| 57 |
spaces. Within a quoted string, the standard backslash interpretations |
| 58 |
apply: "\en" (for the newline character), |
| 59 |
"\et" (for the tab character), "\eb" (for the backspace character), |
| 60 |
and "\e\e" (for the backslash character). |
| 61 |
.P |
| 62 |
The following stanzas are used in the |
| 63 |
.I e2fsck.conf |
| 64 |
file. They will be described in more detail in future sections of this |
| 65 |
document. |
| 66 |
.TP |
| 67 |
.I [options] |
| 68 |
This stanza contains general configuration parameters for |
| 69 |
.BR e2fsck 's |
| 70 |
behavior. |
| 71 |
.TP |
| 72 |
.I [defaults] |
| 73 |
Contains relations which define the default parameters used by |
| 74 |
.BR e2fsck (8). |
| 75 |
In general, these defaults may be overridden by command-line options |
| 76 |
provided by the user. |
| 77 |
.TP |
| 78 |
.I [problems] |
| 79 |
This stanza allows the administrator to reconfigure how e2fsck handles |
| 80 |
various file system inconsistencies. |
| 81 |
.TP |
| 82 |
.I [scratch_files] |
| 83 |
This stanza controls when e2fsck will attempt to use |
| 84 |
scratch files to reduce the need for memory. |
| 85 |
.SH THE [options] STANZA |
| 86 |
The following relations are defined in the |
| 87 |
.I [options] |
| 88 |
stanza. |
| 89 |
.TP |
| 90 |
.I allow_cancellation |
| 91 |
If this relation is set to a boolean value of true, then if the user |
| 92 |
interrupts e2fsck using ^C, and the file system is not explicitly flagged |
| 93 |
as containing errors, e2fsck will exit with an exit status of 0 instead |
| 94 |
of 32. This setting defaults to false. |
| 95 |
.TP |
| 96 |
.I accept_time_fudge |
| 97 |
Unfortunately, due to Windows' unfortunate design decision |
| 98 |
to configure the hardware clock to tick localtime, instead |
| 99 |
of the more proper and less error-prone UTC time, many |
| 100 |
users end up in the situation where the system clock is |
| 101 |
incorrectly set at the time when e2fsck is run. |
| 102 |
.IP |
| 103 |
Historically this was usually due to some distributions |
| 104 |
having buggy init scripts and/or installers that didn't |
| 105 |
correctly detect this case and take appropriate |
| 106 |
countermeasures. Unfortunately, this is occasionally |
| 107 |
true even today, usually due to a |
| 108 |
buggy or misconfigured virtualization manager or the |
| 109 |
installer not having access to a network time server |
| 110 |
during the installation process. So by default, we allow |
| 111 |
the superblock times to be fudged by up to 24 hours. |
| 112 |
This can be disabled by setting |
| 113 |
.I accept_time_fudge |
| 114 |
to the |
| 115 |
boolean value of false. This setting defaults to true. |
| 116 |
.TP |
| 117 |
.I broken_system_clock |
| 118 |
The |
| 119 |
.BR e2fsck (8) |
| 120 |
program has some heuristics that assume that the system clock is |
| 121 |
correct. In addition, many system programs make similar assumptions. |
| 122 |
For example, the UUID library depends on time not going backwards in |
| 123 |
order for it to be able to make its guarantees about issuing universally |
| 124 |
unique ID's. Systems with broken system clocks, are well, broken. |
| 125 |
However, broken system clocks, particularly in embedded systems, do |
| 126 |
exist. E2fsck will attempt to use heuristics to determine if the time |
| 127 |
can not be trusted; and to skip time-based checks if this is true. If |
| 128 |
this boolean is set to true, then e2fsck will always assume that the |
| 129 |
system clock can not be trusted. |
| 130 |
.TP |
| 131 |
.I buggy_init_scripts |
| 132 |
This boolean relation is an alias for |
| 133 |
.I accept_time_fudge |
| 134 |
for backwards compatibility; it used to |
| 135 |
be that the behavior defined by |
| 136 |
.I accept_time_fudge |
| 137 |
above defaulted to false, and |
| 138 |
.I buggy_init_scripts |
| 139 |
would enable superblock time field to be wrong by up to 24 hours. When |
| 140 |
we changed the default, we also renamed this boolean relation to |
| 141 |
.IR accept_time_fudge. |
| 142 |
.TP |
| 143 |
.I clear_test_fs_flag |
| 144 |
This boolean relation controls whether or not |
| 145 |
.BR e2fsck (8) |
| 146 |
will offer to clear |
| 147 |
the test_fs flag if the ext4 file system is available on the system. It |
| 148 |
defaults to true. |
| 149 |
.TP |
| 150 |
.I defer_check_on_battery |
| 151 |
This boolean relation controls whether or not the interval between |
| 152 |
file system checks (either based on time or number of mounts) should |
| 153 |
be doubled if the system is running on battery. This setting defaults to |
| 154 |
true. |
| 155 |
.TP |
| 156 |
.I indexed_dir_slack_percentage |
| 157 |
When |
| 158 |
.BR e2fsck (8) |
| 159 |
repacks a indexed directory, reserve the specified percentage of |
| 160 |
empty space in each leaf nodes so that a few new entries can |
| 161 |
be added to the directory without splitting leaf nodes, so that |
| 162 |
the average fill ratio of directories can be maintained at a |
| 163 |
higher, more efficient level. This relation defaults to 20 |
| 164 |
percent. |
| 165 |
.TP |
| 166 |
.I inode_count_fullmap |
| 167 |
If this boolean relation is true, trade off using memory for speed when |
| 168 |
checking a file system with a large number of hard-linked files. The |
| 169 |
amount of memory required is proportional to the number of inodes in the |
| 170 |
file system. For large file systems, this can be gigabytes of memory. |
| 171 |
(For example a 40TB file system with 2.8 billion inodes will consume an |
| 172 |
additional 5.7 GB memory if this optimization is enabled.) This setting |
| 173 |
defaults to false. |
| 174 |
.TP |
| 175 |
.I log_dir |
| 176 |
If the |
| 177 |
.I log_filename |
| 178 |
or |
| 179 |
.I problem_log_filename |
| 180 |
relations contains a relative pathname, then the log file will be placed |
| 181 |
in the directory named by the |
| 182 |
.I log_dir |
| 183 |
relation. |
| 184 |
.TP |
| 185 |
.I log_dir_fallback |
| 186 |
This relation contains an alternate directory that will be used if the |
| 187 |
directory specified by |
| 188 |
.I log_dir |
| 189 |
is not available or is not writable. |
| 190 |
.TP |
| 191 |
.I log_dir_wait |
| 192 |
If this boolean relation is true, them if the directories specified by |
| 193 |
.I log_dir |
| 194 |
or |
| 195 |
.I log_dir_fallback |
| 196 |
are not available or are not yet writable, e2fsck will save the output |
| 197 |
in a memory buffer, and a child process will periodically test to see if |
| 198 |
the log directory has become available after the boot sequence has |
| 199 |
mounted the requested file system for reading/writing. This implements the |
| 200 |
functionality provided by |
| 201 |
.BR logsave (8) |
| 202 |
for e2fsck log files. |
| 203 |
.TP |
| 204 |
.I log_filename |
| 205 |
This relation specifies the file name where a copy of e2fsck's output |
| 206 |
will be written. If certain problem reports are suppressed using the |
| 207 |
.I max_count_problems |
| 208 |
relation, (or on a per-problem basis using the |
| 209 |
.I max_count |
| 210 |
relation), the full set of problem reports will be written to the log |
| 211 |
file. The filename may contain various percent-expressions (%D, %T, %N, |
| 212 |
etc.) which will be expanded so that the file name for the log file can |
| 213 |
include things like date, time, device name, and other run-time |
| 214 |
parameters. See the |
| 215 |
.B LOGGING |
| 216 |
section for more details. |
| 217 |
.TP |
| 218 |
.I max_count_problems |
| 219 |
This relation specifies the maximum number of problem reports of a |
| 220 |
particular type will be printed to stdout before further problem reports |
| 221 |
of that type are squelched. This can be useful if the console is slow |
| 222 |
(i.e., connected to a serial port) and so a large amount of output could |
| 223 |
end up delaying the boot process for a long time (potentially hours). |
| 224 |
.TP |
| 225 |
.I no_optimize_extents |
| 226 |
If this boolean relation is true, do not offer to optimize the extent |
| 227 |
tree by reducing the tree's width or depth. This setting defaults to false. |
| 228 |
.TP |
| 229 |
.I problem_log_filename |
| 230 |
This relation specifies the file name where a log of problem codes |
| 231 |
found by e2fsck be written. The filename may contain various |
| 232 |
percent-expressions (%D, %T, %N, |
| 233 |
etc.) which will be expanded so that the file name for the log file can |
| 234 |
include things like date, time, device name, and other run-time |
| 235 |
parameters. See the |
| 236 |
.B LOGGING |
| 237 |
section for more details. |
| 238 |
.TP |
| 239 |
.I readahead_mem_pct |
| 240 |
Use this percentage of memory to try to read in metadata blocks ahead of the |
| 241 |
main e2fsck thread. This should reduce run times, depending on the speed of |
| 242 |
the underlying storage and the amount of free memory. There is no default, but |
| 243 |
see |
| 244 |
.B readahead_kb |
| 245 |
for more details. |
| 246 |
.TP |
| 247 |
.I readahead_kb |
| 248 |
Use this amount of memory to read in metadata blocks ahead of the main checking |
| 249 |
thread. Setting this value to zero disables readahead entirely. By default, |
| 250 |
this is set the size of two block groups' inode tables (typically 4MiB on a |
| 251 |
regular ext4 file system); if this amount is more than 1/50th of total physical |
| 252 |
memory, readahead is disabled. |
| 253 |
.TP |
| 254 |
.I report_features |
| 255 |
If this boolean relation is true, e2fsck will print the file system |
| 256 |
features as part of its verbose reporting (i.e., if the |
| 257 |
.B -v |
| 258 |
option is specified) |
| 259 |
.TP |
| 260 |
.I report_time |
| 261 |
If this boolean relation is true, e2fsck will run as if the options |
| 262 |
.B -tt |
| 263 |
are always specified. This will cause e2fsck to print timing statistics |
| 264 |
on a pass by pass basis for full file system checks. |
| 265 |
.TP |
| 266 |
.I report_verbose |
| 267 |
If this boolean relation is true, e2fsck will run as if the option |
| 268 |
.B -v |
| 269 |
is always specified. This will cause e2fsck to print some additional |
| 270 |
information at the end of each full file system check. |
| 271 |
.SH THE [defaults] STANZA |
| 272 |
The following relations are defined in the |
| 273 |
.I [defaults] |
| 274 |
stanza. |
| 275 |
.TP |
| 276 |
.I undo_dir |
| 277 |
This relation specifies the directory where the undo file should be |
| 278 |
stored. It can be overridden via the |
| 279 |
.B E2FSPROGS_UNDO_DIR |
| 280 |
environment variable. If the directory location is set to the value |
| 281 |
.IR none , |
| 282 |
.B e2fsck |
| 283 |
will not create an undo file. |
| 284 |
.SH THE [problems] STANZA |
| 285 |
Each tag in the |
| 286 |
.I [problems] |
| 287 |
stanza names a problem code specified with a leading "0x" followed by |
| 288 |
six hex digits. |
| 289 |
The value of the tag is a subsection where the relations in that |
| 290 |
subsection override the default treatment of that particular problem |
| 291 |
code. |
| 292 |
.P |
| 293 |
Note that inappropriate settings in this stanza may cause |
| 294 |
.B e2fsck |
| 295 |
to behave incorrectly, or even crash. Most system administrators should |
| 296 |
not be making changes to this section without referring to source code. |
| 297 |
.P |
| 298 |
Within each problem code's subsection, the following tags may be used: |
| 299 |
.TP |
| 300 |
.I description |
| 301 |
This relation allows the message which is printed when this file system |
| 302 |
inconsistency is detected to be overridden. |
| 303 |
.TP |
| 304 |
.I preen_ok |
| 305 |
This boolean relation overrides the default behavior controlling |
| 306 |
whether this file system problem should be automatically fixed when |
| 307 |
.B e2fsck |
| 308 |
is running in preen mode. |
| 309 |
.TP |
| 310 |
.I max_count |
| 311 |
This integer relation overrides the |
| 312 |
.I max_count_problems |
| 313 |
parameter (set in the options section) for this particular problem. |
| 314 |
.TP |
| 315 |
.I no_ok |
| 316 |
This boolean relation overrides the default behavior determining |
| 317 |
whether or not the file system will be marked as inconsistent if the user |
| 318 |
declines to fix the reported problem. |
| 319 |
.TP |
| 320 |
.I no_default |
| 321 |
This boolean relation overrides whether the default answer for this |
| 322 |
problem (or question) should be "no". |
| 323 |
.TP |
| 324 |
.I preen_nomessage |
| 325 |
This boolean relation overrides the default behavior controlling |
| 326 |
whether or not the description for this file system problem should |
| 327 |
be suppressed when |
| 328 |
.B e2fsck |
| 329 |
is running in preen mode. |
| 330 |
.TP |
| 331 |
.I no_nomsg |
| 332 |
This boolean relation overrides the default behavior controlling |
| 333 |
whether or not the description for this file system problem should |
| 334 |
be suppressed when a problem forced not to be fixed, either because |
| 335 |
.B e2fsck |
| 336 |
is run with the |
| 337 |
.B -n |
| 338 |
option or because the |
| 339 |
.I force_no |
| 340 |
flag has been set for the problem. |
| 341 |
.TP |
| 342 |
.I force_no |
| 343 |
This boolean option, if set to true, forces a problem to never be fixed. |
| 344 |
That is, it will be as if the user problem responds 'no' to the question |
| 345 |
of 'should this problem be fixed?'. The |
| 346 |
.I force_no |
| 347 |
option even overrides the |
| 348 |
.B -y |
| 349 |
option given on the command-line (just for the specific problem, of course). |
| 350 |
.TP |
| 351 |
.I not_a_fix |
| 352 |
This boolean option, it set to true, marks the problem as |
| 353 |
one where if the user gives permission to make the requested change, |
| 354 |
it does not mean that the file system had a problem which has since |
| 355 |
been fixed. This is used for requests to optimize the file system's |
| 356 |
data structure, such as pruning an extent tree. |
| 357 |
.SH THE [scratch_files] STANZA |
| 358 |
The following relations are defined in the |
| 359 |
.I [scratch_files] |
| 360 |
stanza. |
| 361 |
.TP |
| 362 |
.I directory |
| 363 |
If the directory named by this relation exists and is |
| 364 |
writeable, then e2fsck will attempt to use this |
| 365 |
directory to store scratch files instead of using |
| 366 |
in-memory data structures. |
| 367 |
.TP |
| 368 |
.I numdirs_threshold |
| 369 |
If this relation is set, then in-memory data structures |
| 370 |
will be used if the number of directories in the file system |
| 371 |
are fewer than amount specified. |
| 372 |
.TP |
| 373 |
.I dirinfo |
| 374 |
This relation controls whether or not the scratch file |
| 375 |
directory is used instead of an in-memory data |
| 376 |
structure for directory information. It defaults to |
| 377 |
true. |
| 378 |
.TP |
| 379 |
.I icount |
| 380 |
This relation controls whether or not the scratch file |
| 381 |
directory is used instead of an in-memory data |
| 382 |
structure when tracking inode counts. It defaults to |
| 383 |
true. |
| 384 |
.SH LOGGING |
| 385 |
E2fsck has the facility to save the information from an e2fsck run in a |
| 386 |
directory so that a system administrator can review its output at their |
| 387 |
leisure. This allows information captured during the automatic e2fsck |
| 388 |
preen run, as well as a manually started e2fsck run, to be saved for |
| 389 |
posterity. This facility is controlled by the |
| 390 |
.IR log_filename , |
| 391 |
.IR log_dir , |
| 392 |
.IR log_dir_fallback , |
| 393 |
and |
| 394 |
.I log_dir_wait |
| 395 |
relations in the |
| 396 |
.I [options] |
| 397 |
stanza. |
| 398 |
.PP |
| 399 |
The filename in |
| 400 |
.I log_filename |
| 401 |
may contain the following percent-expressions that will be expanded as |
| 402 |
follows. |
| 403 |
.TP |
| 404 |
.B %d |
| 405 |
The current day of the month |
| 406 |
.TP |
| 407 |
.B %D |
| 408 |
The current date; this is a equivalent of |
| 409 |
.B %Y%m%d |
| 410 |
.TP |
| 411 |
.B %h |
| 412 |
The hostname of the system. |
| 413 |
.TP |
| 414 |
.B %H |
| 415 |
The current hour in 24-hour format (00..23) |
| 416 |
.TP |
| 417 |
.B %m |
| 418 |
The current month as a two-digit number (01..12) |
| 419 |
.TP |
| 420 |
.B %M |
| 421 |
The current minute (00..59) |
| 422 |
.TP |
| 423 |
.B %N |
| 424 |
The name of the block device containing the file system, with any |
| 425 |
directory pathname stripped off. |
| 426 |
.TP |
| 427 |
.B %p |
| 428 |
The pid of the e2fsck process |
| 429 |
.TP |
| 430 |
.B %s |
| 431 |
The current time expressed as the number of seconds since 1970-01-01 |
| 432 |
00:00:00 UTC |
| 433 |
.TP |
| 434 |
.B %S |
| 435 |
The current second (00..59) |
| 436 |
.TP |
| 437 |
.B %T |
| 438 |
The current time; this is equivalent of |
| 439 |
.B %H%M%S |
| 440 |
.TP |
| 441 |
.B %u |
| 442 |
The name of the user running e2fsck. |
| 443 |
.TP |
| 444 |
.B %U |
| 445 |
This percent expression does not expand to anything, but it signals that |
| 446 |
any following date or time expressions should be expressed in UTC time |
| 447 |
instead of the local timezone. |
| 448 |
.TP |
| 449 |
.B %y |
| 450 |
The last two digits of the current year (00..99) |
| 451 |
.TP |
| 452 |
.B %Y |
| 453 |
The current year (i.e., 2012). |
| 454 |
.SH EXAMPLES |
| 455 |
The following recipe will prevent e2fsck from aborting during the boot |
| 456 |
process when a file system contains orphaned files. (Of course, this is |
| 457 |
not always a good idea, since critical files that are needed for the |
| 458 |
security of the system could potentially end up in lost+found, and |
| 459 |
starting the system without first having a system administrator check |
| 460 |
things out may be dangerous.) |
| 461 |
.P |
| 462 |
.br |
| 463 |
[problems] |
| 464 |
.br |
| 465 |
0x040002 = { |
| 466 |
.br |
| 467 |
preen_ok = true |
| 468 |
.br |
| 469 |
description = "@u @i %i. " |
| 470 |
.br |
| 471 |
} |
| 472 |
.P |
| 473 |
The following recipe will cause an e2fsck logfile to be written to the |
| 474 |
directory /var/log/e2fsck, with a filename that contains the device |
| 475 |
name, the hostname of the system, the date, and time: e.g., |
| 476 |
"e2fsck-sda3.server.INFO.20120314-112142". If the directory containing |
| 477 |
/var/log is located on the root file system |
| 478 |
which is initially mounted read-only, then the output will be saved in |
| 479 |
memory and written out once the root file system has been remounted |
| 480 |
read/write. To avoid too much detail from being written to the serial |
| 481 |
console (which could potentially slow down the boot sequence), only print |
| 482 |
no more than 16 instances of each type of file system corruption. |
| 483 |
.P |
| 484 |
.br |
| 485 |
[options] |
| 486 |
.br |
| 487 |
max_count_problems = 16 |
| 488 |
.br |
| 489 |
log_dir = /var/log/e2fsck |
| 490 |
.br |
| 491 |
log_filename = e2fsck-%N.%h.INFO.%D-%T |
| 492 |
.br |
| 493 |
log_dir_wait = true |
| 494 |
.P |
| 495 |
.SH FILES |
| 496 |
.TP |
| 497 |
.I /etc/e2fsck.conf |
| 498 |
The configuration file for |
| 499 |
.BR e2fsck (8). |
| 500 |
.SH SEE ALSO |
| 501 |
.BR e2fsck (8) |