blob: 085a95170f451e27e96ab8d92b8f9fbbd1d7753b [file] [log] [blame]
Theodore Ts'o1abdba42006-03-27 01:03:11 -05001.\" -*- 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).
Theodore Ts'o2d1fa592006-10-02 08:38:44 -040012It controls the default behavior of
Theodore Ts'o1abdba42006-03-27 01:03:11 -050013.BR e2fsck (8)
Theodore Ts'o6a81b402010-11-26 18:07:32 -050014while it is checking ext2, ext3, or ext4 filesystems.
Theodore Ts'o1abdba42006-03-27 01:03:11 -050015.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.
Theodore Ts'o39efa4c2007-04-06 23:32:06 -040071.TP
Theodore Ts'o1abdba42006-03-27 01:03:11 -050072.I [problems]
73This stanza allows the administrator to reconfigure how e2fsck handles
74various filesystem inconsistencies.
Theodore Ts'o39efa4c2007-04-06 23:32:06 -040075.TP
76.I [scratch_files]
77This stanza controls when e2fsck will attempt to use scratch files to
78reduce the need for memory.
Theodore Ts'o1abdba42006-03-27 01:03:11 -050079.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.
Theodore Ts'o60702c22007-09-22 20:42:04 -040089.TP
Theodore Ts'oba5131f2009-10-16 20:46:45 -040090.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
100countermeasures. However, it's still possible, despite the
101best efforts of init script and installer authors to not be
102able to detect this misconfiguration, usually due to a
103buggy or misconfigured virtualization manager or the
104installer not having access to a network time server
105during the installation process. So by default, we allow
106the superblock times to be fudged by up to 24 hours.
107This can be disabled by setting
108.I accept_time_fudge
109to the
110boolean value of false. This setting defaults to true.
Theodore Ts'o7dca4c82008-12-23 19:10:43 -0500111.TP
Theodore Ts'oc7067432010-01-04 13:59:04 -0500112.I broken_system_clock
113The
114.BR e2fsck (8)
JP Abgralle0ed7402014-03-19 19:08:39 -0700115program has some heuristics that assume that the system clock is
Theodore Ts'oc7067432010-01-04 13:59:04 -0500116correct. In addition, many system programs make similar assumptions.
117For example, the UUID library depends on time not going backwards in
118order for it to be able to make its guarantees about issuing universally
119unique ID's. Systems with broken system clocks, are well, broken.
120However, broken system clocks, particularly in embedded systems, do
JP Abgralle0ed7402014-03-19 19:08:39 -0700121exist. E2fsck will attempt to use heuristics to determine if the time
122can not be trusted; and to skip time-based checks if this is true. If
Theodore Ts'o177839e2010-05-13 17:36:36 -0400123this boolean is set to true, then e2fsck will always assume that the
124system clock can not be trusted.
Theodore Ts'oc7067432010-01-04 13:59:04 -0500125.TP
JP Abgralle0ed7402014-03-19 19:08:39 -0700126.I buggy_init_scripts
127This boolean relation is an alias for
128.I accept_time_fudge
129for backwards compatibility; it used to
130be that the behavior defined by
131.I accept_time_fudge
132above defaulted to false, and
133.I buggy_init_scripts
134would enable superblock time field to be wrong by up to 24 hours. When
135we changed the default, we also renamed this boolean relation to
136.IR accept_time_fudge.
137.TP
Theodore Ts'o7dca4c82008-12-23 19:10:43 -0500138.I clear_test_fs_flag
139This boolean relation controls whether or not
140.BR e2fsck (8)
141will offer to clear
142the test_fs flag if the ext4 filesystem is available on the system. It
143defaults to true.
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500144.TP
145.I defer_check_on_battery
146This boolean relation controls whether or not the interval between
147filesystem checks (either based on time or number of mounts) should
Theodore Ts'oba5131f2009-10-16 20:46:45 -0400148be doubled if the system is running on battery. This setting defaults to
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500149true.
Theodore Ts'o80875db2008-10-12 23:09:26 -0400150.TP
Theodore Ts'oc0a84962012-07-29 17:44:11 -0400151.I indexed_dir_slack_percentage
152When
153.BR e2fsck (8)
154repacks a indexed directory, reserve the specified percentage of
155empty space in each leaf nodes so that a few new entries can
156be added to the directory without splitting leaf nodes, so that
157the average fill ratio of directories can be maintained at a
158higher, more efficient level. This relation defaults to 20
159percent.
JP Abgralle0ed7402014-03-19 19:08:39 -0700160.TP
161.I log_dir
162If the
163.I log_filename
164relation contains a relative pathname, then the log file will be placed
165in the directory named by the
166.I log_dir
167relation.
168.TP
169.I log_dir_fallback
170This relation contains an alternate directory that will be used if the
171directory specified by
172.I log_dir
173is not available or is not writeable.
174.TP
175.I log_dir_wait
176If this boolean relation is true, them if the directories specified by
177.I log_dir
178or
179.I log_dir_fallback
180are not available or are not yet writeable, e2fsck will save the output
181in a memory buffer, and a child process will periodically test to see if
182the log directory has become available after the boot sequence has
183mounted the requiste filesytem for reading/writing. This implements the
184functionality provided by
185.BR logsave (8)
186for e2fsck log files.
187.TP
188.I log_filename
189This relation specifies the file name where a copy of e2fsck's output
190will be written. If certain problem reports are suppressed using the
191.I max_count_problems
192relation, (or on a per-problem basis using the
193.I max_count
194relation), the full set of problem reports will be written to the log
195file. The filename may contain various percent-expressions (%D, %T, %N,
196etc.) which will be expanded so that the file name for the log file can
197include things like date, time, device name, and other run-time
198parameters. See the
199.B LOGGING
200section for more details.
201.TP
202.I max_count_problems
203This relation specifies the maximum number of problem reports of a
204particular type will be printed to stdout before further problem reports
205of that type are squelched. This can be useful if the console is slow
206(i.e., connected to a serial port) and so a large amount of output could
207end up delaying the boot process for a long time (potentially hours).
208.TP
209.I report_features
210If this boolean relation is true, e2fsck will print the file system
211features as part of its verbose reporting (i.e., if the
212.B -v
213option is specified)
214.TP
215.I report_time
216If this boolean relation is true, e2fsck will run as if the options
217.B -tt
218are always specified. This will cause e2fsck to print timing statistics
219on a pass by pass basis for full file system checks.
220.TP
221.I report_verbose
222If this boolean relation is true, e2fsck will run as if the option
223.B -v
224is always specified. This will cause e2fsck to print some additional
225information at the end of each full file system check.
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500226.SH THE [problems] STANZA
227Each tag in the
228.I [problems]
229stanza names a problem code specified with a leading "0x" followed by
230six hex digits.
231The value of the tag is a subsection where the relations in that
232subsection override the default treatment of that particular problem
233code.
234.P
235Note that inappropriate settings in this stanza may cause
236.B e2fsck
237to behave incorrectly, or even crash. Most system administrators should
238not be making changes to this section without referring to source code.
239.P
240Within each problem code's subsection, the following tags may be used:
241.TP
242.I description
243This relation allows the message which is printed when this filesystem
244inconsistency is detected to be overridden.
245.TP
246.I preen_ok
247This boolean relation overrides the default behavior controlling
248whether this filesystem problem should be automatically fixed when
249.B e2fsck
250is running in preen mode.
251.TP
JP Abgralle0ed7402014-03-19 19:08:39 -0700252.I max_count
253This integer relation overrides the
254.I max_count_problems
255parameter (set in the options section) for this particular problem.
256.TP
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500257.I no_ok
258This boolean relation overrides the default behavior determining
259whether or not the filesystem will be marked as inconsistent if the user
260declines to fix the reported problem.
261.TP
262.I no_default
263This boolean relation overrides whether the default answer for this
264problem (or question) should be "no".
265.TP
266.I preen_nomessage
267This boolean relation overrides the default behavior controlling
268whether or not the description for this filesystem problem should
269be suppressed when
270.B e2fsck
271is running in preen mode.
272.TP
273.I no_nomsg
274This boolean relation overrides the default behavior controlling
275whether or not the description for this filesystem problem should
Theodore Ts'o75990382010-12-06 10:10:33 -0500276be suppressed when a problem forced not to be fixed, either because
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500277.B e2fsck
278is run with the
279.B -n
Theodore Ts'o75990382010-12-06 10:10:33 -0500280option or because the
281.I force_no
282flag has been set for the problem.
283.TP
284.I force_no
285This boolean option, if set to true, forces a problem to never be fixed.
286That is, it will be as if the user problem responds 'no' to the question
287of 'should this problem be fixed?'. The
288.I force_no
289option even overrides the
290.B -y
291option given on the command-line (just for the specific problem, of course).
Theodore Ts'o39efa4c2007-04-06 23:32:06 -0400292.SH THE [scratch_files] STANZA
293The following relations are defined in the
294.I [scratch_files]
295stanza.
296.TP
297.I directory
298If the directory named by this relation exists and is writeable, then
299e2fsck will attempt to use this directory to store scratch files instead
300of using in-memory data structures.
301.TP
302.I numdirs_threshold
303If this relation is set, then in-memory data structures be used if the
Theodore Ts'oa4d7d902007-04-18 22:12:50 -0400304number of directories in the filesystem are fewer than amount specified.
Theodore Ts'o39efa4c2007-04-06 23:32:06 -0400305.TP
306.I dirinfo
307This relation controls whether or not the scratch file directory is used
308instead of an in-memory data structure for directory information. It
309defaults to true.
310.TP
311.I icount
312This relation controls whether or not the scratch file directory is used
313instead of an in-memory data structure when tracking inode counts. It
314defaults to true.
JP Abgralle0ed7402014-03-19 19:08:39 -0700315.SH LOGGING
316E2fsck has the facility to save the information from an e2fsck run in a
317directory so that a system administrator can review its output at their
318leisure. This allows information captured during the automatic e2fsck
319preen run, as well as a manually started e2fsck run, to be saved for
320posterity. This facility is controlled by the
321.IR log_filename ,
322.IR log_dir ,
323.IR log_dir_fallback ,
324and
325.I log_dir_wait
326relations in the
327.I [options]
328stanza.
329.PP
330The filename in
331.I log_filename
332may contain the following percent-expressions that will be expanded as
333follows.
334.TP
335.B %d
336The current day of the month
337.TP
338.B %D
339The current date; this is a equivalent of
340.B %Y%m%d
341.TP
342.B %h
343The hostname of the system.
344.TP
345.B %H
346The current hour in 24-hour format (00..23)
347.TP
348.B %m
349The current month as a two-digit number (01..12)
350.TP
351.B %M
352The current minute (00..59)
353.TP
354.B %N
355The name of the block device containing the file system, with any
356directory pathname stripped off.
357.TP
358.B %p
359The pid of the e2fsck process
360.TP
361.B %s
362The current time expressed as the number of seconds since 1970-01-01
36300:00:00 UTC
364.TP
365.B %S
366The current second (00..59)
367.TP
368.B %T
369The current time; this is equivalent of
370.B %H%M%S
371.TP
372.B %u
373The name of the user running e2fsck.
374.TP
375.B %U
376This percent expression does not expand to anything, but it signals that
377any following date or time expressions should be expressed in UTC time
378instead of the local timzeone.
379.TP
380.B %y
381The last two digits of the current year (00..99)
382.TP
383.B %Y
384The current year (i.e., 2012).
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500385.SH EXAMPLES
386The following recipe will prevent e2fsck from aborting during the boot
387process when a filesystem contains orphaned files. (Of course, this is
388not always a good idea, since critical files that are needed for the
389security of the system could potentially end up in lost+found, and
390starting the system without first having a system administrator check
391things out may be dangerous.)
392.P
393.br
394 [problems]
395.br
396 0x040002 = {
397.br
398 preen_ok = true
399.br
400 description = "@u @i %i. "
401.br
402 }
JP Abgralle0ed7402014-03-19 19:08:39 -0700403.P
404The following recipe will cause an e2fsck logfile to be written to the
405directory /var/log/e2fsck, with a filename that contains the device
406name, the hostname of the system, the date, and time: e.g.,
407"e2fsck-sda3.server.INFO.20120314-112142". If the directory containing
408/var/log is located on the root file system
409which is initially mounted read-only, then the output will be saved in
410memory and written out once the root file system has been remounted
411read/write. To avoid too much detail from being written to the serial
412console (which could potentially slow down the boot sequence), only print
413no more than 16 instances of each type of file system corruption.
414.P
415.br
416 [options]
417.br
418 max_count_problems = 16
419.br
420 log_dir = /var/log/e2fsck
421.br
422 log_filename = e2fsck-%N.%h.INFO.%D-%T
423.br
424 log_dir_wait = true
425.P
Theodore Ts'o1abdba42006-03-27 01:03:11 -0500426.SH FILES
427.TP
428.I /etc/e2fsck.conf
429The configuration file for
430.BR e2fsck (8).
431.SH SEE ALSO
432.BR e2fsck (8)