blob: 39a1a40343862a02e143d399a9a3e56c2c80d061 [file] [log] [blame]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -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 mke2fs.conf 5 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6.SH NAME
7mke2fs.conf \- Configuration file for mke2fs
8.SH DESCRIPTION
9.I mke2fs.conf
10is the configuration file for
11.BR mke2fs (8).
12It controls the default parameters used by
13.BR mke2fs (8)
Theodore Ts'o626a2e72013-06-15 21:19:39 -040014when it is creating ext2, ext3, or ext4 filesystems.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050015.PP
16The
17.I mke2fs.conf
Theodore Ts'ofac95252006-03-27 01:05:26 -050018file 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,
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050021which 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
Theodore Ts'ofac95252006-03-27 01:05:26 -050026 [section1]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050027.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050028 tag1 = value_a
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050029.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050030 tag1 = value_b
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050031.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050032 tag2 = value_c
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050033.P
Theodore Ts'ofac95252006-03-27 01:05:26 -050034 [section 2]
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050035.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050036 tag3 = {
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050037.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050038 subtag1 = subtag_value_a
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050039.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050040 subtag1 = subtag_value_b
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050041.br
Theodore Ts'ofac95252006-03-27 01:05:26 -050042 subtag2 = subtag_value_c
43.br
44 }
45.br
46 tag1 = value_d
47.br
48 tag2 = value_e
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050049.br
50 }
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050051.P
Theodore Ts'ofac95252006-03-27 01:05:26 -050052Comments 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
Theodore Ts'o27b422f2011-09-30 18:32:44 -040062Some relations expect a boolean value. The parser is quite liberal on
63recognizing ``yes'', '`y'', ``true'', ``t'', ``1'', ``on'', etc. as a
64boolean true value, and ``no'', ``n'', ``false'', ``nil'', ``0'',
65``off'' as a boolean false value.
66.P
Theodore Ts'o9447f382006-05-22 17:59:37 -040067The following stanzas are used in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050068.I mke2fs.conf
69file. They will be described in more detail in future sections of this
70document.
71.TP
72.I [defaults]
Theodore Ts'o4c2b28a2011-06-14 14:17:56 -040073Contains relations which define the default parameters
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050074used by
75.BR mke2fs (8).
76In general, these defaults may be overridden by a definition in the
77.B fs_types
Theodore Ts'ofac95252006-03-27 01:05:26 -050078stanza, or by an command-line option provided by the user.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050079.TP
80.I [fs_types]
81Contains relations which define defaults that should be used for specific
82filesystem types. The filesystem type can be specified explicitly using
83the
84.B -T
85option to
86.BR mke2fs (8).
Theodore Ts'ofac95252006-03-27 01:05:26 -050087.SH THE [defaults] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050088The following relations are defined in the
89.I [defaults]
Theodore Ts'ofac95252006-03-27 01:05:26 -050090stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050091.TP
92.I base_features
93This relation specifies the filesystems features which are enabled in
Theodore Ts'o9447f382006-05-22 17:59:37 -040094newly created filesystems. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050095.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -050096relation found in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050097the
98.I [fs_types]
Theodore Ts'ofac95252006-03-27 01:05:26 -050099stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500100.TP
101.I default_features
102This relation specifies a set of features that should be added or
103removed to the features listed in the
104.I base_features
Theodore Ts'o9447f382006-05-22 17:59:37 -0400105relation. It may be overridden by the filesystem-specific
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500106.I default_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500107in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500108.IR [fs_types] ,
109and by the
110.B -O
111command-line option
112to
113.BR mke2fs (8).
114.TP
Eric Sandeen3daf5922011-02-17 15:55:15 -0600115.I enable_periodic_fsck
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400116This boolean relation specifies whether periodic filesystem checks should be
117enforced at boot time. If set to true, checks will be forced every
Eric Sandeen3daf5922011-02-17 15:55:15 -0600118180 days, or after a random number of mounts. These values may
119be changed later via the
120.B -i
121and
122.B -c
123command-line options to
124.BR tune2fs (8).
125.TP
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530126.I force_undo
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400127This boolean relation, if set to a value of true, forces
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530128.B mke2fs
129to always try to create an undo file, even if the undo file might be
130huge and it might extend the time to create the filesystem image
131because the inode table isn't being initialized lazily.
132.TP
Theodore Ts'o3d438362008-02-19 08:32:58 -0500133.I fs_type
134This relation specifies the default filesystem type if the user does not
135specify it via the
136.B \-t
137option, or if
138.B mke2fs
139is not started using a program name of the form
140.BI mkfs. fs-type\fR.
141If both the user and the
142.B mke2fs.conf
143file does not specify a default filesystem type, mke2fs will use a
144default filesystem type of
145.IR ext3
146if a journal was requested via a command-line option, or
147.I ext2
148if not.
149.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500150.I blocksize
151This relation specifies the default blocksize if the user does not
152specify a blocksize on the command line, and the filesystem-type
153specific section of the configuration file does not specify a blocksize.
154.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400155.I hash_alg
156This relation specifies the default hash algorithm used for the
157new filesystems with hashed b-tree directories. Valid algorithms
158accepted are:
159.IR legacy ,
160.IR half_md4 ,
161and
162.IR tea .
163.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500164.I inode_ratio
165This relation specifies the default inode ratio if the user does not
166specify one on the command line, and the filesystem-type
167specific section of the configuration file does not specify a default
168inode ratio.
Andreas Dilger067911a2006-07-15 22:08:20 -0400169.TP
170.I inode_size
171This relation specifies the default inode size if the user does not
172specify one on the command line, and the filesystem-type
173specific section of the configuration file does not specify a default
174inode size.
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530175.TP
Aditya Kalid3859af2011-05-10 14:51:31 -0700176.I reserved_ratio
177This relation specifies the default percentage of filesystem blocks
178reserved for the super-user, if the user does not
179specify one on the command line, and the filesystem-type
180specific section of the configuration file does not specify a default
181reserved ratio. This value can be a floating point number.
182.TP
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530183.I undo_dir
184This relation specifies the directory where the undo file should be
Theodore Ts'o711d3842008-09-07 14:08:40 -0400185stored. It can be overridden via the
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530186.B E2FSPROGS_UNDO_DIR
Theodore Ts'o711d3842008-09-07 14:08:40 -0400187environment variable. If the directory location is set to the value
Aneesh Kumar K.Vb626b392007-08-13 15:56:26 +0530188.IR none ,
189.B mke2fs
190will not create an undo file.
Theodore Ts'ofac95252006-03-27 01:05:26 -0500191.SH THE [fs_types] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500192Each tag in the
193.I [fs_types]
Theodore Ts'o3d438362008-02-19 08:32:58 -0500194stanza names a filesystem type or usage type which can be specified via the
195.B \-t
196or
197.B \-T
198options to
199.BR mke2fs (8),
200respectively.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500201.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500202The
203.B mke2fs
204program constructs a list of fs_types by concatenating the filesystem
205type (i.e., ext2, ext3, etc.) with the usage type list. For most
206configuration options,
207.B mke2fs
208will look for a subsection in the
209.I [fs_types]
210stanza corresponding with each entry in the constructed list, with later
211entries overriding earlier filesystem or usage types.
212For
213example, consider the following
214.B mke2fs.conf
215fragment:
216.P
217[defaults]
218.br
219 base_features = sparse_super,filetype,resize_inode,dir_index
220.br
221 blocksize = 4096
222.br
223 inode_size = 256
224.br
225 inode_ratio = 16384
226.br
227
228.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500229[fs_types]
230.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500231 ext3 = {
232.br
233 features = has_journal
234.br
235 }
236.br
237 ext4 = {
238.br
239 features = extents,flex_bg
240.br
241 inode_size = 256
242.br
243 }
244.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500245 small = {
246.br
247 blocksize = 1024
248.br
249 inode_ratio = 4096
250.br
251 }
252.br
253 floppy = {
254.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500255 features = ^resize_inode
256.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500257 blocksize = 1024
258.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500259 inode_size = 128
260.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500261 }
262.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500263If mke2fs started with a program name of
264.BR mke2fs.ext4 ,
265then the filesystem type of ext4 will be used. If the filesystem is
266smaller than 3 megabytes, and no usage type is specified, then
267.B mke2fs
268will use a default
269usage type of
270.IR floppy .
271This results in an fs_types list of "ext4, floppy". Both the ext4
272subsection and the floppy subsection define an
273.I inode_size
Theodore Ts'o711d3842008-09-07 14:08:40 -0400274relation, but since the later entries in the fs_types list supersede
Theodore Ts'o3d438362008-02-19 08:32:58 -0500275earlier ones, the configuration parameter for fs_types.floppy.inode_size
276will be used, so the filesystem will have an inode size of 128.
277.P
278The exception to this resolution is the
279.I features
280tag, which is specifies a set of changes to the features used by the
281filesystem, and which is cumulative. So in the above example, first
282the configuration relation defaults.base_features would enable an
283initial feature set with the sparse_super, filetype, resize_inode, and
284dir_index features enabled. Then configuration relation
285fs_types.ext4.features would enable the extents and flex_bg
286features, and finally the configuration relation
287fs_types.floppy.features would remove
288the resize_inode feature, resulting in a filesystem feature set
289consisting of the sparse_super, filetype, resize_inode, dir_index,
290extents_and flex_bg features.
291.P
Theodore Ts'ofac95252006-03-27 01:05:26 -0500292For each filesystem type, the following tags may be used in that
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500293fs_type's subsection:
294.TP
295.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500296This relation specifies the features which are initially enabled for this
297filesystem type. Only one
298.I base_features
299will be used, so if there are multiple entries in the fs_types list
300whose subsections define the
301.I base_features
302relation, only the last will be used by
303.BR mke2fs (8).
304.TP
305.I features
306This relation specifies a comma-separated list of features edit
307requests which modify the feature set
308used by the newly constructed filesystem. The syntax is the same as the
309.B -O
310command-line option to
311.BR mke2fs (8);
312that is, a feature can be prefixed by a caret ('^') symbol to disable
313a named feature. Each
314.I feature
315relation specified in the fs_types list will be applied in the order
316found in the fs_types list.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500317.TP
318.I default_features
319This relation specifies set of features which should be enabled or
Theodore Ts'o3d438362008-02-19 08:32:58 -0500320disabled after applying the features listed in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500321.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500322and
323.I features
324relations. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500325.B -O
326command-line option to
327.BR mke2fs (8).
328.TP
Theodore Ts'o493024e2010-06-13 14:00:00 -0400329.I auto_64-bit_support
330This relation is a boolean which specifies whether
331.BR mke2fs (8)
332should automatically add the 64bit feature if the number of blocks for
333the file system requires this feature to be enabled. The resize_inode
334feature is also automatically disabled since it doesn't support 64-bit
335block numbers.
336.TP
Eric Sandeen6a426c92011-02-17 15:56:17 -0600337.I default_mntopts
338This relation specifies the set of mount options which should be enabled
339by default. These may be changed at a later time with the
340.B -o
341command-line option to
342.BR tune2fs (8).
343.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500344.I blocksize
345This relation specifies the default blocksize if the user does not
346specify a blocksize on the command line.
347.TP
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400348.I lazy_itable_init
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400349This boolean relation specifies whether the inode table should
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400350be lazily initialized. It only has meaning if the uninit_bg feature is
351enabled. If lazy_itable_init is true and the uninit_bg feature is
352enabled, the inode table will
353not fully initialized by
354.BR mke2fs (8).
355This speeds up filesystem
Theodore Ts'o711d3842008-09-07 14:08:40 -0400356initialization noticeably, but it requires the kernel to finish
Theodore Ts'oa4396e92008-04-18 10:19:27 -0400357initializing the filesystem in the background when the filesystem is
358first mounted.
359.TP
Theodore Ts'ob8182052014-01-28 12:58:56 -0500360.I journal_location
361This relation specifies the location of the journal.
362.TP
Theodore Ts'o65c6c3e2014-01-11 22:11:42 -0500363.I num_backup_sb
364This relation indicates whether file systems with the
365.B sparse_super2
366feature enabled should be created with 0, 1, or 2 backup superblocks.
367.TP
Theodore Ts'o3c6e91c2014-01-28 14:44:23 -0500368.I packed_meta_blocks
369This boolean relation specifes whether the allocation bitmaps, inode
370table, and journal should be located at the beginning of the file system.
371.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500372.I inode_ratio
373This relation specifies the default inode ratio if the user does not
374specify one on the command line.
Andreas Dilger067911a2006-07-15 22:08:20 -0400375.TP
376.I inode_size
377This relation specifies the default inode size if the user does not
378specify one on the command line.
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400379.TP
Aditya Kalid3859af2011-05-10 14:51:31 -0700380.I reserved_ratio
381This relation specifies the default percentage of filesystem blocks
382reserved for the super-user, if the user does not specify one on the command
383line.
384.TP
Theodore Ts'od5f57d92008-08-29 21:39:36 -0400385.I hash_alg
386This relation specifies the default hash algorithm used for the
387new filesystems with hashed b-tree directories. Valid algorithms
388accepted are:
389.IR legacy ,
390.IR half_md4 ,
391and
392.IR tea .
393.TP
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400394.I flex_bg_size
Eric Sandeend4a93302011-03-10 10:09:35 -0600395This relation specifies the number of block groups that will be packed
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400396together to create one large virtual block group on an ext4 filesystem.
397This improves meta-data locality and performance on meta-data heavy
Eric Sandeend4a93302011-03-10 10:09:35 -0600398workloads. The number of groups must be a power of 2 and may only be
Theodore Ts'o9ba40002008-04-22 08:27:01 -0400399specified if the flex_bg filesystem feature is enabled.
David Prévotb75a4ce2012-03-26 10:45:51 -0700400.TP
Theodore Ts'o2d363582008-05-14 18:09:37 -0400401.I options
402This relation specifies additional extended options which should be
403treated by
404.BR mke2fs (8)
405as if they were prepended to the argument of the
406.B -E
407option. This can be used to configure the default extended options used
408by
409.BR mke2fs (8)
410on a per-filesystem type basis.
Lukas Czerner7fe5ff32010-11-18 14:38:41 +0100411.TP
412.I discard
Theodore Ts'o27b422f2011-09-30 18:32:44 -0400413This boolean relation specifies whether the
Lukas Czerner7fe5ff32010-11-18 14:38:41 +0100414.BR mke2fs (8)
415should attempt to discard device prior to filesystem creation.
Theodore Ts'o2d34a252011-06-14 14:30:22 -0400416.TP
417.I cluster_size
418This relation specifies the default cluster size if the bigalloc file
419system feature is enabled. It can be overridden via the
420.B \-C
421command line option to
422.BR mke2fs (8)
Theodore Ts'o23a1b982014-01-20 23:06:07 -0500423.TP
424.I make_hugefiles
425This boolean relation enables the creation of pre-allocated files as
426part of formatting the file system.
427.TP
428.I hugefiles_uid
429This relation controls the user ownership for all of the files and
430directories created by the
431.I make_hugefiles
432feature.
433.TP
434.I hugefiles_gid
435This relation controls the group ownership for all of the files and
436directories created by the
437.I make_hugefiles
438feature.
439.TP
440.I hugefiles_umask
441This relation specifies the umask used when creating the files and
442directories by the
443.I make_hugefiles
444feature.
445.TP
446.I num_hugefiles
447This relation specifies the number of huge files to be created. If this
448relation is not specified, or is set to zero, and the
449.I hugefiles_size
450relation is non-zero, then
451.I make_hugefiles
452will create as many huge files as can fit to fill the entire file system.
453.TP
454.I hugefiles_slack
455This relation specifies how much space should be reserved for other
456files.
457.TP
458.I hugefiles_size
459This relation specifies the size of the huge files. If this relation is
460not specified, the default is to fill th efile system.
461.TP
462.I hugefiles_name
463This relation specifies the base file name for the huge files.
464.TP
465.I hugefiles_digits
466This relation specifies the (zero-padded) width of the field for the
467huge file number.
468.TP
469.I zero_hugefiles
470This boolean relation specifies whether or not zero blocks will be
471written to the hugefiles while
472.BR mke2fs(8)
473is creating them. By default, zero blocks will be written to the huge
474files to avoid stale data from being made available to potentially
475untrusted user programs, unless the device supports a discard/trim
476operation which will take care of zeroing the device blocks. By
477.I zero_hugefiles
478to false, this step will always be skipped, which can be useful if it is
479known that the disk has been previously erased, or if the user programs
480that will have access to the huge files are trusted to not reveal stale
481data.
Theodore Ts'o4c2b28a2011-06-14 14:17:56 -0400482.SH THE [devices] STANZA
483Each tag in the
484.I [devices]
485stanza names device name so that per-device defaults can be specified.
486.TP
487.I fs_type
488This relation specifies the default parameter for the
489.B \-t
490option, if this option isn't specified on the command line.
491.TP
492.I usage_types
493This relation specifies the default parameter for the
494.B \-T
495option, if this option isn't specified on the command line.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500496.SH FILES
497.TP
498.I /etc/mke2fs.conf
499The configuration file for
500.BR mke2fs (8).
501.SH SEE ALSO
502.BR mke2fs (8)