]>
Commit | Line | Data |
---|---|---|
3839e657 | 1 | .\" -*- nroff -*- |
a418d3ad TT |
2 | .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved. |
3 | .\" This file may be copied under the terms of the GNU Public License. | |
98794d0e | 4 | .\" |
74becf3c | 5 | .TH MKE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" |
3839e657 | 6 | .SH NAME |
4f858546 | 7 | mke2fs \- create an ext2/ext3/ext4 filesystem |
3839e657 TT |
8 | .SH SYNOPSIS |
9 | .B mke2fs | |
10 | [ | |
11 | .B \-c | |
98794d0e | 12 | | |
3839e657 | 13 | .B \-l |
1e3472c5 | 14 | .I filename |
3839e657 TT |
15 | ] |
16 | [ | |
17 | .B \-b | |
1e3472c5 | 18 | .I block-size |
3839e657 TT |
19 | ] |
20 | [ | |
37c8db7b TT |
21 | .B \-D |
22 | ] | |
23 | [ | |
3839e657 | 24 | .B \-f |
1e3472c5 | 25 | .I fragment-size |
3839e657 TT |
26 | ] |
27 | [ | |
5e05541a TT |
28 | .B \-g |
29 | .I blocks-per-group | |
30 | ] | |
31 | [ | |
9ba40002 TT |
32 | .B \-G |
33 | .I number-of-groups | |
34 | ] | |
35 | [ | |
3839e657 | 36 | .B \-i |
1e3472c5 | 37 | .I bytes-per-inode |
3839e657 TT |
38 | ] |
39 | [ | |
067911ae AD |
40 | .B \-I |
41 | .I inode-size | |
42 | ] | |
43 | [ | |
85ef4ae8 | 44 | .B \-j |
dc2ec525 TT |
45 | ] |
46 | [ | |
47 | .B \-J | |
8ddaa66b | 48 | .I journal-options |
85ef4ae8 TT |
49 | ] |
50 | [ | |
5515e6b4 TT |
51 | .B \-N |
52 | .I number-of-inodes | |
53 | ] | |
54 | [ | |
a26ba650 | 55 | .B \-n |
2740156b TT |
56 | ] |
57 | [ | |
3839e657 | 58 | .B \-m |
1e3472c5 TT |
59 | .I reserved-blocks-percentage |
60 | ] | |
61 | [ | |
62 | .B \-o | |
63 | .I creator-os | |
3839e657 TT |
64 | ] |
65 | [ | |
98794d0e | 66 | .B \-O |
896938d5 TT |
67 | .IR feature [,...] |
68 | ] | |
69 | [ | |
f3db3566 TT |
70 | .B \-q |
71 | ] | |
72 | [ | |
caf8ce4c TT |
73 | .B \-r |
74 | .I fs-revision-level | |
a29f4d30 TT |
75 | ] |
76 | [ | |
c6a44136 TT |
77 | .B \-E |
78 | .I extended-options | |
521e3685 TT |
79 | ] |
80 | [ | |
3839e657 TT |
81 | .B \-v |
82 | ] | |
f3db3566 | 83 | [ |
74becf3c TT |
84 | .B \-F |
85 | ] | |
86 | [ | |
1e3472c5 TT |
87 | .B \-L |
88 | .I volume-label | |
89 | ] | |
90 | [ | |
91 | .B \-M | |
92 | .I last-mounted-directory | |
93 | ] | |
94 | [ | |
f3db3566 TT |
95 | .B \-S |
96 | ] | |
818180cd | 97 | [ |
3d43836f TT |
98 | .B \-t |
99 | .I fs-type | |
100 | ] | |
101 | [ | |
50787ea2 | 102 | .B \-T |
3d43836f | 103 | .I usage-type |
50787ea2 TT |
104 | ] |
105 | [ | |
b0afdda1 TT |
106 | .B \-U |
107 | .I UUID | |
108 | ] | |
109 | [ | |
818180cd TT |
110 | .B \-V |
111 | ] | |
1e3472c5 | 112 | .I device |
3839e657 | 113 | [ |
1e3472c5 | 114 | .I blocks-count |
3839e657 | 115 | ] |
48015ced | 116 | @JDEV@.sp |
8d641749 | 117 | @JDEV@.B "mke2fs \-O journal_dev" |
48015ced TT |
118 | @JDEV@[ |
119 | @JDEV@.B \-b | |
120 | @JDEV@.I block-size | |
121 | @JDEV@] | |
8d641749 | 122 | .\" No external-journal specific journal options yet (size is ignored) |
48015ced TT |
123 | .\" @JDEV@[ |
124 | .\" @JDEV@.B \-J | |
125 | .\" @JDEV@.I journal-options | |
126 | .\" @JDEV@] | |
127 | @JDEV@[ | |
128 | @JDEV@.B \-L | |
129 | @JDEV@.I volume-label | |
130 | @JDEV@] | |
131 | @JDEV@[ | |
132 | @JDEV@.B \-n | |
133 | @JDEV@] | |
134 | @JDEV@[ | |
135 | @JDEV@.B \-q | |
136 | @JDEV@] | |
137 | @JDEV@[ | |
138 | @JDEV@.B \-v | |
139 | @JDEV@] | |
8d641749 | 140 | @JDEV@.I external-journal |
2d15576d AD |
141 | @JDEV@[ |
142 | @JDEV@.I blocks-count | |
143 | @JDEV@] | |
3839e657 TT |
144 | .SH DESCRIPTION |
145 | .B mke2fs | |
4f858546 TT |
146 | is used to create an ext2, ext3, or ext4 filesystem, usually in a disk |
147 | partition. | |
3839e657 | 148 | .I device |
98794d0e | 149 | is the special file corresponding to the device (e.g |
caf8ce4c | 150 | .IR /dev/hdXX ). |
3839e657 TT |
151 | .I blocks-count |
152 | is the number of blocks on the device. If omitted, | |
153 | .B mke2fs | |
0072f8de AD |
154 | automagically figures the file system size. If called as |
155 | .B mkfs.ext3 | |
156 | a journal is created as if the | |
157 | .B \-j | |
158 | option was specified. | |
de7a86e2 TT |
159 | .PP |
160 | The defaults of the parameters for the newly created filesystem, if not | |
161 | overridden by the options listed below, are controlled by the | |
162 | .B /etc/mke2fs.conf | |
163 | configuration file. See the | |
164 | .BR mke2fs.conf (5) | |
165 | manual page for more details. | |
3839e657 TT |
166 | .SH OPTIONS |
167 | .TP | |
caf8ce4c | 168 | .BI \-b " block-size" |
98794d0e | 169 | Specify the size of blocks in bytes. Valid block-size values are 1024, |
06968e7e | 170 | 2048 and 4096 bytes per block. If omitted, |
98794d0e | 171 | block-size is heuristically determined by the filesystem size and |
c5290fae | 172 | the expected usage of the filesystem (see the |
06968e7e | 173 | .B \-T |
98794d0e | 174 | option). If |
c5290fae | 175 | .I block-size |
eddf36ba | 176 | is preceded by a negative sign ('-'), then |
c6a44136 TT |
177 | .B mke2fs |
178 | will use heuristics to determine the | |
c5290fae | 179 | appropriate block size, with the constraint that the block size will be |
98794d0e | 180 | at least |
c5290fae TT |
181 | .I block-size |
182 | bytes. This is useful for certain hardware devices which require that | |
183 | the blocksize be a multiple of 2k. | |
3839e657 | 184 | .TP |
caf8ce4c | 185 | .B \-c |
3ed57c27 | 186 | Check the device for bad blocks before creating the file system. If |
98794d0e | 187 | this option is specified twice, then a slower read-write |
3ed57c27 | 188 | test is used instead of a fast read-only test. |
3839e657 | 189 | .TP |
0f680ee8 ZL |
190 | .B \-C " cluster-size" |
191 | Specify the size of cluster in bytes for filesystems using the bigalloc | |
192 | feature. Valid cluster-size values are from 2048 to 256M bytes per | |
9518b297 TT |
193 | cluster. This can only be specified if the bigalloc feature is |
194 | enabled. (See the | |
195 | .B ext4 (5) | |
196 | man page for more details about bigalloc.) The default cluster size if | |
197 | bigalloc is enabled is 16 times the block size. | |
0f680ee8 | 198 | .TP |
37c8db7b TT |
199 | .B \-D |
200 | Use direct I/O when writing to the disk. This avoids mke2fs dirtying a | |
201 | lot of buffer cache memory, which may impact other applications running | |
202 | on a busy server. This option will cause mke2fs to run much more | |
203 | slowly, however, so there is a tradeoff to using direct I/O. | |
204 | .TP | |
c6a44136 TT |
205 | .BI \-E " extended-options" |
206 | Set extended options for the filesystem. Extended options are comma | |
207 | separated, and may take an argument using the equals ('=') sign. The | |
a26ba650 | 208 | .B \-E |
98794d0e | 209 | option used to be |
a26ba650 | 210 | .B \-R |
98794d0e | 211 | in earlier versions of |
c6a44136 | 212 | .BR mke2fs . |
98794d0e | 213 | The |
a26ba650 | 214 | .B \-R |
b769aaec AD |
215 | option is still accepted for backwards compatibility, but is deprecated. |
216 | The following extended options are supported: | |
c6a44136 TT |
217 | .RS 1.2i |
218 | .TP | |
0f5eba75 AD |
219 | .BI mmp_update_interval= interval |
220 | Adjust the initial MMP update interval to | |
221 | .I interval | |
222 | seconds. Specifying an | |
223 | .I interval | |
224 | of 0 means to use the default interval. The specified interval must | |
225 | be less than 300 seconds. Requires that the | |
226 | .B mmp | |
227 | feature be enabled. | |
228 | .TP | |
0c17cb25 | 229 | .BI stride= stride-size |
c6a44136 | 230 | Configure the filesystem for a RAID array with |
0c17cb25 TT |
231 | .I stride-size |
232 | filesystem blocks. This is the number of blocks read or written to disk | |
98794d0e | 233 | before moving to the next disk, which is sometimes referred to as the |
2ac7f066 TT |
234 | .I chunk size. |
235 | This mostly affects placement of filesystem metadata like bitmaps at | |
a4396e9d | 236 | .B mke2fs |
98794d0e BS |
237 | time to avoid placing them on a single disk, which can hurt performance. |
238 | It may also be used by the block allocator. | |
0c17cb25 | 239 | .TP |
d4c0d8e5 | 240 | .BI stripe_width= stripe-width |
0c17cb25 TT |
241 | Configure the filesystem for a RAID array with |
242 | .I stripe-width | |
98794d0e | 243 | filesystem blocks per stripe. This is typically stride-size * N, where |
2ac7f066 | 244 | N is the number of data-bearing disks in the RAID (e.g. for RAID 5 there is one |
98794d0e | 245 | parity disk, so N will be the number of disks in the array minus 1). |
0c17cb25 TT |
246 | This allows the block allocator to prevent read-modify-write of the |
247 | parity in a RAID stripe if possible when the data is written. | |
c6a44136 | 248 | .TP |
88ee023b TT |
249 | .BI offset= offset |
250 | Create the filesystem at an offset from the beginning of the device or | |
251 | file. This can be useful when creating disk images for virtual machines. | |
252 | .TP | |
c6a44136 TT |
253 | .BI resize= max-online-resize |
254 | Reserve enough space so that the block group descriptor table can grow | |
98794d0e BS |
255 | to support a filesystem that has |
256 | .I max-online-resize | |
257 | blocks. | |
6cb27404 | 258 | .TP |
3b4a66cf | 259 | .B lazy_itable_init\fR[\fB= \fI<0 to disable, 1 to enable>\fR] |
a4396e9d | 260 | If enabled and the uninit_bg feature is enabled, the inode table will |
98794d0e | 261 | not be fully initialized by |
a4396e9d TT |
262 | .BR mke2fs . |
263 | This speeds up filesystem | |
98794d0e | 264 | initialization noticeably, but it requires the kernel to finish |
a4396e9d | 265 | initializing the filesystem in the background when the filesystem is |
43781b94 | 266 | first mounted. If the option value is omitted, it defaults to 1 to |
6c54689f AD |
267 | enable lazy inode table zeroing. |
268 | .TP | |
269 | .B lazy_journal_init\fR[\fB= \fI<0 to disable, 1 to enable>\fR] | |
270 | If enabled, the journal inode will not be fully zeroed out by | |
271 | .BR mke2fs . | |
272 | This speeds up filesystem initialization noticeably, but carries some | |
273 | small risk if the system crashes before the journal has been overwritten | |
274 | entirely one time. If the option value is omitted, it defaults to 1 to | |
275 | enable lazy journal inode zeroing. | |
a4396e9d | 276 | .TP |
dc9cc700 AD |
277 | .BI root_owner [=uid:gid] |
278 | Specify the numeric user and group ID of the root directory. If no UID:GID | |
279 | is specified, use the user and group ID of the user running \fBmke2fs\fR. | |
280 | In \fBmke2fs\fR 1.42 and earlier the UID and GID of the root directory were | |
281 | set by default to the UID and GID of the user running the mke2fs command. | |
282 | The \fBroot_owner=\fR option allows explicitly specifying these values, | |
283 | and avoid side-effects for users that do not expect the contents of the | |
284 | filesystem to change based on the user running \fBmke2fs\fR. | |
285 | .TP | |
6cb27404 TT |
286 | .B test_fs |
287 | Set a flag in the filesystem superblock indicating that it may be | |
288 | mounted using experimental kernel code, such as the ext4dev filesystem. | |
0bc85dfb LC |
289 | .TP |
290 | .BI discard | |
291 | Attempt to discard blocks at mkfs time (discarding blocks initially is useful | |
292 | on solid state devices and sparse / thin-provisioned storage). When the device | |
293 | advertises that discard also zeroes data (any subsequent read after the discard | |
294 | and before write returns zero), then mark all not-yet-zeroed inode tables as | |
295 | zeroed. This significantly speeds up filesystem initialization. This is set | |
296 | as default. | |
297 | .TP | |
298 | .BI nodiscard | |
855a77a1 | 299 | Do not attempt to discard blocks at mkfs time. |
f5589f4c ES |
300 | @QUOTA_MAN_COMMENT@.TP |
301 | @QUOTA_MAN_COMMENT@.BI quotatype | |
4727c67d | 302 | @QUOTA_MAN_COMMENT@Specify which quota type ('usr' or 'grp') is to be |
3c22bf7e | 303 | @QUOTA_MAN_COMMENT@initialized. This option has effect only if the |
f5589f4c | 304 | @QUOTA_MAN_COMMENT@.B quota |
4727c67d UC |
305 | @QUOTA_MAN_COMMENT@feature is set. Without this extended option, the default |
306 | @QUOTA_MAN_COMMENT@behavior is to initialize both user and group quotas. | |
c6a44136 TT |
307 | .RE |
308 | .TP | |
caf8ce4c | 309 | .BI \-f " fragment-size" |
3839e657 TT |
310 | Specify the size of fragments in bytes. |
311 | .TP | |
48015ced | 312 | .B \-F |
98794d0e | 313 | Force |
48015ced | 314 | .B mke2fs |
c16e610c AD |
315 | to create a filesystem, even if the specified device is not a partition |
316 | on a block special device, or if other parameters do not make sense. | |
98794d0e | 317 | In order to force |
c16e610c | 318 | .B mke2fs |
98794d0e | 319 | to create a filesystem even if the filesystem appears to be in use |
c16e610c AD |
320 | or is mounted (a truly dangerous thing to do), this option must be |
321 | specified twice. | |
48015ced | 322 | .TP |
5e05541a TT |
323 | .BI \-g " blocks-per-group" |
324 | Specify the number of blocks in a block group. There is generally no | |
98794d0e | 325 | reason for the user to ever set this parameter, as the default is optimal |
5e05541a TT |
326 | for the filesystem. (For administrators who are creating |
327 | filesystems on RAID arrays, it is preferable to use the | |
328 | .I stride | |
329 | RAID parameter as part of the | |
e28a1bca | 330 | .B \-E |
98794d0e | 331 | option rather than manipulating the number of blocks per group.) |
5e05541a | 332 | This option is generally used by developers who |
98794d0e | 333 | are developing test cases. |
0f680ee8 ZL |
334 | .IP |
335 | If the bigalloc feature is enabled, the | |
336 | .B \-g | |
337 | option will specify the number of clusters in a block group. | |
5e05541a | 338 | .TP |
9ba40002 | 339 | .BI \-G " number-of-groups" |
98794d0e | 340 | Specify the number of block groups that will be packed together to |
7a9f055f TT |
341 | create a larger virtual block group (or "flex_bg group") in an |
342 | ext4 filesystem. This improves meta-data locality and performance | |
343 | on meta-data heavy workloads. The number of groups must be a power | |
344 | of 2 and may only be specified if the | |
345 | .B flex_bg | |
346 | filesystem feature is enabled. | |
9ba40002 | 347 | .TP |
caf8ce4c | 348 | .BI \-i " bytes-per-inode" |
98794d0e | 349 | Specify the bytes/inode ratio. |
3839e657 TT |
350 | .B mke2fs |
351 | creates an inode for every | |
352 | .I bytes-per-inode | |
98794d0e | 353 | bytes of space on the disk. The larger the |
caf8ce4c | 354 | .I bytes-per-inode |
48015ced | 355 | ratio, the fewer inodes will be created. This value generally shouldn't |
98794d0e BS |
356 | be smaller than the blocksize of the filesystem, since in that case more |
357 | inodes would be made than can ever be used. Be warned that it is not | |
e2883e27 PS |
358 | possible to change this ratio on a filesystem after it is created, so be |
359 | careful deciding the correct value for this parameter. Note that resizing | |
360 | a filesystem changes the numer of inodes to maintain this ratio. | |
067911ae AD |
361 | .TP |
362 | .BI \-I " inode-size" | |
98794d0e | 363 | Specify the size of each inode in bytes. |
886056bd | 364 | The |
067911ae | 365 | .I inode-size |
98794d0e | 366 | value must be a power of 2 larger or equal to 128. The larger the |
067911ae AD |
367 | .I inode-size |
368 | the more space the inode table will consume, and this reduces the usable | |
98794d0e | 369 | space in the filesystem and can also negatively impact performance. |
886056bd TT |
370 | It is not |
371 | possible to change this value after the filesystem is created. | |
372 | .IP | |
373 | In kernels after 2.6.10 and some | |
374 | earlier vendor kernels it is possible to utilize inodes larger than | |
375 | 128 bytes to store | |
376 | extended attributes for improved performance. | |
e67670c3 | 377 | Extended attributes |
067911ae | 378 | stored in large inodes are not visible with older kernels, and such |
886056bd TT |
379 | filesystems will not be mountable with 2.4 kernels at all. |
380 | .IP | |
381 | The default inode size is controlled by the | |
382 | .BR mke2fs.conf (5) | |
383 | file. In the | |
384 | .B mke2fs.conf | |
385 | file shipped with e2fsprogs, the default inode size is 256 bytes for | |
386 | most file systems, except for small file systems where the inode size | |
387 | will be 128 bytes. | |
98794d0e | 388 | .TP |
48015ced TT |
389 | .B \-j |
390 | Create the filesystem with an ext3 journal. If the | |
dc2ec525 | 391 | .B \-J |
48015ced | 392 | option is not specified, the default journal parameters will be used to |
98794d0e | 393 | create an appropriately sized journal (given the size of the filesystem) |
48015ced TT |
394 | stored within the filesystem. Note that you must be using a kernel |
395 | which has ext3 support in order to actually make use of the journal. | |
dc2ec525 | 396 | .TP |
48015ced | 397 | .BI \-J " journal-options" |
dc2ec525 | 398 | Create the ext3 journal using options specified on the command-line. |
8ddaa66b TT |
399 | Journal options are comma |
400 | separated, and may take an argument using the equals ('=') sign. | |
48015ced TT |
401 | The following journal options are supported: |
402 | .RS 1.2i | |
dc2ec525 | 403 | .TP |
48015ced | 404 | .BI size= journal-size |
f0865ce4 | 405 | Create an internal journal (i.e., stored inside the filesystem) of size |
98794d0e | 406 | .I journal-size |
8d641749 | 407 | megabytes. |
98794d0e BS |
408 | The size of the journal must be at least 1024 filesystem blocks |
409 | (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) | |
57cb2716 SP |
410 | and may be no more than 10,240,000 filesystem blocks or half the total |
411 | file system size (whichever is smaller) | |
48015ced TT |
412 | @JDEV@.TP |
413 | @JDEV@.BI device= external-journal | |
8d641749 TT |
414 | @JDEV@Attach the filesystem to the journal block device located on |
415 | @JDEV@.IR external-journal . | |
416 | @JDEV@The external | |
417 | @JDEV@journal must already have been created using the command | |
418 | @JDEV@.IP | |
2d15576d AD |
419 | @JDEV@.B mke2fs -O journal_dev |
420 | @JDEV@.I external-journal | |
8d641749 TT |
421 | @JDEV@.IP |
422 | @JDEV@Note that | |
423 | @JDEV@.I external-journal | |
424 | @JDEV@must have been created with the | |
425 | @JDEV@same block size as the new filesystem. | |
3024d887 TT |
426 | @JDEV@In addition, while there is support for attaching |
427 | @JDEV@multiple filesystems to a single external journal, | |
98794d0e | 428 | @JDEV@the Linux kernel and |
3024d887 TT |
429 | @JDEV@.BR e2fsck (8) |
430 | @JDEV@do not currently support shared external journals yet. | |
2d15576d AD |
431 | @JDEV@.IP |
432 | @JDEV@Instead of specifying a device name directly, | |
433 | @JDEV@.I external-journal | |
434 | @JDEV@can also be specified by either | |
435 | @JDEV@.BI LABEL= label | |
436 | @JDEV@or | |
437 | @JDEV@.BI UUID= UUID | |
438 | @JDEV@to locate the external journal by either the volume label or UUID | |
439 | @JDEV@stored in the ext2 superblock at the start of the journal. Use | |
440 | @JDEV@.BR dumpe2fs (8) | |
441 | @JDEV@to display a journal device's volume label and UUID. See also the | |
442 | @JDEV@.B -L | |
443 | @JDEV@option of | |
444 | @JDEV@.BR tune2fs (8). | |
8d641749 TT |
445 | .RE |
446 | @JDEV@.IP | |
48015ced TT |
447 | @JDEV@Only one of the |
448 | @JDEV@.BR size " or " device | |
449 | @JDEV@options can be given for a filesystem. | |
48015ced TT |
450 | .TP |
451 | .BI \-l " filename" | |
452 | Read the bad blocks list from | |
98794d0e | 453 | .IR filename . |
3ed57c27 | 454 | Note that the block numbers in the bad block list must be generated |
98794d0e BS |
455 | using the same block size as used by |
456 | .BR mke2fs . | |
457 | As a result, the | |
3ed57c27 | 458 | .B \-c |
98794d0e | 459 | option to |
3ed57c27 TT |
460 | .B mke2fs |
461 | is a much simpler and less error-prone method of checking a disk for bad | |
98794d0e | 462 | blocks before formatting it, as |
3ed57c27 TT |
463 | .B mke2fs |
464 | will automatically pass the correct parameters to the | |
465 | .B badblocks | |
466 | program. | |
48015ced | 467 | .TP |
6a7075df TT |
468 | .BI \-L " new-volume-label" |
469 | Set the volume label for the filesystem to | |
470 | .IR new-volume-label . | |
471 | The maximum length of the | |
472 | volume label is 16 bytes. | |
48015ced TT |
473 | .TP |
474 | .BI \-m " reserved-blocks-percentage" | |
98794d0e | 475 | Specify the percentage of the filesystem blocks reserved for |
029de632 | 476 | the super-user. This avoids fragmentation, and allows root-owned |
98794d0e | 477 | daemons, such as |
029de632 | 478 | .BR syslogd (8), |
98794d0e BS |
479 | to continue to function correctly after non-privileged processes are |
480 | prevented from writing to the filesystem. The default percentage | |
029de632 | 481 | is 5%. |
dc2ec525 | 482 | .TP |
98794d0e BS |
483 | .BI \-M " last-mounted-directory" |
484 | Set the last mounted directory for the filesystem. This might be useful | |
485 | for the sake of utilities that key off of the last mounted directory to | |
bcf5aea2 | 486 | determine where the filesystem should be mounted. |
85ef4ae8 | 487 | .TP |
caf8ce4c | 488 | .B \-n |
98794d0e BS |
489 | Causes |
490 | .B mke2fs | |
491 | to not actually create a filesystem, but display what it | |
1f22ce34 TT |
492 | would do if it were to create a filesystem. This can be used to |
493 | determine the location of the backup superblocks for a particular | |
98794d0e BS |
494 | filesystem, so long as the |
495 | .B mke2fs | |
496 | parameters that were passed when the | |
1f22ce34 | 497 | filesystem was originally created are used again. (With the |
98794d0e | 498 | .B \-n |
1f22ce34 | 499 | option added, of course!) |
2740156b | 500 | .TP |
caf8ce4c | 501 | .BI \-N " number-of-inodes" |
98794d0e BS |
502 | Overrides the default calculation of the number of inodes that should be |
503 | reserved for the filesystem (which is based on the number of blocks and | |
504 | the | |
caf8ce4c | 505 | .I bytes-per-inode |
98794d0e | 506 | ratio). This allows the user to specify the number |
5515e6b4 TT |
507 | of desired inodes directly. |
508 | .TP | |
48015ced | 509 | .BI \-o " creator-os" |
98794d0e BS |
510 | Overrides the default value of the "creator operating system" field of the |
511 | filesystem. The creator field is set by default to the name of the OS the | |
583ccdc3 | 512 | .B mke2fs |
98794d0e | 513 | executable was compiled for. |
1e3472c5 | 514 | .TP |
8d641749 | 515 | .B "\-O \fIfeature\fR[,...]" |
98794d0e BS |
516 | Create a filesystem with the given features (filesystem options), |
517 | overriding the default filesystem options. The features that are | |
9dc6ad1e TT |
518 | enabled by default are specified by the |
519 | .I base_features | |
520 | relation, either in the | |
98794d0e | 521 | .I [defaults] |
9dc6ad1e TT |
522 | section in the |
523 | .B /etc/mke2fs.conf | |
3d43836f | 524 | configuration file, |
98794d0e | 525 | or in the |
9dc6ad1e | 526 | .I [fs_types] |
98794d0e | 527 | subsections for the usage types as specified by the |
a26ba650 | 528 | .B \-T |
3d43836f TT |
529 | option, further modified by the |
530 | .I features | |
531 | relation found in the | |
98794d0e BS |
532 | .I [fs_types] |
533 | subsections for the filesystem and usage types. See the | |
3d43836f TT |
534 | .BR mke2fs.conf (5) |
535 | manual page for more details. | |
536 | The filesystem type-specific configuration setting found in the | |
9dc6ad1e TT |
537 | .I [fs_types] |
538 | section will override the global default found in | |
98794d0e | 539 | .IR [defaults] . |
48015ced | 540 | .sp |
98794d0e BS |
541 | The filesystem feature set will be further edited |
542 | using either the feature set specified by this option, | |
543 | or if this option is not given, by the | |
9dc6ad1e | 544 | .I default_features |
98794d0e BS |
545 | relation for the filesystem type being created, or in the |
546 | .I [defaults] | |
9dc6ad1e TT |
547 | section of the configuration file. |
548 | .sp | |
549 | The filesystem feature set is comprised of a list of features, separated | |
550 | by commas, that are to be enabled. To disable a feature, simply | |
4727c67d | 551 | prefix the feature name with a caret ('^') or a minus ('-') character. |
3c22bf7e | 552 | Features with dependencies will not be removed successfully. |
4727c67d | 553 | The pseudo-filesystem feature "none" will clear all filesystem features. |
4727c67d | 554 | .TP |
3c22bf7e TT |
555 | For more information about the features which can be set, please see |
556 | the manual page | |
557 | .BR ext4 (5). | |
1e3472c5 | 558 | .TP |
8d641749 | 559 | .B \-q |
98794d0e | 560 | Quiet execution. Useful if |
8d641749 TT |
561 | .B mke2fs |
562 | is run in a script. | |
563 | .TP | |
48015ced | 564 | .BI \-r " revision" |
a29f4d30 | 565 | Set the filesystem revision for the new filesystem. Note that 1.2 |
98794d0e | 566 | kernels only support revision 0 filesystems. The default is to |
48015ced | 567 | create revision 1 filesystems. |
a29f4d30 | 568 | .TP |
caf8ce4c | 569 | .B \-S |
f3db3566 TT |
570 | Write superblock and group descriptors only. This is useful if all of |
571 | the superblock and backup superblocks are corrupted, and a last-ditch | |
98794d0e | 572 | recovery method is desired. It causes |
583ccdc3 | 573 | .B mke2fs |
98794d0e | 574 | to reinitialize the |
f3db3566 TT |
575 | superblock and group descriptors, while not touching the inode table |
576 | and the block and inode bitmaps. The | |
577 | .B e2fsck | |
578 | program should be run immediately after this option is used, and there | |
48015ced TT |
579 | is no guarantee that any data will be salvageable. It is critical to |
580 | specify the correct filesystem blocksize when using this option, | |
581 | or there is no chance of recovery. | |
8d641749 TT |
582 | .\" .TP |
583 | .\" .BI \-t " test" | |
584 | .\" Check the device for bad blocks before creating the file system | |
585 | .\" using the specified test. | |
818180cd | 586 | .TP |
3d43836f | 587 | .BI \-t " fs-type" |
4727c67d UC |
588 | Specify the filesystem type (i.e., ext2, ext3, ext4, etc.) that is |
589 | to be created. | |
98794d0e BS |
590 | If this option is not specified, |
591 | .B mke2fs | |
592 | will pick a default either via how | |
593 | the command was run (for example, using a name of the form mkfs.ext2, | |
3d43836f | 594 | mkfs.ext3, etc.) or via a default as defined by the |
626a2e74 | 595 | .B /etc/mke2fs.conf |
08c8b1ab TT |
596 | file. This option controls which filesystem options are used by |
597 | default, based on the | |
598 | .B fstypes | |
599 | configuration stanza in | |
626a2e74 | 600 | .BR /etc/mke2fs.conf . |
08c8b1ab TT |
601 | .sp |
602 | If the | |
603 | .B \-O | |
604 | option is used to explicitly add or remove filesystem options that | |
605 | should be set in the newly created filesystem, the | |
606 | resulting filesystem may not be supported by the requested | |
607 | .IR fs-type . | |
b7150807 | 608 | (e.g., "\fBmke2fs \-t ext3 \-O extent /dev/sdXX\fR" will create a |
08c8b1ab | 609 | filesystem that is not supported by the ext3 implementation as found in |
93aa0246 | 610 | the Linux kernel; and "\fBmke2fs \-t ext3 \-O ^has_journal /dev/hdXX\fR" |
08c8b1ab TT |
611 | will create a filesystem that does not have a journal and hence will not |
612 | be supported by the ext3 filesystem code in the Linux kernel.) | |
3d43836f TT |
613 | .TP |
614 | .BI \-T " usage-type[,...]" | |
98794d0e BS |
615 | Specify how the filesystem is going to be used, so that |
616 | .B mke2fs | |
3d43836f TT |
617 | can choose optimal filesystem parameters for that use. The usage |
618 | types that are supported are defined in the configuration file | |
626a2e74 | 619 | .BR /etc/mke2fs.conf . |
3d43836f TT |
620 | The user may specify one or more usage types |
621 | using a comma separated list. | |
622 | .sp | |
623 | If this option is is not specified, | |
624 | .B mke2fs | |
625 | will pick a single default usage type based on the size of the filesystem to | |
626 | be created. If the filesystem size is less than or equal to 3 megabytes, | |
a4396e9d | 627 | .B mke2fs |
3d43836f TT |
628 | will use the filesystem type |
629 | .IR floppy . | |
630 | If the filesystem size is greater than 3 but less than or equal to | |
631 | 512 megabytes, | |
632 | .BR mke2fs (8) | |
9a2767ff | 633 | will use the filesystem type |
3d43836f | 634 | .IR small . |
9a2767ff NK |
635 | If the filesystem size is greater than or equal to 4 terabytes but less than |
636 | 16 terabytes, | |
637 | .BR mke2fs (8) | |
638 | will use the filesystem type | |
639 | .IR big . | |
640 | If the filesystem size is greater than or equal to 16 terabytes, | |
641 | .BR mke2fs (8) | |
642 | will use the filesystem type | |
643 | .IR huge . | |
3d43836f TT |
644 | Otherwise, |
645 | .BR mke2fs (8) | |
646 | will use the default filesystem type | |
647 | .IR default . | |
48015ced | 648 | .TP |
b0afdda1 TT |
649 | .BI \-U " UUID" |
650 | Create the filesystem with the specified UUID. | |
651 | .TP | |
48015ced TT |
652 | .B \-v |
653 | Verbose execution. | |
50787ea2 | 654 | .TP |
caf8ce4c | 655 | .B \-V |
98794d0e | 656 | Print the version number of |
818180cd TT |
657 | .B mke2fs |
658 | and exit. | |
5182ad4c NK |
659 | .SH ENVIRONMENT |
660 | .TP | |
661 | .BI MKE2FS_SYNC | |
662 | If set to non-zero integer value, its value is used to determine how often | |
663 | .BR sync (2) | |
664 | is called during inode table initialization. | |
665 | .TP | |
666 | .BI MKE2FS_CONFIG | |
667 | Determines the location of the configuration file (see | |
668 | .BR mke2fs.conf (5)). | |
669 | .TP | |
670 | .BI MKE2FS_FIRST_META_BG | |
671 | If set to non-zero integer value, its value is used to determine first meta | |
672 | block group. This is mostly for debugging purposes. | |
673 | .TP | |
674 | .BI MKE2FS_DEVICE_SECTSIZE | |
675 | If set to non-zero integer value, its value is used to determine physical | |
676 | sector size of the | |
677 | .IR device . | |
678 | .TP | |
679 | .BI MKE2FS_SKIP_CHECK_MSG | |
680 | If set, do not show the message of filesystem automatic check caused by | |
681 | mount count or check interval. | |
3839e657 TT |
682 | .SH AUTHOR |
683 | This version of | |
684 | .B mke2fs | |
a418d3ad | 685 | has been written by Theodore Ts'o <tytso@mit.edu>. |
3839e657 TT |
686 | .SH BUGS |
687 | .B mke2fs | |
caf8ce4c TT |
688 | accepts the |
689 | .B \-f | |
690 | option but currently ignores it because the second | |
3839e657 TT |
691 | extended file system does not support fragments yet. |
692 | .br | |
48015ced | 693 | There may be other ones. Please, report them to the author. |
3839e657 TT |
694 | .SH AVAILABILITY |
695 | .B mke2fs | |
98794d0e | 696 | is part of the e2fsprogs package and is available from |
348e43dc | 697 | http://e2fsprogs.sourceforge.net. |
3839e657 | 698 | .SH SEE ALSO |
9dc6ad1e | 699 | .BR mke2fs.conf (5), |
e72a9ba3 | 700 | .BR badblocks (8), |
3839e657 TT |
701 | .BR dumpe2fs (8), |
702 | .BR e2fsck (8), | |
3c22bf7e TT |
703 | .BR tune2fs (8), |
704 | .BR ext4 (5) |