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 relation contains a relative pathname, then
145 the log file will be placed in the directory named by the
146 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 readahead_mem_pct
188 Use this percentage of memory to try to read in metadata blocks
189 ahead of the main e2fsck thread. This should reduce run times,
190 depending on the speed of the underlying storage and the amount
191 of free memory. There is no default, but see readahead_kb for
192 more details.
193
194 readahead_kb
195 Use this amount of memory to read in metadata blocks ahead of
196 the main checking thread. Setting this value to zero disables
197 readahead entirely. By default, this is set the size of two
198 block groups' inode tables (typically 4MiB on a regular ext4
199 filesystem); if this amount is more than 1/50th of total physi‐
200 cal memory, readahead is disabled.
201
202 report_features
203 If this boolean relation is true, e2fsck will print the file
204 system features as part of its verbose reporting (i.e., if the
205 -v option is specified)
206
207 report_time
208 If this boolean relation is true, e2fsck will run as if the
209 options -tt are always specified. This will cause e2fsck to
210 print timing statistics on a pass by pass basis for full file
211 system checks.
212
213 report_verbose
214 If this boolean relation is true, e2fsck will run as if the
215 option -v is always specified. This will cause e2fsck to print
216 some additional information at the end of each full file system
217 check.
218
220 The following relations are defined in the [defaults] stanza.
221
222 undo_dir
223 This relation specifies the directory where the undo file should
224 be stored. It can be overridden via the E2FSPROGS_UNDO_DIR
225 environment variable. If the directory location is set to the
226 value none, e2fsck will not create an undo file.
227
229 Each tag in the [problems] stanza names a problem code specified with a
230 leading "0x" followed by six hex digits. The value of the tag is a
231 subsection where the relations in that subsection override the default
232 treatment of that particular problem code.
233
234 Note that inappropriate settings in this stanza may cause e2fsck to
235 behave incorrectly, or even crash. Most system administrators should
236 not be making changes to this section without referring to source code.
237
238 Within each problem code's subsection, the following tags may be used:
239
240 description
241 This relation allows the message which is printed when this
242 filesystem inconsistency is detected to be overridden.
243
244 preen_ok
245 This boolean relation overrides the default behavior controlling
246 whether this filesystem problem should be automatically fixed
247 when e2fsck is running in preen mode.
248
249 max_count
250 This integer relation overrides the max_count_problems parameter
251 (set in the options section) for this particular problem.
252
253 no_ok This boolean relation overrides the default behavior determining
254 whether or not the filesystem will be marked as inconsistent if
255 the user declines to fix the reported problem.
256
257 no_default
258 This boolean relation overrides whether the default answer for
259 this problem (or question) should be "no".
260
261 preen_nomessage
262 This boolean relation overrides the default behavior controlling
263 whether or not the description for this filesystem problem
264 should be suppressed when e2fsck is running in preen mode.
265
266 no_nomsg
267 This boolean relation overrides the default behavior controlling
268 whether or not the description for this filesystem problem
269 should be suppressed when a problem forced not to be fixed,
270 either because e2fsck is run with the -n option or because the
271 force_no flag has been set for the problem.
272
273 force_no
274 This boolean option, if set to true, forces a problem to never
275 be fixed. That is, it will be as if the user problem responds
276 'no' to the question of 'should this problem be fixed?'. The
277 force_no option even overrides the -y option given on the com‐
278 mand-line (just for the specific problem, of course).
279
280 not_a_fix
281 This boolean option, it set to true, marks the problem as one
282 where if the user gives permission to make the requested change,
283 it does not mean that the file system had a problem which has
284 since been fixed. This is used for requests to optimize the
285 file system's data structure, such as pruning an extent tree.
286
288 The following relations are defined in the [scratch_files] stanza.
289
290 directory
291 If the directory named by this relation exists and is writeable,
292 then e2fsck will attempt to use this directory to store scratch
293 files instead of using in-memory data structures.
294
295 numdirs_threshold
296 If this relation is set, then in-memory data structures will be
297 used if the number of directories in the filesystem are fewer
298 than amount specified.
299
300 dirinfo
301 This relation controls whether or not the scratch file directory
302 is used instead of an in-memory data structure for directory
303 information. It defaults to true.
304
305 icount This relation controls whether or not the scratch file directory
306 is used instead of an in-memory data structure when tracking
307 inode counts. It defaults to true.
308
310 E2fsck has the facility to save the information from an e2fsck run in a
311 directory so that a system administrator can review its output at their
312 leisure. This allows information captured during the automatic e2fsck
313 preen run, as well as a manually started e2fsck run, to be saved for
314 posterity. This facility is controlled by the log_filename, log_dir,
315 log_dir_fallback, and log_dir_wait relations in the [options] stanza.
316
317 The filename in log_filename may contain the following percent-expres‐
318 sions that will be expanded as follows.
319
320 %d The current day of the month
321
322 %D The current date; this is a equivalent of %Y%m%d
323
324 %h The hostname of the system.
325
326 %H The current hour in 24-hour format (00..23)
327
328 %m The current month as a two-digit number (01..12)
329
330 %M The current minute (00..59)
331
332 %N The name of the block device containing the file system, with
333 any directory pathname stripped off.
334
335 %p The pid of the e2fsck process
336
337 %s The current time expressed as the number of seconds since
338 1970-01-01 00:00:00 UTC
339
340 %S The current second (00..59)
341
342 %T The current time; this is equivalent of %H%M%S
343
344 %u The name of the user running e2fsck.
345
346 %U This percent expression does not expand to anything, but it sig‐
347 nals that any following date or time expressions should be
348 expressed in UTC time instead of the local timezone.
349
350 %y The last two digits of the current year (00..99)
351
352 %Y The current year (i.e., 2012).
353
355 The following recipe will prevent e2fsck from aborting during the boot
356 process when a filesystem contains orphaned files. (Of course, this is
357 not always a good idea, since critical files that are needed for the
358 security of the system could potentially end up in lost+found, and
359 starting the system without first having a system administrator check
360 things out may be dangerous.)
361
362 [problems]
363 0x040002 = {
364 preen_ok = true
365 description = "@u @i %i. "
366 }
367
368 The following recipe will cause an e2fsck logfile to be written to the
369 directory /var/log/e2fsck, with a filename that contains the device
370 name, the hostname of the system, the date, and time: e.g., "e2fsck-
371 sda3.server.INFO.20120314-112142". If the directory containing
372 /var/log is located on the root file system which is initially mounted
373 read-only, then the output will be saved in memory and written out once
374 the root file system has been remounted read/write. To avoid too much
375 detail from being written to the serial console (which could poten‐
376 tially slow down the boot sequence), only print no more than 16
377 instances of each type of file system corruption.
378
379 [options]
380 max_count_problems = 16
381 log_dir = /var/log/e2fsck
382 log_filename = e2fsck-%N.%h.INFO.%D-%T
383 log_dir_wait = true
384
386 /etc/e2fsck.conf
387 The configuration file for e2fsck(8).
388
390 e2fsck(8)
391
392
393
394E2fsprogs version 1.44.6 March 2019 e2fsck.conf(5)