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