1e2fsck.conf(5)                File Formats Manual               e2fsck.conf(5)
2
3
4

NAME

6       e2fsck.conf - Configuration file for e2fsck
7

DESCRIPTION

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       file systems.
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 be‐
18       low:
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 file system 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

THE [options] STANZA

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 file system is not ex‐
71              plicitly flagged as containing errors, e2fsck will exit with  an
72              exit status of 0 instead of 32.  This setting defaults to false.
73
74       accept_time_fudge
75              Unfortunately,  due  to  Windows' unfortunate design decision to
76              configure the hardware clock to tick localtime, instead  of  the
77              more  proper and less error-prone UTC time, many users end up in
78              the situation where the system clock is incorrectly set  at  the
79              time when e2fsck is run.
80
81              Historically  this  was usually due to some distributions having
82              buggy init scripts and/or installers that didn't  correctly  de‐
83              tect  this  case and take appropriate countermeasures.  Unfortu‐
84              nately, this is occasionally true even today, usually due  to  a
85              buggy  or  misconfigured virtualization manager or the installer
86              not having access to a network time server during the  installa‐
87              tion  process.   So by default, we allow the superblock times to
88              be fudged by up to 24 hours.  This can be  disabled  by  setting
89              accept_time_fudge  to  the boolean value of false.  This setting
90              defaults to true.
91
92       broken_system_clock
93              The e2fsck(8) program has some heuristics that assume  that  the
94              system clock is correct.  In addition, many system programs make
95              similar assumptions.  For example, the UUID library  depends  on
96              time  not going backwards in order for it to be able to make its
97              guarantees about issuing universally unique ID's.  Systems  with
98              broken  system clocks, are well, broken.  However, broken system
99              clocks, particularly in embedded systems, do exist.  E2fsck will
100              attempt  to  use  heuristics to determine if the time can not be
101              trusted; and to skip time-based checks if this is true.  If this
102              boolean  is set to true, then e2fsck will always assume that the
103              system clock can not be trusted.
104
105       buggy_init_scripts
106              This boolean relation is  an  alias  for  accept_time_fudge  for
107              backwards compatibility; it used to be that the behavior defined
108              by   accept_time_fudge   above   defaulted   to    false,    and
109              buggy_init_scripts  would  enable  superblock  time  field to be
110              wrong by up to 24 hours.  When we changed the default,  we  also
111              renamed this boolean relation to accept_time_fudge.
112
113       clear_test_fs_flag
114              This boolean relation controls whether or not e2fsck(8) will of‐
115              fer to clear the test_fs flag if the ext4 file system is  avail‐
116              able on the system.  It defaults to true.
117
118       defer_check_on_battery
119              This  boolean  relation controls whether or not the interval be‐
120              tween file system checks (either based  on  time  or  number  of
121              mounts)  should  be doubled if the system is running on battery.
122              This setting defaults to true.
123
124       indexed_dir_slack_percentage
125              When e2fsck(8) repacks a indexed directory, reserve  the  speci‐
126              fied  percentage of empty space in each leaf nodes so that a few
127              new entries can be added to the directory without splitting leaf
128              nodes,  so  that  the  average  fill ratio of directories can be
129              maintained at a higher, more efficient level.  This relation de‐
130              faults to 20 percent.
131
132       inode_count_fullmap
133              If  this  boolean  relation  is true, trade off using memory for
134              speed when checking a file system with a large number  of  hard-
135              linked  files.  The amount of memory required is proportional to
136              the number of inodes in the file system.  For  large  file  sys‐
137              tems, this can be gigabytes of memory.  (For example a 40TB file
138              system with 2.8 billion inodes will consume an additional 5.7 GB
139              memory  if this optimization is enabled.)  This setting defaults
140              to false.
141
142       log_dir
143              If the log_filename or problem_log_filename relations contains a
144              relative  pathname,  then the log file will be placed in the di‐
145              rectory named by the log_dir relation.
146
147       log_dir_fallback
148              This relation contains an alternate directory that will be  used
149              if the directory specified by log_dir is not available or is not
150              writable.
151
152       log_dir_wait
153              If this boolean relation is true, them if the directories speci‐
154              fied by log_dir or log_dir_fallback are not available or are not
155              yet writable, e2fsck will save the output in  a  memory  buffer,
156              and a child process will periodically test to see if the log di‐
157              rectory has become available after the boot sequence has mounted
158              the  requested file system for reading/writing.  This implements
159              the functionality provided by logsave(8) for e2fsck log files.
160
161       log_filename
162              This relation specifies the file name where a copy  of  e2fsck's
163              output  will  be  written.   If certain problem reports are sup‐
164              pressed using the max_count_problems relation,  (or  on  a  per-
165              problem  basis  using  the  max_count relation), the full set of
166              problem reports will be written to the log file.   The  filename
167              may contain various percent-expressions (%D, %T, %N, etc.) which
168              will be expanded so that the file name for the log file can  in‐
169              clude  things  like  date, time, device name, and other run-time
170              parameters.  See the LOGGING section for more details.
171
172       max_count_problems
173              This relation specifies the maximum number of problem reports of
174              a particular type will be printed to stdout before further prob‐
175              lem reports of that type are squelched.  This can be  useful  if
176              the  console is slow (i.e., connected to a serial port) and so a
177              large amount of output could end up delaying  the  boot  process
178              for a long time (potentially hours).
179
180       no_optimize_extents
181              If  this  boolean relation is true, do not offer to optimize the
182              extent tree by reducing the tree's width or depth.  This setting
183              defaults to false.
184
185       problem_log_filename
186              This  relation  specifies  the  file name where a log of problem
187              codes found by e2fsck be written.  The filename may contain var‐
188              ious  percent-expressions  (%D,  %T, %N, etc.) which will be ex‐
189              panded so that the file name for the log file can include things
190              like  date,  time,  device  name, and other run-time parameters.
191              See the LOGGING section for more details.
192
193       readahead_mem_pct
194              Use this percentage of memory to try to read in metadata  blocks
195              ahead  of the main e2fsck thread.  This should reduce run times,
196              depending on the speed of the underlying storage and the  amount
197              of  free  memory.  There is no default, but see readahead_kb for
198              more details.
199
200       readahead_kb
201              Use this amount of memory to read in metadata  blocks  ahead  of
202              the  main  checking thread.  Setting this value to zero disables
203              readahead entirely.  By default, this is set  the  size  of  two
204              block  groups'  inode  tables  (typically 4MiB on a regular ext4
205              file system); if this amount is more than 1/50th of total physi‐
206              cal memory, readahead is disabled.
207
208       report_features
209              If  this  boolean  relation  is true, e2fsck will print the file
210              system features as part of its verbose reporting (i.e.,  if  the
211              -v option is specified)
212
213       report_time
214              If  this boolean relation is true, e2fsck will run as if the op‐
215              tions -tt are always specified.  This will cause e2fsck to print
216              timing  statistics  on a pass by pass basis for full file system
217              checks.
218
219       report_verbose
220              If this boolean relation is true, e2fsck will run as if the  op‐
221              tion  -v  is  always specified.  This will cause e2fsck to print
222              some additional information at the end of each full file  system
223              check.
224

