]>
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. | |
4 | .\" | |
74becf3c | 5 | .TH MKE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" |
3839e657 | 6 | .SH NAME |
a7ac1df3 | 7 | mke2fs \- create an ext2/ext3 filesystem |
3839e657 TT |
8 | .SH SYNOPSIS |
9 | .B mke2fs | |
10 | [ | |
11 | .B \-c | |
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 | [ | |
21 | .B \-f | |
1e3472c5 | 22 | .I fragment-size |
3839e657 TT |
23 | ] |
24 | [ | |
5e05541a TT |
25 | .B \-g |
26 | .I blocks-per-group | |
27 | ] | |
28 | [ | |
3839e657 | 29 | .B \-i |
1e3472c5 | 30 | .I bytes-per-inode |
3839e657 TT |
31 | ] |
32 | [ | |
85ef4ae8 | 33 | .B \-j |
dc2ec525 TT |
34 | ] |
35 | [ | |
36 | .B \-J | |
8ddaa66b | 37 | .I journal-options |
85ef4ae8 TT |
38 | ] |
39 | [ | |
5515e6b4 TT |
40 | .B \-N |
41 | .I number-of-inodes | |
42 | ] | |
43 | [ | |
2740156b TT |
44 | .B -n |
45 | ] | |
46 | [ | |
3839e657 | 47 | .B \-m |
1e3472c5 TT |
48 | .I reserved-blocks-percentage |
49 | ] | |
50 | [ | |
51 | .B \-o | |
52 | .I creator-os | |
3839e657 TT |
53 | ] |
54 | [ | |
896938d5 TT |
55 | .B \-O |
56 | .IR feature [,...] | |
57 | ] | |
58 | [ | |
f3db3566 TT |
59 | .B \-q |
60 | ] | |
61 | [ | |
caf8ce4c TT |
62 | .B \-r |
63 | .I fs-revision-level | |
a29f4d30 TT |
64 | ] |
65 | [ | |
c6a44136 TT |
66 | .B \-E |
67 | .I extended-options | |
521e3685 TT |
68 | ] |
69 | [ | |
3839e657 TT |
70 | .B \-v |
71 | ] | |
f3db3566 | 72 | [ |
74becf3c TT |
73 | .B \-F |
74 | ] | |
75 | [ | |
1e3472c5 TT |
76 | .B \-L |
77 | .I volume-label | |
78 | ] | |
79 | [ | |
80 | .B \-M | |
81 | .I last-mounted-directory | |
82 | ] | |
83 | [ | |
f3db3566 TT |
84 | .B \-S |
85 | ] | |
818180cd | 86 | [ |
50787ea2 TT |
87 | .B \-T |
88 | .I filesystem-type | |
89 | ] | |
90 | [ | |
818180cd TT |
91 | .B \-V |
92 | ] | |
1e3472c5 | 93 | .I device |
3839e657 | 94 | [ |
1e3472c5 | 95 | .I blocks-count |
3839e657 | 96 | ] |
48015ced | 97 | @JDEV@.sp |
8d641749 | 98 | @JDEV@.B "mke2fs \-O journal_dev" |
48015ced TT |
99 | @JDEV@[ |
100 | @JDEV@.B \-b | |
101 | @JDEV@.I block-size | |
102 | @JDEV@] | |
8d641749 | 103 | .\" No external-journal specific journal options yet (size is ignored) |
48015ced TT |
104 | .\" @JDEV@[ |
105 | .\" @JDEV@.B \-J | |
106 | .\" @JDEV@.I journal-options | |
107 | .\" @JDEV@] | |
108 | @JDEV@[ | |
109 | @JDEV@.B \-L | |
110 | @JDEV@.I volume-label | |
111 | @JDEV@] | |
112 | @JDEV@[ | |
113 | @JDEV@.B \-n | |
114 | @JDEV@] | |
115 | @JDEV@[ | |
116 | @JDEV@.B \-q | |
117 | @JDEV@] | |
118 | @JDEV@[ | |
119 | @JDEV@.B \-v | |
120 | @JDEV@] | |
8d641749 | 121 | @JDEV@.I external-journal |
2d15576d AD |
122 | @JDEV@[ |
123 | @JDEV@.I blocks-count | |
124 | @JDEV@] | |
3839e657 TT |
125 | .SH DESCRIPTION |
126 | .B mke2fs | |
f0865ce4 | 127 | is used to create an ext2/ext3 filesystem (usually in a disk partition). |
3839e657 | 128 | .I device |
caf8ce4c TT |
129 | is the special file corresponding to the device (e.g |
130 | .IR /dev/hdXX ). | |
3839e657 TT |
131 | .I blocks-count |
132 | is the number of blocks on the device. If omitted, | |
133 | .B mke2fs | |
0072f8de AD |
134 | automagically figures the file system size. If called as |
135 | .B mkfs.ext3 | |
136 | a journal is created as if the | |
137 | .B \-j | |
138 | option was specified. | |
3839e657 TT |
139 | .SH OPTIONS |
140 | .TP | |
caf8ce4c | 141 | .BI \-b " block-size" |
2740156b | 142 | Specify the size of blocks in bytes. Valid block size vales are 1024, |
06968e7e TT |
143 | 2048 and 4096 bytes per block. If omitted, |
144 | .B mke2fs | |
6750877c | 145 | block-size is heuristically determined by the file system size and |
c5290fae | 146 | the expected usage of the filesystem (see the |
06968e7e | 147 | .B \-T |
c5290fae TT |
148 | option). If |
149 | .I block-size | |
c6a44136 TT |
150 | is negative, then |
151 | .B mke2fs | |
152 | will use heuristics to determine the | |
c5290fae TT |
153 | appropriate block size, with the constraint that the block size will be |
154 | at least | |
155 | .I block-size | |
156 | bytes. This is useful for certain hardware devices which require that | |
157 | the blocksize be a multiple of 2k. | |
3839e657 | 158 | .TP |
caf8ce4c | 159 | .B \-c |
3ed57c27 | 160 | Check the device for bad blocks before creating the file system. If |
3a03c2ca | 161 | this option is specified twice, then a slower, read-write |
3ed57c27 | 162 | test is used instead of a fast read-only test. |
3839e657 | 163 | .TP |
c6a44136 TT |
164 | .BI \-E " extended-options" |
165 | Set extended options for the filesystem. Extended options are comma | |
166 | separated, and may take an argument using the equals ('=') sign. The | |
167 | .B -E | |
168 | option used to be | |
169 | .B -R | |
170 | in earlier versions of | |
171 | .BR mke2fs . | |
172 | The | |
173 | .B -R | |
174 | option is still accepted for backwards compatibility. The | |
175 | following extended options are supported: | |
176 | .RS 1.2i | |
177 | .TP | |
178 | .BI stride= stripe-size | |
179 | Configure the filesystem for a RAID array with | |
180 | .I stripe-size | |
181 | filesystem blocks per stripe. | |
182 | .TP | |
183 | .BI resize= max-online-resize | |
184 | Reserve enough space so that the block group descriptor table can grow | |
185 | to support a filesystem that has max-online-resize blocks. | |
186 | .RE | |
187 | .TP | |
caf8ce4c | 188 | .BI \-f " fragment-size" |
3839e657 TT |
189 | Specify the size of fragments in bytes. |
190 | .TP | |
48015ced TT |
191 | .B \-F |
192 | Force | |
193 | .B mke2fs | |
194 | to run, even if the specified device is not a | |
195 | block special device, or appears to be mounted. | |
196 | .TP | |
5e05541a TT |
197 | .BI \-g " blocks-per-group" |
198 | Specify the number of blocks in a block group. There is generally no | |
199 | reason the user to ever set this parameter, as the default is optimal | |
200 | for the filesystem. (For administrators who are creating | |
201 | filesystems on RAID arrays, it is preferable to use the | |
202 | .I stride | |
203 | RAID parameter as part of the | |
204 | .B \-R | |
205 | option rather than manipulating the number of blocks per group.) | |
206 | This option is generally used by developers who | |
207 | are developing test cases. | |
208 | .TP | |
caf8ce4c | 209 | .BI \-i " bytes-per-inode" |
3839e657 TT |
210 | Specify the bytes/inode ratio. |
211 | .B mke2fs | |
212 | creates an inode for every | |
213 | .I bytes-per-inode | |
48015ced | 214 | bytes of space on the disk. The larger the |
caf8ce4c | 215 | .I bytes-per-inode |
48015ced TT |
216 | ratio, the fewer inodes will be created. This value generally shouldn't |
217 | be smaller than the blocksize of the filesystem, since then too many | |
218 | inodes will be made. Be warned that is not possible to expand the number | |
219 | of inodes on a filesystem after it is created, so be careful deciding the | |
220 | correct value for this parameter. | |
dc2ec525 | 221 | .TP |
48015ced TT |
222 | .B \-j |
223 | Create the filesystem with an ext3 journal. If the | |
dc2ec525 | 224 | .B \-J |
48015ced TT |
225 | option is not specified, the default journal parameters will be used to |
226 | create an appropriately sized journal (given the size of the filesystem) | |
227 | stored within the filesystem. Note that you must be using a kernel | |
228 | which has ext3 support in order to actually make use of the journal. | |
dc2ec525 | 229 | .TP |
48015ced | 230 | .BI \-J " journal-options" |
dc2ec525 | 231 | Create the ext3 journal using options specified on the command-line. |
8ddaa66b TT |
232 | Journal options are comma |
233 | separated, and may take an argument using the equals ('=') sign. | |
48015ced TT |
234 | The following journal options are supported: |
235 | .RS 1.2i | |
dc2ec525 | 236 | .TP |
48015ced | 237 | .BI size= journal-size |
f0865ce4 | 238 | Create an internal journal (i.e., stored inside the filesystem) of size |
8d641749 TT |
239 | .I journal-size |
240 | megabytes. | |
2537b6d0 TT |
241 | The size of the journal must be at least 1024 filesystem blocks |
242 | (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) | |
8d641749 | 243 | and may be no more than 102,400 filesystem blocks. |
48015ced TT |
244 | @JDEV@.TP |
245 | @JDEV@.BI device= external-journal | |
8d641749 TT |
246 | @JDEV@Attach the filesystem to the journal block device located on |
247 | @JDEV@.IR external-journal . | |
248 | @JDEV@The external | |
249 | @JDEV@journal must already have been created using the command | |
250 | @JDEV@.IP | |
2d15576d AD |
251 | @JDEV@.B mke2fs -O journal_dev |
252 | @JDEV@.I external-journal | |
8d641749 TT |
253 | @JDEV@.IP |
254 | @JDEV@Note that | |
255 | @JDEV@.I external-journal | |
256 | @JDEV@must have been created with the | |
257 | @JDEV@same block size as the new filesystem. | |
2d15576d AD |
258 | @JDEV@.IP |
259 | @JDEV@Instead of specifying a device name directly, | |
260 | @JDEV@.I external-journal | |
261 | @JDEV@can also be specified by either | |
262 | @JDEV@.BI LABEL= label | |
263 | @JDEV@or | |
264 | @JDEV@.BI UUID= UUID | |
265 | @JDEV@to locate the external journal by either the volume label or UUID | |
266 | @JDEV@stored in the ext2 superblock at the start of the journal. Use | |
267 | @JDEV@.BR dumpe2fs (8) | |
268 | @JDEV@to display a journal device's volume label and UUID. See also the | |
269 | @JDEV@.B -L | |
270 | @JDEV@option of | |
271 | @JDEV@.BR tune2fs (8). | |
8d641749 TT |
272 | .RE |
273 | @JDEV@.IP | |
48015ced TT |
274 | @JDEV@Only one of the |
275 | @JDEV@.BR size " or " device | |
276 | @JDEV@options can be given for a filesystem. | |
48015ced TT |
277 | .TP |
278 | .BI \-l " filename" | |
279 | Read the bad blocks list from | |
3ed57c27 TT |
280 | .IR filename . |
281 | Note that the block numbers in the bad block list must be generated | |
282 | using the same block size as used by mke2fs. As a result, the | |
283 | .B \-c | |
284 | option to | |
285 | .B mke2fs | |
286 | is a much simpler and less error-prone method of checking a disk for bad | |
287 | blocks before formatting it, as | |
288 | .B mke2fs | |
289 | will automatically pass the correct parameters to the | |
290 | .B badblocks | |
291 | program. | |
48015ced | 292 | .TP |
6a7075df TT |
293 | .BI \-L " new-volume-label" |
294 | Set the volume label for the filesystem to | |
295 | .IR new-volume-label . | |
296 | The maximum length of the | |
297 | volume label is 16 bytes. | |
48015ced TT |
298 | .TP |
299 | .BI \-m " reserved-blocks-percentage" | |
300 | Specify the percentage of the filesystem blocks reserved for | |
029de632 TT |
301 | the super-user. This avoids fragmentation, and allows root-owned |
302 | daemons, such as | |
303 | .BR syslogd (8), | |
304 | to continue to function correctly after non-privileged processes are | |
305 | prevented from writing to the filesystem. The default percentage | |
306 | is 5%. | |
dc2ec525 | 307 | .TP |
48015ced TT |
308 | .B \-M |
309 | Set the last mounted directory for the filesystem. This might be useful | |
310 | for the sake of utilities that key off of the last mounted directory to | |
bcf5aea2 | 311 | determine where the filesystem should be mounted. |
85ef4ae8 | 312 | .TP |
caf8ce4c | 313 | .B \-n |
1f22ce34 TT |
314 | causes mke2fs to not actually create a filesystem, but display what it |
315 | would do if it were to create a filesystem. This can be used to | |
316 | determine the location of the backup superblocks for a particular | |
317 | filesystem, so long as the mke2fs parameters that were passed when the | |
318 | filesystem was originally created are used again. (With the | |
319 | .B \-n | |
320 | option added, of course!) | |
2740156b | 321 | .TP |
caf8ce4c | 322 | .BI \-N " number-of-inodes" |
5515e6b4 TT |
323 | overrides the default calculation of the number of inodes that should be |
324 | reserved for the filesystem (which is based on the number of blocks and | |
caf8ce4c TT |
325 | the |
326 | .I bytes-per-inode | |
327 | ratio). This allows the user to specify the number | |
5515e6b4 TT |
328 | of desired inodes directly. |
329 | .TP | |
48015ced | 330 | .BI \-o " creator-os" |
1e3472c5 TT |
331 | Manually override the default value of the "creator os" field of the |
332 | filesystem. Normally the creator field is set by default to the native OS | |
583ccdc3 TT |
333 | of the |
334 | .B mke2fs | |
335 | executable. | |
1e3472c5 | 336 | .TP |
8d641749 | 337 | .B "\-O \fIfeature\fR[,...]" |
e02bb6d6 | 338 | Create filesystem with given features (filesystem options), overriding |
481d1396 | 339 | the default filesystem options. |
48015ced TT |
340 | Currently, the |
341 | .B sparse_super | |
342 | and | |
343 | .B filetype | |
f0865ce4 | 344 | features are turned on by default when |
583ccdc3 | 345 | .B mke2fs |
f0865ce4 TT |
346 | is run on a system with Linux 2.2 or later (unless creator-os is set to |
347 | the Hurd). Filesystems that may need to be mounted on pre-2.2 Linux or | |
348 | other kernels should be created with | |
48015ced TT |
349 | .B "\-O none" |
350 | (or | |
351 | .B "\-r 0" | |
f0865ce4 | 352 | for Linux 1.2) which will disable these features, even if |
48015ced TT |
353 | .B mke2fs |
354 | is run on a system which can support them. | |
355 | .sp | |
356 | The following filesystem options are supported: | |
357 | .RS 1.2i | |
7f88b043 | 358 | .TP |
ccbed85a TT |
359 | .B dir_index |
360 | Use hashed b-trees to speed up lookups in large directories. | |
f3db3566 | 361 | .TP |
48015ced TT |
362 | .B filetype |
363 | Store file type information in directory entries. | |
1e3472c5 | 364 | .TP |
48015ced TT |
365 | .B has_journal |
366 | Create an ext3 journal (as if using the | |
367 | .B \-j | |
368 | option). | |
369 | @JDEV@.TP | |
8d641749 | 370 | @JDEV@.B journal_dev |
48015ced | 371 | @JDEV@Create an external ext3 journal on the given device |
8d641749 TT |
372 | @JDEV@instead of a regular ext2 filesystem. |
373 | @JDEV@Note that | |
374 | @JDEV@.I external-journal | |
375 | @JDEV@must be created with the same | |
376 | @JDEV@block size as the filesystems that will be using it. | |
ccbed85a | 377 | .TP |
59571a51 TT |
378 | .B resize_inode |
379 | Reserve space so the block group descriptor table may grow in the future. | |
380 | Useful for online resizing using | |
381 | .BR resize2fs . | |
382 | By default | |
383 | .B mke2fs | |
384 | will attempt to reserve enough space so that the | |
385 | filesystem may grow to 1024 times its initial size. This can be changed | |
386 | using | |
387 | .B resize | |
388 | extended option. | |
389 | .TP | |
ccbed85a TT |
390 | .B sparse_super |
391 | Create a filesystem with fewer superblock backup copies | |
392 | (saves space on large filesystems). | |
48015ced | 393 | .RE |
1e3472c5 | 394 | .TP |
8d641749 TT |
395 | .B \-q |
396 | Quiet execution. Useful if | |
397 | .B mke2fs | |
398 | is run in a script. | |
399 | .TP | |
48015ced | 400 | .BI \-r " revision" |
a29f4d30 | 401 | Set the filesystem revision for the new filesystem. Note that 1.2 |
48015ced TT |
402 | kernels only support revision 0 filesystems. The default is to |
403 | create revision 1 filesystems. | |
a29f4d30 | 404 | .TP |
caf8ce4c | 405 | .B \-S |
f3db3566 TT |
406 | Write superblock and group descriptors only. This is useful if all of |
407 | the superblock and backup superblocks are corrupted, and a last-ditch | |
583ccdc3 TT |
408 | recovery method is desired. It causes |
409 | .B mke2fs | |
410 | to reinitialize the | |
f3db3566 TT |
411 | superblock and group descriptors, while not touching the inode table |
412 | and the block and inode bitmaps. The | |
413 | .B e2fsck | |
414 | program should be run immediately after this option is used, and there | |
48015ced TT |
415 | is no guarantee that any data will be salvageable. It is critical to |
416 | specify the correct filesystem blocksize when using this option, | |
417 | or there is no chance of recovery. | |
8d641749 TT |
418 | .\" .TP |
419 | .\" .BI \-t " test" | |
420 | .\" Check the device for bad blocks before creating the file system | |
421 | .\" using the specified test. | |
818180cd | 422 | .TP |
caf8ce4c | 423 | .BI \-T " fs-type" |
fb733f8e TT |
424 | Specify how the filesystem is going to be used, so that |
425 | .B mke2fs | |
426 | can choose optimal filesystem parameters for that use. Currently, the | |
427 | primary filesystem parameter which is manipulated is the number of | |
428 | inodes contained the filesystem, but in the future other filesystem | |
429 | parameters may also changed for specific filesystem usage scenarios. If | |
430 | no filesystem type is specified, filesystem meant for general purpose | |
431 | use will be created, with default values for the blocksize, number of | |
432 | inodes, etc. based on the size of the filesystem to be created. The | |
433 | supported filesystem types are: | |
48015ced TT |
434 | .RS 1.2i |
435 | .TP 1.2i | |
436 | news | |
437 | one inode per 4kb block | |
438 | .TP | |
439 | largefile | |
440 | one inode per megabyte | |
441 | .TP | |
442 | largefile4 | |
443 | one inode per 4 megabytes | |
444 | .RE | |
445 | .TP | |
446 | .B \-v | |
447 | Verbose execution. | |
50787ea2 | 448 | .TP |
caf8ce4c | 449 | .B \-V |
50787ea2 | 450 | Print the version number of |
818180cd TT |
451 | .B mke2fs |
452 | and exit. | |
3839e657 TT |
453 | .SH AUTHOR |
454 | This version of | |
455 | .B mke2fs | |
a418d3ad | 456 | has been written by Theodore Ts'o <tytso@mit.edu>. |
3839e657 TT |
457 | .SH BUGS |
458 | .B mke2fs | |
caf8ce4c TT |
459 | accepts the |
460 | .B \-f | |
461 | option but currently ignores it because the second | |
3839e657 TT |
462 | extended file system does not support fragments yet. |
463 | .br | |
48015ced | 464 | There may be other ones. Please, report them to the author. |
3839e657 TT |
465 | .SH AVAILABILITY |
466 | .B mke2fs | |
12da49c9 | 467 | is part of the e2fsprogs package and is available from |
348e43dc | 468 | http://e2fsprogs.sourceforge.net. |
3839e657 | 469 | .SH SEE ALSO |
e72a9ba3 | 470 | .BR badblocks (8), |
3839e657 TT |
471 | .BR dumpe2fs (8), |
472 | .BR e2fsck (8), | |
473 | .BR tune2fs (8) |