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