Whamcloud - gitweb
e2fsprogs: man page typo fixes
[tools/e2fsprogs.git] / misc / mke2fs.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 mke2fs.conf 5 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 mke2fs.conf \- Configuration file for mke2fs
8 .SH DESCRIPTION
9 .I mke2fs.conf
10 is the configuration file for 
11 .BR mke2fs (8).  
12 It controls the default parameters used by 
13 .BR mke2fs (8)
14 when it is creating ext2 or ext3 filesystems.
15 .PP
16 The
17 .I mke2fs.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 mke2fs.conf
64 file.  They will be described in more detail in future sections of this
65 document.
66 .TP 
67 .I [defaults]
68 Contains relations which define the default parameters 
69 used by
70 .BR mke2fs (8).
71 In general, these defaults may be overridden by a definition in the
72 .B fs_types
73 stanza, or by an command-line option provided by the user.
74 .TP 
75 .I [fs_types]
76 Contains relations which define defaults that should be used for specific
77 filesystem types.  The filesystem type can be specified explicitly using
78 the 
79 .B -T
80 option to
81 .BR mke2fs (8).
82 .SH THE [defaults] STANZA
83 The following relations are defined in the 
84 .I [defaults]
85 stanza.
86 .TP
87 .I base_features
88 This relation specifies the filesystems features which are enabled in
89 newly created filesystems.  It may be overridden by the
90 .I base_features
91 relation found in the filesystem or usage type subsection of
92 the
93 .I [fs_types] 
94 stanza.
95 .TP
96 .I default_features
97 This relation specifies a set of features that should be added or
98 removed to the features listed in the
99 .I base_features
100 relation.  It may be overridden by the filesystem-specific 
101 .I default_features
102 in the filesystem or usage type subsection of
103 .IR [fs_types] ,
104 and by the 
105 .B -O
106 command-line option
107 to 
108 .BR mke2fs (8).
109 .TP
110 .I enable_periodic_fsck
111 This relation specifies whether periodic filesystem checks should be
112 enforced at boot time.  If enabled, checks will be forced every
113 180 days, or after a random number of mounts.  These values may
114 be changed later via the
115 .B -i
116 and
117 .B -c
118 command-line options to
119 .BR tune2fs (8).
120 .TP
121 .I force_undo
122 This relation, if set to a boolean value of true, forces
123 .B mke2fs
124 to always try to create an undo file, even if the undo file might be
125 huge and it might extend the time to create the filesystem image
126 because the inode table isn't being initialized lazily.
127 .TP
128 .I fs_type
129 This relation specifies the default filesystem type if the user does not
130 specify it via the
131 .B \-t
132 option, or if
133 .B mke2fs
134 is not started using a program name of the form
135 .BI mkfs. fs-type\fR.
136 If both the user and the
137 .B mke2fs.conf
138 file does not specify a default filesystem type, mke2fs will use a
139 default filesystem type of
140 .IR ext3
141 if a journal was requested via a command-line option, or
142 .I ext2
143 if not.
144 .TP
145 .I blocksize
146 This relation specifies the default blocksize if the user does not
147 specify a blocksize on the command line, and the filesystem-type
148 specific section of the configuration file does not specify a blocksize.
149 .TP
150 .I hash_alg
151 This relation specifies the default hash algorithm used for the
152 new filesystems with hashed b-tree directories.  Valid algorithms
153 accepted are:
154 .IR legacy ,
155 .IR half_md4 ,
156 and
157 .IR tea .
158 .TP
159 .I inode_ratio
160 This relation specifies the default inode ratio if the user does not
161 specify one on the command line, and the filesystem-type
162 specific section of the configuration file does not specify a default
163 inode ratio.
164 .TP
165 .I inode_size
166 This relation specifies the default inode size if the user does not
167 specify one on the command line, and the filesystem-type
168 specific section of the configuration file does not specify a default
169 inode size.
170 .TP
171 .I undo_dir
172 This relation specifies the directory where the undo file should be
173 stored.  It can be overridden via the
174 .B E2FSPROGS_UNDO_DIR
175 environment variable.  If the directory location is set to the value
176 .IR none ,
177 .B mke2fs
178 will not create an undo file.
179 .SH THE [fs_types] STANZA
180 Each tag in the
181 .I [fs_types] 
182 stanza names a filesystem type or usage type which can be specified via the
183 .B \-t
184 or
185 .B \-T
186 options to
187 .BR mke2fs (8),
188 respectively.
189 .P
190 The
191 .B mke2fs
192 program constructs a list of fs_types by concatenating the filesystem
193 type (i.e., ext2, ext3, etc.) with the usage type list.  For most
194 configuration options,
195 .B mke2fs
196 will look for a subsection in the
197 .I [fs_types]
198 stanza corresponding with each entry in the constructed list, with later
199 entries overriding earlier filesystem or usage types.
200 For
201 example, consider the following
202 .B mke2fs.conf
203 fragment:
204 .P
205 [defaults]
206 .br
207         base_features = sparse_super,filetype,resize_inode,dir_index
208 .br
209         blocksize = 4096
210 .br
211         inode_size = 256
212 .br
213         inode_ratio = 16384
214 .br
215
216 .br
217 [fs_types]
218 .br
219         ext3 = {
220 .br
221                 features = has_journal
222 .br
223         }
224 .br
225         ext4 = {
226 .br
227                 features = extents,flex_bg
228 .br
229                 inode_size = 256
230 .br
231         }
232 .br
233         small = {
234 .br
235                 blocksize = 1024
236 .br
237                 inode_ratio = 4096
238 .br
239         }
240 .br
241         floppy = {
242 .br
243                 features = ^resize_inode
244 .br
245                 blocksize = 1024
246 .br
247                 inode_size = 128
248 .br
249         }
250 .P
251 If mke2fs started with a program name of
252 .BR mke2fs.ext4 ,
253 then the filesystem type of ext4 will be used.  If the filesystem is
254 smaller than 3 megabytes, and no usage type is specified, then
255 .B mke2fs
256 will use a default
257 usage type of
258 .IR floppy .
259 This results in an fs_types list of "ext4, floppy".   Both the ext4
260 subsection and the floppy subsection define an
261 .I inode_size
262 relation, but since the later entries in the fs_types list supersede
263 earlier ones, the configuration parameter for fs_types.floppy.inode_size
264 will be used, so the filesystem  will have an inode size of 128.
265 .P
266 The exception to this resolution is the
267 .I features
268 tag, which is specifies a set of changes to the features used by the
269 filesystem, and which is cumulative.  So in the above example, first
270 the configuration relation defaults.base_features would enable an
271 initial feature set with the sparse_super, filetype, resize_inode, and
272 dir_index features enabled.  Then configuration relation
273 fs_types.ext4.features would enable the extents and flex_bg
274 features, and finally the configuration relation
275 fs_types.floppy.features would remove
276 the resize_inode feature, resulting in a filesystem feature set
277 consisting of the sparse_super, filetype, resize_inode, dir_index,
278 extents_and flex_bg features.
279 .P
280 For each filesystem type, the following tags may be used in that 
281 fs_type's subsection:
282 .TP
283 .I base_features
284 This relation specifies the features which are initially enabled for this
285 filesystem type.  Only one
286 .I base_features
287 will be used, so if there are multiple entries in the fs_types list
288 whose subsections define the
289 .I base_features
290 relation, only the last will be used by
291 .BR mke2fs (8).
292 .TP
293 .I features
294 This relation specifies a comma-separated list of features edit
295 requests which modify the feature set
296 used by the newly constructed filesystem.  The syntax is the same as the
297 .B -O
298 command-line option to
299 .BR mke2fs (8);
300 that is, a feature can be prefixed by a caret ('^') symbol to disable
301 a named feature.  Each
302 .I feature
303 relation specified in the fs_types list will be applied in the order
304 found in the fs_types list.
305 .TP
306 .I default_features
307 This relation specifies set of features which should be enabled or 
308 disabled after applying the features listed in the
309 .I base_features
310 and
311 .I features
312 relations.  It may be overridden by the
313 .B -O
314 command-line option to
315 .BR mke2fs (8).
316 .TP
317 .I default_mntopts
318 This relation specifies the set of mount options which should be enabled
319 by default.  These may be changed at a later time with the
320 .B -o
321 command-line option to
322 .BR tune2fs (8).
323 .TP
324 .I blocksize
325 This relation specifies the default blocksize if the user does not
326 specify a blocksize on the command line.
327 .TP
328 .I lazy_itable_init
329 This relation is a boolean which specifies whether the inode table should 
330 be lazily initialized.  It only has meaning if the uninit_bg feature is
331 enabled.  If lazy_itable_init is true and the uninit_bg feature is
332 enabled,  the inode table will
333 not fully initialized by 
334 .BR mke2fs (8).
335 This speeds up filesystem
336 initialization noticeably, but it requires the kernel to finish
337 initializing the filesystem in the background when the filesystem is
338 first mounted.
339 .TP
340 .I inode_ratio
341 This relation specifies the default inode ratio if the user does not
342 specify one on the command line.
343 .TP
344 .I inode_size
345 This relation specifies the default inode size if the user does not
346 specify one on the command line.
347 .TP
348 .I hash_alg
349 This relation specifies the default hash algorithm used for the
350 new filesystems with hashed b-tree directories.  Valid algorithms
351 accepted are:
352 .IR legacy ,
353 .IR half_md4 ,
354 and
355 .IR tea .
356 .TP
357 .I flex_bg_size
358 This relation specifies the number of block groups that will be packed
359 together to create one large virtual block group on an ext4 filesystem.
360 This improves meta-data locality and performance on meta-data heavy
361 workloads.  The number of groups must be a power of 2 and may only be
362 specified if the flex_bg filesystem feature is enabled.
363 .I options
364 This relation specifies additional extended options which should be
365 treated by
366 .BR mke2fs (8)
367 as if they were prepended to the argument of the
368 .B -E
369 option.  This can be used to configure the default extended options used
370 by
371 .BR mke2fs (8)
372 on a per-filesystem type basis.
373 .TP
374 .I discard
375 This relation is a boolean which specifies whether the
376 .BR mke2fs (8)
377 should attempt to discard device prior to filesystem creation.
378 .SH FILES
379 .TP
380 .I /etc/mke2fs.conf
381 The configuration file for 
382 .BR mke2fs (8).
383 .SH SEE ALSO
384 .BR mke2fs (8)