Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 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, |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 26 | [section1] |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 27 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 28 | tag1 = value_a |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 29 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 30 | tag1 = value_b |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 31 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 32 | tag2 = value_c |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 33 | .P |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 34 | [section 2] |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 35 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 36 | tag3 = { |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 37 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 38 | subtag1 = subtag_value_a |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 39 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 40 | subtag1 = subtag_value_b |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 41 | .br |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 42 | subtag2 = subtag_value_c |
| 43 | .br |
| 44 | } |
| 45 | .br |
| 46 | tag1 = value_d |
| 47 | .br |
| 48 | tag2 = value_e |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 49 | .br |
| 50 | } |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 51 | .P |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 9447f38 | 2006-05-22 17:59:37 -0400 | [diff] [blame] | 62 | The following stanzas are used in the |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 73 | stanza, or by an command-line option provided by the user. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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). |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 82 | .SH THE [defaults] STANZA |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 83 | The following relations are defined in the |
| 84 | .I [defaults] |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 85 | stanza. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 86 | .TP |
| 87 | .I base_features |
| 88 | This relation specifies the filesystems features which are enabled in |
Theodore Ts'o | 9447f38 | 2006-05-22 17:59:37 -0400 | [diff] [blame] | 89 | newly created filesystems. It may be overridden by the |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 90 | .I base_features |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 91 | relation found in the filesystem or usage type subsection of |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 92 | the |
| 93 | .I [fs_types] |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 94 | stanza. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 9447f38 | 2006-05-22 17:59:37 -0400 | [diff] [blame] | 100 | relation. It may be overridden by the filesystem-specific |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 101 | .I default_features |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 102 | in the filesystem or usage type subsection of |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 103 | .IR [fs_types] , |
| 104 | and by the |
| 105 | .B -O |
| 106 | command-line option |
| 107 | to |
| 108 | .BR mke2fs (8). |
| 109 | .TP |
Eric Sandeen | 3daf592 | 2011-02-17 15:55:15 -0600 | [diff] [blame^] | 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 |
Aneesh Kumar K.V | b626b39 | 2007-08-13 15:56:26 +0530 | [diff] [blame] | 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 |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | d5f57d9 | 2008-08-29 21:39:36 -0400 | [diff] [blame] | 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 |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 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. |
Andreas Dilger | 067911a | 2006-07-15 22:08:20 -0400 | [diff] [blame] | 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. |
Aneesh Kumar K.V | b626b39 | 2007-08-13 15:56:26 +0530 | [diff] [blame] | 170 | .TP |
| 171 | .I undo_dir |
| 172 | This relation specifies the directory where the undo file should be |
Theodore Ts'o | 711d384 | 2008-09-07 14:08:40 -0400 | [diff] [blame] | 173 | stored. It can be overridden via the |
Aneesh Kumar K.V | b626b39 | 2007-08-13 15:56:26 +0530 | [diff] [blame] | 174 | .B E2FSPROGS_UNDO_DIR |
Theodore Ts'o | 711d384 | 2008-09-07 14:08:40 -0400 | [diff] [blame] | 175 | environment variable. If the directory location is set to the value |
Aneesh Kumar K.V | b626b39 | 2007-08-13 15:56:26 +0530 | [diff] [blame] | 176 | .IR none , |
| 177 | .B mke2fs |
| 178 | will not create an undo file. |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 179 | .SH THE [fs_types] STANZA |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 180 | Each tag in the |
| 181 | .I [fs_types] |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 189 | .P |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 217 | [fs_types] |
| 218 | .br |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 233 | small = { |
| 234 | .br |
| 235 | blocksize = 1024 |
| 236 | .br |
| 237 | inode_ratio = 4096 |
| 238 | .br |
| 239 | } |
| 240 | .br |
| 241 | floppy = { |
| 242 | .br |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 243 | features = ^resize_inode |
| 244 | .br |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 245 | blocksize = 1024 |
| 246 | .br |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 247 | inode_size = 128 |
| 248 | .br |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 249 | } |
| 250 | .P |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | 711d384 | 2008-09-07 14:08:40 -0400 | [diff] [blame] | 262 | relation, but since the later entries in the fs_types list supersede |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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 |
Theodore Ts'o | fac9525 | 2006-03-27 01:05:26 -0500 | [diff] [blame] | 280 | For each filesystem type, the following tags may be used in that |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 281 | fs_type's subsection: |
| 282 | .TP |
| 283 | .I base_features |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 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. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 305 | .TP |
| 306 | .I default_features |
| 307 | This relation specifies set of features which should be enabled or |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 308 | disabled after applying the features listed in the |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 309 | .I base_features |
Theodore Ts'o | 3d43836 | 2008-02-19 08:32:58 -0500 | [diff] [blame] | 310 | and |
| 311 | .I features |
| 312 | relations. It may be overridden by the |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 313 | .B -O |
| 314 | command-line option to |
| 315 | .BR mke2fs (8). |
| 316 | .TP |
| 317 | .I blocksize |
| 318 | This relation specifies the default blocksize if the user does not |
| 319 | specify a blocksize on the command line. |
| 320 | .TP |
Theodore Ts'o | a4396e9 | 2008-04-18 10:19:27 -0400 | [diff] [blame] | 321 | .I lazy_itable_init |
| 322 | This relation is a boolean which specifies whether the inode table should |
| 323 | be lazily initialized. It only has meaning if the uninit_bg feature is |
| 324 | enabled. If lazy_itable_init is true and the uninit_bg feature is |
| 325 | enabled, the inode table will |
| 326 | not fully initialized by |
| 327 | .BR mke2fs (8). |
| 328 | This speeds up filesystem |
Theodore Ts'o | 711d384 | 2008-09-07 14:08:40 -0400 | [diff] [blame] | 329 | initialization noticeably, but it requires the kernel to finish |
Theodore Ts'o | a4396e9 | 2008-04-18 10:19:27 -0400 | [diff] [blame] | 330 | initializing the filesystem in the background when the filesystem is |
| 331 | first mounted. |
| 332 | .TP |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 333 | .I inode_ratio |
| 334 | This relation specifies the default inode ratio if the user does not |
| 335 | specify one on the command line. |
Andreas Dilger | 067911a | 2006-07-15 22:08:20 -0400 | [diff] [blame] | 336 | .TP |
| 337 | .I inode_size |
| 338 | This relation specifies the default inode size if the user does not |
| 339 | specify one on the command line. |
Theodore Ts'o | 9ba4000 | 2008-04-22 08:27:01 -0400 | [diff] [blame] | 340 | .TP |
Theodore Ts'o | d5f57d9 | 2008-08-29 21:39:36 -0400 | [diff] [blame] | 341 | .I hash_alg |
| 342 | This relation specifies the default hash algorithm used for the |
| 343 | new filesystems with hashed b-tree directories. Valid algorithms |
| 344 | accepted are: |
| 345 | .IR legacy , |
| 346 | .IR half_md4 , |
| 347 | and |
| 348 | .IR tea . |
| 349 | .TP |
Theodore Ts'o | 9ba4000 | 2008-04-22 08:27:01 -0400 | [diff] [blame] | 350 | .I flex_bg_size |
| 351 | This relation specifies the number of block goups that will be packed |
| 352 | together to create one large virtual block group on an ext4 filesystem. |
| 353 | This improves meta-data locality and performance on meta-data heavy |
| 354 | workloads. The number of goups must be a power of 2 and may only be |
| 355 | specified if the flex_bg filesystem feature is enabled. |
Theodore Ts'o | 2d36358 | 2008-05-14 18:09:37 -0400 | [diff] [blame] | 356 | .I options |
| 357 | This relation specifies additional extended options which should be |
| 358 | treated by |
| 359 | .BR mke2fs (8) |
| 360 | as if they were prepended to the argument of the |
| 361 | .B -E |
| 362 | option. This can be used to configure the default extended options used |
| 363 | by |
| 364 | .BR mke2fs (8) |
| 365 | on a per-filesystem type basis. |
Lukas Czerner | 7fe5ff3 | 2010-11-18 14:38:41 +0100 | [diff] [blame] | 366 | .TP |
| 367 | .I discard |
| 368 | This relation is a boolean which specifies whether the |
| 369 | .BR mke2fs (8) |
| 370 | should attempt to discard device prior to filesystem creation. |
Theodore Ts'o | 9dc6ad1 | 2006-03-23 22:00:01 -0500 | [diff] [blame] | 371 | .SH FILES |
| 372 | .TP |
| 373 | .I /etc/mke2fs.conf |
| 374 | The configuration file for |
| 375 | .BR mke2fs (8). |
| 376 | .SH SEE ALSO |
| 377 | .BR mke2fs (8) |