blob: 1fc16e720c1cd2ee524556f8535a1d5f36dec5bb [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)
14when it is creating ext2 or ext3 filesystems.
15.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'o9447f382006-05-22 17:59:37 -040062The following stanzas are used in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050063.I mke2fs.conf
64file. They will be described in more detail in future sections of this
65document.
66.TP
67.I [defaults]
68Contains relations which define the default parameters
69used by
70.BR mke2fs (8).
71In general, these defaults may be overridden by a definition in the
72.B fs_types
Theodore Ts'ofac95252006-03-27 01:05:26 -050073stanza, or by an command-line option provided by the user.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050074.TP
75.I [fs_types]
76Contains relations which define defaults that should be used for specific
77filesystem types. The filesystem type can be specified explicitly using
78the
79.B -T
80option to
81.BR mke2fs (8).
Theodore Ts'ofac95252006-03-27 01:05:26 -050082.SH THE [defaults] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050083The following relations are defined in the
84.I [defaults]
Theodore Ts'ofac95252006-03-27 01:05:26 -050085stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050086.TP
87.I base_features
88This relation specifies the filesystems features which are enabled in
Theodore Ts'o9447f382006-05-22 17:59:37 -040089newly created filesystems. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050090.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -050091relation found in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050092the
93.I [fs_types]
Theodore Ts'ofac95252006-03-27 01:05:26 -050094stanza.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -050095.TP
96.I default_features
97This relation specifies a set of features that should be added or
98removed to the features listed in the
99.I base_features
Theodore Ts'o9447f382006-05-22 17:59:37 -0400100relation. It may be overridden by the filesystem-specific
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500101.I default_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500102in the filesystem or usage type subsection of
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500103.IR [fs_types] ,
104and by the
105.B -O
106command-line option
107to
108.BR mke2fs (8).
109.TP
Theodore Ts'o3d438362008-02-19 08:32:58 -0500110.I fs_type
111This relation specifies the default filesystem type if the user does not
112specify it via the
113.B \-t
114option, or if
115.B mke2fs
116is not started using a program name of the form
117.BI mkfs. fs-type\fR.
118If both the user and the
119.B mke2fs.conf
120file does not specify a default filesystem type, mke2fs will use a
121default filesystem type of
122.IR ext3
123if a journal was requested via a command-line option, or
124.I ext2
125if not.
126.TP
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500127.I blocksize
128This relation specifies the default blocksize if the user does not
129specify a blocksize on the command line, and the filesystem-type
130specific section of the configuration file does not specify a blocksize.
131.TP
132.I inode_ratio
133This relation specifies the default inode ratio if the user does not
134specify one on the command line, and the filesystem-type
135specific section of the configuration file does not specify a default
136inode ratio.
Andreas Dilger067911a2006-07-15 22:08:20 -0400137.TP
138.I inode_size
139This relation specifies the default inode size if the user does not
140specify one on the command line, and the filesystem-type
141specific section of the configuration file does not specify a default
142inode size.
Theodore Ts'ofac95252006-03-27 01:05:26 -0500143.SH THE [fs_types] STANZA
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500144Each tag in the
145.I [fs_types]
Theodore Ts'o3d438362008-02-19 08:32:58 -0500146stanza names a filesystem type or usage type which can be specified via the
147.B \-t
148or
149.B \-T
150options to
151.BR mke2fs (8),
152respectively.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500153.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500154The
155.B mke2fs
156program constructs a list of fs_types by concatenating the filesystem
157type (i.e., ext2, ext3, etc.) with the usage type list. For most
158configuration options,
159.B mke2fs
160will look for a subsection in the
161.I [fs_types]
162stanza corresponding with each entry in the constructed list, with later
163entries overriding earlier filesystem or usage types.
164For
165example, consider the following
166.B mke2fs.conf
167fragment:
168.P
169[defaults]
170.br
171 base_features = sparse_super,filetype,resize_inode,dir_index
172.br
173 blocksize = 4096
174.br
175 inode_size = 256
176.br
177 inode_ratio = 16384
178.br
179
180.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500181[fs_types]
182.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500183 ext3 = {
184.br
185 features = has_journal
186.br
187 }
188.br
189 ext4 = {
190.br
191 features = extents,flex_bg
192.br
193 inode_size = 256
194.br
195 }
196.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500197 small = {
198.br
199 blocksize = 1024
200.br
201 inode_ratio = 4096
202.br
203 }
204.br
205 floppy = {
206.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500207 features = ^resize_inode
208.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500209 blocksize = 1024
210.br
Theodore Ts'o3d438362008-02-19 08:32:58 -0500211 inode_size = 128
212.br
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500213 }
214.P
Theodore Ts'o3d438362008-02-19 08:32:58 -0500215If mke2fs started with a program name of
216.BR mke2fs.ext4 ,
217then the filesystem type of ext4 will be used. If the filesystem is
218smaller than 3 megabytes, and no usage type is specified, then
219.B mke2fs
220will use a default
221usage type of
222.IR floppy .
223This results in an fs_types list of "ext4, floppy". Both the ext4
224subsection and the floppy subsection define an
225.I inode_size
226relation, but since the later entries in the fs_types list supercede
227earlier ones, the configuration parameter for fs_types.floppy.inode_size
228will be used, so the filesystem will have an inode size of 128.
229.P
230The exception to this resolution is the
231.I features
232tag, which is specifies a set of changes to the features used by the
233filesystem, and which is cumulative. So in the above example, first
234the configuration relation defaults.base_features would enable an
235initial feature set with the sparse_super, filetype, resize_inode, and
236dir_index features enabled. Then configuration relation
237fs_types.ext4.features would enable the extents and flex_bg
238features, and finally the configuration relation
239fs_types.floppy.features would remove
240the resize_inode feature, resulting in a filesystem feature set
241consisting of the sparse_super, filetype, resize_inode, dir_index,
242extents_and flex_bg features.
243.P
Theodore Ts'ofac95252006-03-27 01:05:26 -0500244For each filesystem type, the following tags may be used in that
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500245fs_type's subsection:
246.TP
247.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500248This relation specifies the features which are initially enabled for this
249filesystem type. Only one
250.I base_features
251will be used, so if there are multiple entries in the fs_types list
252whose subsections define the
253.I base_features
254relation, only the last will be used by
255.BR mke2fs (8).
256.TP
257.I features
258This relation specifies a comma-separated list of features edit
259requests which modify the feature set
260used by the newly constructed filesystem. The syntax is the same as the
261.B -O
262command-line option to
263.BR mke2fs (8);
264that is, a feature can be prefixed by a caret ('^') symbol to disable
265a named feature. Each
266.I feature
267relation specified in the fs_types list will be applied in the order
268found in the fs_types list.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500269.TP
270.I default_features
271This relation specifies set of features which should be enabled or
Theodore Ts'o3d438362008-02-19 08:32:58 -0500272disabled after applying the features listed in the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500273.I base_features
Theodore Ts'o3d438362008-02-19 08:32:58 -0500274and
275.I features
276relations. It may be overridden by the
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500277.B -O
278command-line option to
279.BR mke2fs (8).
280.TP
281.I blocksize
282This relation specifies the default blocksize if the user does not
283specify a blocksize on the command line.
284.TP
285.I inode_ratio
286This relation specifies the default inode ratio if the user does not
287specify one on the command line.
Andreas Dilger067911a2006-07-15 22:08:20 -0400288.TP
289.I inode_size
290This relation specifies the default inode size if the user does not
291specify one on the command line.
Theodore Ts'o9dc6ad12006-03-23 22:00:01 -0500292.SH FILES
293.TP
294.I /etc/mke2fs.conf
295The configuration file for
296.BR mke2fs (8).
297.SH SEE ALSO
298.BR mke2fs (8)