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.
5 .TH MKE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
7 mke2fs \- create an ext2/ext3 filesystem
56 .I reserved-blocks-percentage
89 .I last-mounted-directory
110 @JDEV@.B "mke2fs \-O journal_dev"
115 .\" No external-journal specific journal options yet (size is ignored)
118 .\" @JDEV@.I journal-options
122 @JDEV@.I volume-label
133 @JDEV@.I external-journal
135 @JDEV@.I blocks-count
139 is used to create an ext2/ext3 filesystem (usually in a disk partition).
141 is the special file corresponding to the device (e.g
144 is the number of blocks on the device. If omitted,
146 automagically figures the file system size. If called as
148 a journal is created as if the
150 option was specified.
153 .BI \-b " block-size"
154 Specify the size of blocks in bytes. Valid block size vales are 1024,
155 2048 and 4096 bytes per block. If omitted,
157 block-size is heuristically determined by the file system size and
158 the expected usage of the filesystem (see the
164 will use heuristics to determine the
165 appropriate block size, with the constraint that the block size will be
168 bytes. This is useful for certain hardware devices which require that
169 the blocksize be a multiple of 2k.
172 Check the device for bad blocks before creating the file system. If
173 this option is specified twice, then a slower, read-write
174 test is used instead of a fast read-only test.
176 .BI \-E " extended-options"
177 Set extended options for the filesystem. Extended options are comma
178 separated, and may take an argument using the equals ('=') sign. The
182 in earlier versions of
186 option is still accepted for backwards compatibility. The
187 following extended options are supported:
190 .BI stride= stride-size
191 Configure the filesystem for a RAID array with
193 filesystem blocks. This is the number of blocks read or written to disk
194 before moving to next disk. This mostly affects placement of filesystem
195 metadata like bitmaps at
197 time to avoid placing them on a single disk, which can hurt the performanace.
198 It may also be used by block allocator.
200 .BI stripe-width= stripe-width
201 Configure the filesystem for a RAID array with
203 filesystem blocks per stripe. This is typically be stride-size * N, where
204 N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
205 This allows the block allocator to prevent read-modify-write of the
206 parity in a RAID stripe if possible when the data is written.
208 .BI resize= max-online-resize
209 Reserve enough space so that the block group descriptor table can grow
210 to support a filesystem that has max-online-resize blocks.
212 .B lazy_itable_init= \fI<0 to disable, 1 to enable>
213 If enabled and the uninit_bg feature is enabled, the inode table will
214 not fully initialized by
216 This speeds up filesystem
217 initialization noitceably, but it requires the kernel to finish
218 initializing the filesystem in the background when the filesystem is
222 Set a flag in the filesystem superblock indicating that it may be
223 mounted using experimental kernel code, such as the ext4dev filesystem.
226 .BI \-f " fragment-size"
227 Specify the size of fragments in bytes.
232 to create a filesystem, even if the specified device is not a partition
233 on a block special device, or if other parameters do not make sense.
236 to create a filesystem even if the filesystem appears to be in use
237 or is mounted (a truly dangerous thing to do), this option must be
240 .BI \-g " blocks-per-group"
241 Specify the number of blocks in a block group. There is generally no
242 reason the user to ever set this parameter, as the default is optimal
243 for the filesystem. (For administrators who are creating
244 filesystems on RAID arrays, it is preferable to use the
246 RAID parameter as part of the
248 option rather than manipulating the number of blocks per group.)
249 This option is generally used by developers who
250 are developing test cases.
252 .BI \-G " number-of-groups"
253 Specify the number of block goups that will be packed together to
254 create one large virtual block group on an ext4 filesystem. This
255 improves meta-data locality and performance on meta-data heavy
256 workloads. The number of goups must be a power of 2 and may only be
257 specified if the flex_bg filesystem feature is enabled.
259 .BI \-i " bytes-per-inode"
260 Specify the bytes/inode ratio.
262 creates an inode for every
264 bytes of space on the disk. The larger the
266 ratio, the fewer inodes will be created. This value generally shouldn't
267 be smaller than the blocksize of the filesystem, since then too many
268 inodes will be made. Be warned that is not possible to expand the number
269 of inodes on a filesystem after it is created, so be careful deciding the
270 correct value for this parameter.
272 .BI \-I " inode-size"
273 Specify the size of each inode in bytes.
275 creates 256-byte inodes by default. In kernels after 2.6.10 and some
276 earlier vendor kernels it is possible to utilize inodes larger than
278 extended attributes for improved performance. The
280 value must be a power of two larger or equal to 128. The larger the
282 the more space the inode table will consume, and this reduces the usable
283 space in the filesystem and can also negatively impact performance.
285 stored in large inodes are not visible with older kernels, and such
286 filesystems will not be mountable with 2.4 kernels at all. It is not
287 possible to change this value after the filesystem is created.
290 Create the filesystem with an ext3 journal. If the
292 option is not specified, the default journal parameters will be used to
293 create an appropriately sized journal (given the size of the filesystem)
294 stored within the filesystem. Note that you must be using a kernel
295 which has ext3 support in order to actually make use of the journal.
297 .BI \-J " journal-options"
298 Create the ext3 journal using options specified on the command-line.
299 Journal options are comma
300 separated, and may take an argument using the equals ('=') sign.
301 The following journal options are supported:
304 .BI size= journal-size
305 Create an internal journal (i.e., stored inside the filesystem) of size
308 The size of the journal must be at least 1024 filesystem blocks
309 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
310 and may be no more than 102,400 filesystem blocks.
312 @JDEV@.BI device= external-journal
313 @JDEV@Attach the filesystem to the journal block device located on
314 @JDEV@.IR external-journal .
316 @JDEV@journal must already have been created using the command
318 @JDEV@.B mke2fs -O journal_dev
319 @JDEV@.I external-journal
322 @JDEV@.I external-journal
323 @JDEV@must have been created with the
324 @JDEV@same block size as the new filesystem.
325 @JDEV@In addition, while there is support for attaching
326 @JDEV@multiple filesystems to a single external journal,
327 @JDEV@the Linux kernel and
329 @JDEV@do not currently support shared external journals yet.
331 @JDEV@Instead of specifying a device name directly,
332 @JDEV@.I external-journal
333 @JDEV@can also be specified by either
334 @JDEV@.BI LABEL= label
337 @JDEV@to locate the external journal by either the volume label or UUID
338 @JDEV@stored in the ext2 superblock at the start of the journal. Use
339 @JDEV@.BR dumpe2fs (8)
340 @JDEV@to display a journal device's volume label and UUID. See also the
343 @JDEV@.BR tune2fs (8).
346 @JDEV@Only one of the
347 @JDEV@.BR size " or " device
348 @JDEV@options can be given for a filesystem.
351 Read the bad blocks list from
353 Note that the block numbers in the bad block list must be generated
354 using the same block size as used by mke2fs. As a result, the
358 is a much simpler and less error-prone method of checking a disk for bad
359 blocks before formatting it, as
361 will automatically pass the correct parameters to the
365 .BI \-L " new-volume-label"
366 Set the volume label for the filesystem to
367 .IR new-volume-label .
368 The maximum length of the
369 volume label is 16 bytes.
371 .BI \-m " reserved-blocks-percentage"
372 Specify the percentage of the filesystem blocks reserved for
373 the super-user. This avoids fragmentation, and allows root-owned
376 to continue to function correctly after non-privileged processes are
377 prevented from writing to the filesystem. The default percentage
381 Set the last mounted directory for the filesystem. This might be useful
382 for the sake of utilities that key off of the last mounted directory to
383 determine where the filesystem should be mounted.
386 causes mke2fs to not actually create a filesystem, but display what it
387 would do if it were to create a filesystem. This can be used to
388 determine the location of the backup superblocks for a particular
389 filesystem, so long as the mke2fs parameters that were passed when the
390 filesystem was originally created are used again. (With the
392 option added, of course!)
394 .BI \-N " number-of-inodes"
395 overrides the default calculation of the number of inodes that should be
396 reserved for the filesystem (which is based on the number of blocks and
399 ratio). This allows the user to specify the number
400 of desired inodes directly.
402 .BI \-o " creator-os"
403 Manually override the default value of the "creator os" field of the
404 filesystem. Normally the creator field is set by default to the native OS
409 .B "\-O \fIfeature\fR[,...]"
410 Create filesystem with given features (filesystem options), overriding
411 the default filesystem options. The default features which are
412 enabled by default are specified by the
414 relation, either in the
419 or in the subsection of the
421 section for the usage types as specified by the
423 option, further modified by the
425 relation found in the
426 .I [fs_types] section
427 based on the filesystem and usage types. See the
429 manual page for more details.
430 The filesystem type-specific configuration setting found in the
432 section will override the global default found in
435 The filesystem feature set will be further edited
436 using either the feature set specification specified by this option,
437 or if this option is not specified, by the
439 relation for the filesystem type being created, or in the
441 section of the configuration file.
443 The filesystem feature set is comprised of a list of features, separated
444 by commas, that are to be enabled. To disable a feature, simply
445 prefix the feature name with a caret ('^') character. The
446 pseudo-filesystem feature "none" will clear all filesystem features.
450 Filesystem can contain files that are greater than 2GB. (Modern kernels
451 set this feature automatically when a file > 2GB is created.)
454 Use hashed b-trees to speed up lookups in large directories.
457 Store file type information in directory entries.
460 Allow bitmaps and inode tables for a block group to be placed anywhere
461 on the storage media (use with -G option to group meta-data in order
462 to create a large virtual block group).
465 Create an ext3 journal (as if using the
470 @JDEV@Create an external ext3 journal on the given device
471 @JDEV@instead of a regular ext2 filesystem.
473 @JDEV@.I external-journal
474 @JDEV@must be created with the same
475 @JDEV@block size as the filesystems that will be using it.
478 Instead of using the indirect block scheme for storing the location of
479 data blocks in an inode, use extents instead. This is a much more
480 efficient encoding which speeds up filesystem access, especially for
484 Create a filesystem without initializing all of the block groups. This
485 feature also enables checksums and highest-inode-used statistics in each
486 blockgroup. This feature can
487 speed up filesystem creation time noticably (if lazy_itable_init is
488 enabled), and can also reduce
490 dramatically. It is only supported by the ext4 filesystem in
491 recent Linux kernels.
494 Reserve space so the block group descriptor table may grow in the future.
495 Useful for online resizing using
499 will attempt to reserve enough space so that the
500 filesystem may grow to 1024 times its initial size. This can be changed
506 Create a filesystem with fewer superblock backup copies
507 (saves space on large filesystems).
511 Quiet execution. Useful if
516 Set the filesystem revision for the new filesystem. Note that 1.2
517 kernels only support revision 0 filesystems. The default is to
518 create revision 1 filesystems.
521 Write superblock and group descriptors only. This is useful if all of
522 the superblock and backup superblocks are corrupted, and a last-ditch
523 recovery method is desired. It causes
526 superblock and group descriptors, while not touching the inode table
527 and the block and inode bitmaps. The
529 program should be run immediately after this option is used, and there
530 is no guarantee that any data will be salvageable. It is critical to
531 specify the correct filesystem blocksize when using this option,
532 or there is no chance of recovery.
535 .\" Check the device for bad blocks before creating the file system
536 .\" using the specified test.
540 Specify the filesystem (i.e., ext2, ext3, ext4, etc., is to be created.
541 If this option is not specified mke2fs will pick a default either how
542 the command was run (if it was run using a name of the form mkfs.ext2,
543 mkfs.ext3, etc.) or via a default as defined by the
544 .BR /etc/mke2fs.conf (5)
547 .BI \-T " usage-type[,...]"
548 Specify how the filesystem is going to be used, so that
550 can choose optimal filesystem parameters for that use. The usage
551 types that are supported are defined in the configuration file
552 .BR /etc/mke2fs.conf (5).
553 The user may specify one or more usage types
554 using a comma separated list.
556 If this option is is not specified,
558 will pick a single default usage type based on the size of the filesystem to
559 be created. If the filesystem size is less than or equal to 3 megabytes,
561 will use the filesystem type
563 If the filesystem size is greater than 3 but less than or equal to
566 will use the filesystem
570 will use the default filesystem type
577 Print the version number of
583 has been written by Theodore Ts'o <tytso@mit.edu>.
588 option but currently ignores it because the second
589 extended file system does not support fragments yet.
591 There may be other ones. Please, report them to the author.
594 is part of the e2fsprogs package and is available from
595 http://e2fsprogs.sourceforge.net.