THE [defaults] STANZA

226       The following relations are defined in the [defaults] stanza.
227
228       undo_dir
229              This relation specifies the directory where the undo file should
230              be stored.  It can be overridden via the E2FSPROGS_UNDO_DIR  en‐
231              vironment  variable.   If  the  directory location is set to the
232              value none, e2fsck will not create an undo file.
233

THE [problems] STANZA

235       Each tag in the [problems] stanza names a problem code specified with a
236       leading  "0x"  followed  by  six hex digits.  The value of the tag is a
237       subsection where the relations in that subsection override the  default
238       treatment of that particular problem code.
239
240       Note that inappropriate settings in this stanza may cause e2fsck to be‐
241       have incorrectly, or even crash.  Most system administrators should not
242       be making changes to this section without referring to source code.
243
244       Within each problem code's subsection, the following tags may be used:
245
246       description
247              This relation allows the message which is printed when this file
248              system inconsistency is detected to be overridden.
249
250       preen_ok
251              This boolean relation overrides the default behavior controlling
252              whether  this  file system problem should be automatically fixed
253              when e2fsck is running in preen mode.
254
255       max_count
256              This integer relation overrides the max_count_problems parameter
257              (set in the options section) for this particular problem.
258
259       no_ok  This boolean relation overrides the default behavior determining
260              whether or not the file system will be marked as inconsistent if
261              the user declines to fix the reported problem.
262
263       no_default
264              This  boolean  relation overrides whether the default answer for
265              this problem (or question) should be "no".
266
267       preen_nomessage
268              This boolean relation overrides the default behavior controlling
269              whether  or  not  the  description  for this file system problem
270              should be suppressed when e2fsck is running in preen mode.
271
272       no_nomsg
273              This boolean relation overrides the default behavior controlling
274              whether  or  not  the  description  for this file system problem
275              should be suppressed when a problem forced not to be fixed,  ei‐
276              ther  because  e2fsck  is  run with the -n option or because the
277              force_no flag has been set for the problem.
278
279       force_no
280              This boolean option, if set to true, forces a problem  to  never
281              be  fixed.   That is, it will be as if the user problem responds
282              'no' to the question of 'should this problem  be  fixed?'.   The
283              force_no  option  even overrides the -y option given on the com‐
284              mand-line (just for the specific problem, of course).
285
286       not_a_fix
287              This boolean option, it set to true, marks the  problem  as  one
288              where if the user gives permission to make the requested change,
289              it does not mean that the file system had a  problem  which  has
290              since  been  fixed.   This  is used for requests to optimize the
291              file system's data structure, such as pruning an extent tree.
292

