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