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