THE [scratch_files] STANZA

294       The following relations are defined in the [scratch_files] stanza.
295
296       directory
297              If the directory named by this relation exists and is writeable,
298              then  e2fsck will attempt to use this directory to store scratch
299              files instead of using in-memory data structures.
300
301       numdirs_threshold
302              If this relation is set, then in-memory data structures will  be
303              used  if  the number of directories in the file system are fewer
304              than amount specified.
305
306       dirinfo
307              This relation controls whether or not the scratch file directory
308              is used instead of an in-memory data structure for directory in‐
309              formation.  It defaults to true.
310
311       icount This relation controls whether or not the scratch file directory
312              is used instead of an in-memory data structure when tracking in‐
313              ode counts.  It defaults to true.
314

LOGGING

316       E2fsck has the facility to save the information from an e2fsck run in a
317       directory so that a system administrator can review its output at their
318       leisure.  This allows information captured during the automatic  e2fsck
319       preen  run,  as  well as a manually started e2fsck run, to be saved for
320       posterity.  This facility is controlled by the  log_filename,  log_dir,
321       log_dir_fallback, and log_dir_wait relations in the [options] stanza.
322
323       The  filename in log_filename may contain the following percent-expres‐
324       sions that will be expanded as follows.
325
326       %d     The current day of the month
327
328       %D     The current date; this is a equivalent of %Y%m%d
329
330       %h     The hostname of the system.
331
332       %H     The current hour in 24-hour format (00..23)
333
334       %m     The current month as a two-digit number (01..12)
335
336       %M     The current minute (00..59)
337
338       %N     The name of the block device containing the  file  system,  with
339              any directory pathname stripped off.
340
341       %p     The pid of the e2fsck process
342
343       %s     The  current  time  expressed  as  the  number  of seconds since
344              1970-01-01 00:00:00 UTC
345
346       %S     The current second (00..59)
347
348       %T     The current time; this is equivalent of %H%M%S
349
350       %u     The name of the user running e2fsck.
351
352       %U     This percent expression does not expand to anything, but it sig‐
353              nals  that  any following date or time expressions should be ex‐
354              pressed in UTC time instead of the local timezone.
355
356       %y     The last two digits of the current year (00..99)
357
358       %Y     The current year (i.e., 2012).
359

EXAMPLES

361       The following recipe will prevent e2fsck from aborting during the  boot
362       process  when  a file system contains orphaned files.  (Of course, this
363       is not always a good idea, since critical files that are needed for the
364       security  of  the  system  could  potentially end up in lost+found, and
365       starting the system without first having a system  administrator  check
366       things out may be dangerous.)
367
368            [problems]
369                 0x040002 = {
370                      preen_ok = true
371                      description = "@u @i %i.  "
372                 }
373
374       The  following recipe will cause an e2fsck logfile to be written to the
375       directory /var/log/e2fsck, with a filename  that  contains  the  device
376       name,  the  hostname  of the system, the date, and time: e.g., "e2fsck-
377       sda3.server.INFO.20120314-112142".    If   the   directory   containing
378       /var/log  is located on the root file system which is initially mounted
379       read-only, then the output will be saved in memory and written out once
380       the root file system has been remounted read/write.   To avoid too much
381       detail from being written to the serial  console  (which  could  poten‐
382       tially  slow  down  the  boot sequence), only print no more than 16 in‐
383       stances of each type of file system corruption.
384
385            [options]
386                 max_count_problems = 16
387                 log_dir = /var/log/e2fsck
388                 log_filename = e2fsck-%N.%h.INFO.%D-%T
389                 log_dir_wait = true
390

FILES

392       /etc/e2fsck.conf
393              The configuration file for e2fsck(8).
394

SEE ALSO

396       e2fsck(8)
397
398
399
400E2fsprogs version 1.46.5         December 2021                  e2fsck.conf(5)
Impressum