Whamcloud - gitweb
e2fsck: release clusters only once in release_inode_blocks
[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 defer_check_on_battery
151 This boolean relation controls whether or not the interval between
152 filesystem checks (either based on time or number of mounts) should
153 be doubled if the system is running on battery.  This setting defaults to
154 true.
155 .TP
156 .I indexed_dir_slack_percentage
157 When
158 .BR e2fsck (8)
159 repacks a indexed directory, reserve the specified percentage of
160 empty space in each leaf nodes so that a few new entries can
161 be added to the directory without splitting leaf nodes, so that
162 the average fill ratio of directories can be maintained at a
163 higher, more efficient level.  This relation defaults to 20
164 percent.
165 .TP
166 .I inode_count_fullmap
167 If this boolean relation is true, trade off using memory for speed when
168 checking a file system with a large number of hard-linked files.  The
169 amount of memory required is proportional to the number of inodes in the
170 file 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
172 additional 5.7 GB memory if this optimization is enabled.)  This setting
173 defaults to false.
174 .TP
175 .I log_dir
176 If the
177 .I log_filename
178 relation contains a relative pathname, then the log file will be placed
179 in the directory named by the
180 .I log_dir
181 relation.
182 .TP
183 .I log_dir_fallback
184 This relation contains an alternate directory that will be used if the
185 directory specified by
186 .I log_dir
187 is not available or is not writable.
188 .TP
189 .I log_dir_wait
190 If this boolean relation is true, them if the directories specified by
191 .I log_dir
192 or
193 .I log_dir_fallback
194 are not available or are not yet writable, e2fsck will save the output
195 in a memory buffer, and a child process will periodically test to see if
196 the log directory has become available after the boot sequence has
197 mounted the requested file system for reading/writing.  This implements the
198 functionality provided by
199 .BR logsave (8)
200 for e2fsck log files.
201 .TP
202 .I log_filename
203 This relation specifies the file name where a copy of e2fsck's output
204 will be written.   If certain problem reports are suppressed using the
205 .I max_count_problems
206 relation, (or on a per-problem basis using the
207 .I max_count
208 relation), the full set of problem reports will be written to the log
209 file.  The filename may contain various percent-expressions (%D, %T, %N,
210 etc.) which will be expanded so that the file name for the log file can
211 include things like date, time, device name, and other run-time
212 parameters.  See the
213 .B LOGGING
214 section for more details.
215 .TP
216 .I max_count_problems
217 This relation specifies the maximum number of problem reports of a
218 particular type will be printed to stdout before further problem reports
219 of 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
221 end up delaying the boot process for a long time (potentially hours).
222 .TP
223 .I no_optimize_extents
224 If this boolean relation is true, do not offer to optimize the extent
225 tree by reducing the tree's width or depth.  This setting defaults to false.
226 .TP
227 .I readahead_mem_pct
228 Use this percentage of memory to try to read in metadata blocks ahead of the
229 main e2fsck thread.  This should reduce run times, depending on the speed of
230 the underlying storage and the amount of free memory.  There is no default, but
231 see
232 .B readahead_kb
233 for more details.
234 .TP
235 .I readahead_kb
236 Use this amount of memory to read in metadata blocks ahead of the main checking
237 thread.  Setting this value to zero disables readahead entirely.  By default,
238 this is set the size of two block groups' inode tables (typically 4MiB on a
239 regular ext4 filesystem); if this amount is more than 1/50th of total physical
240 memory, readahead is disabled.
241 .TP
242 .I report_features
243 If this boolean relation is true, e2fsck will print the file system
244 features as part of its verbose reporting (i.e., if the
245 .B -v
246 option is specified)
247 .TP
248 .I report_time
249 If this boolean relation is true, e2fsck will run as if the options
250 .B -tt
251 are always specified.  This will cause e2fsck to print timing statistics
252 on a pass by pass basis for full file system checks.
253 .TP
254 .I report_verbose
255 If this boolean relation is true, e2fsck will run as if the option
256 .B -v
257 is always specified.  This will cause e2fsck to print some additional
258 information at the end of each full file system check.
259 .SH THE [defaults] STANZA
260 The following relations are defined in the
261 .I [defaults]
262 stanza.
263 .TP
264 .I undo_dir
265 This relation specifies the directory where the undo file should be
266 stored.  It can be overridden via the
267 .B E2FSPROGS_UNDO_DIR
268 environment variable.  If the directory location is set to the value
269 .IR none ,
270 .B e2fsck
271 will not create an undo file.
272 .SH THE [problems] STANZA
273 Each tag in the
274 .I [problems]
275 stanza names a problem code specified with a leading "0x" followed by
276 six hex digits.
277 The value of the tag is a subsection where the relations in that
278 subsection override the default treatment of that particular problem
279 code.
280 .P
281 Note that inappropriate settings in this stanza may cause
282 .B e2fsck
283 to behave incorrectly, or even crash.  Most system administrators should
284 not be making changes to this section without referring to source code.
285 .P
286 Within each problem code's subsection, the following tags may be used:
287 .TP
288 .I description
289 This relation allows the message which is printed when this filesystem
290 inconsistency is detected to be overridden.
291 .TP
292 .I preen_ok
293 This boolean relation overrides the default behavior controlling
294 whether this filesystem problem should be automatically fixed when
295 .B e2fsck
296 is running in preen mode.
297 .TP
298 .I max_count
299 This integer relation overrides the
300 .I max_count_problems
301 parameter (set in the options section) for this particular problem.
302 .TP
303 .I no_ok
304 This boolean relation overrides the default behavior determining
305 whether or not the filesystem will be marked as inconsistent if the user
306 declines to fix the reported problem.
307 .TP
308 .I no_default
309 This boolean relation overrides whether the default answer for this
310 problem (or question) should be "no".
311 .TP
312 .I preen_nomessage
313 This boolean relation overrides the default behavior controlling
314 whether or not the description for this filesystem problem should
315 be suppressed when
316 .B e2fsck
317 is running in preen mode.
318 .TP
319 .I no_nomsg
320 This boolean relation overrides the default behavior controlling
321 whether or not the description for this filesystem problem should
322 be suppressed when a problem forced not to be fixed, either because
323 .B e2fsck
324 is run with the
325 .B -n
326 option or because the
327 .I force_no
328 flag has been set for the problem.
329 .TP
330 .I force_no
331 This boolean option, if set to true, forces a problem to never be fixed.
332 That is, it will be as if the user problem responds 'no' to the question
333 of 'should this problem be fixed?'.  The
334 .I force_no
335 option even overrides the
336 .B -y
337 option given on the command-line (just for the specific problem, of course).
338 .TP
339 .I not_a_fix
340 This boolean option, it set to true, marks the problem as
341 one where if the user gives permission to make the requested change,
342 it does not mean that the file system had a problem which has since
343 been fixed.  This is used for requests to optimize the file system's
344 data structure, such as pruning an extent tree.
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
358 @TDB_MAN_COMMENT@will be used if the number of directories in the filesystem
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.
372 .SH LOGGING
373 E2fsck has the facility to save the information from an e2fsck run in a
374 directory so that a system administrator can review its output at their
375 leisure.  This allows information captured during the automatic e2fsck
376 preen run, as well as a manually started e2fsck run, to be saved for
377 posterity.  This facility is controlled by the
378 .IR log_filename ,
379 .IR log_dir ,
380 .IR log_dir_fallback ,
381 and
382 .I log_dir_wait
383 relations in the
384 .I [options]
385 stanza.
386 .PP
387 The filename in
388 .I log_filename
389 may contain the following percent-expressions that will be expanded as
390 follows.
391 .TP
392 .B %d
393 The current day of the month
394 .TP
395 .B %D
396 The current date; this is a equivalent of
397 .B %Y%m%d
398 .TP
399 .B %h
400 The hostname of the system.
401 .TP
402 .B %H
403 The current hour in 24-hour format (00..23)
404 .TP
405 .B %m
406 The current month as a two-digit number (01..12)
407 .TP
408 .B %M
409 The current minute (00..59)
410 .TP
411 .B %N
412 The name of the block device containing the file system, with any
413 directory pathname stripped off.
414 .TP
415 .B %p
416 The pid of the e2fsck process
417 .TP
418 .B %s
419 The current time expressed as the number of seconds since 1970-01-01
420 00:00:00 UTC
421 .TP
422 .B %S
423 The current second (00..59)
424 .TP
425 .B %T
426 The current time; this is equivalent of
427 .B %H%M%S
428 .TP
429 .B %u
430 The name of the user running e2fsck.
431 .TP
432 .B %U
433 This percent expression does not expand to anything, but it signals that
434 any following date or time expressions should be expressed in UTC time
435 instead of the local timezone.
436 .TP
437 .B %y
438 The last two digits of the current year (00..99)
439 .TP
440 .B %Y
441 The current year (i.e., 2012).
442 .SH EXAMPLES
443 The following recipe will prevent e2fsck from aborting during the boot
444 process when a filesystem contains orphaned files.  (Of course, this is
445 not always a good idea, since critical files that are needed for the
446 security of the system could potentially end up in lost+found, and
447 starting the system without first having a system administrator check
448 things 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                 }
460 .P
461 The following recipe will cause an e2fsck logfile to be written to the
462 directory /var/log/e2fsck, with a filename that contains the device
463 name, 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
466 which is initially mounted read-only, then the output will be saved in
467 memory and written out once the root file system has been remounted
468 read/write.   To avoid too much detail from being written to the serial
469 console (which could potentially slow down the boot sequence), only print
470 no 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
483 .SH FILES
484 .TP
485 .I /etc/e2fsck.conf
486 The configuration file for
487 .BR e2fsck (8).
488 .SH SEE ALSO
489 .BR e2fsck (8)