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