Section: Maintenance Commands (8)
Updated: August 2014
mke2fs [ -c | -l filename ] [ -b block-size ] [ -D ] [ -f fragment-size ] [ -g blocks-per-group ] [ -G number-of-groups ] [ -i bytes-per-inode ] [ -I inode-size ] [ -j ] [ -J journal-options ] [ -N number-of-inodes ] [ -n ] [ -m reserved-blocks-percentage ] [ -o creator-os ] [ -O [^]feature[,...] ] [ -q ] [ -r fs-revision-level ] [ -E extended-options ] [ -v ] [ -F ] [ -L volume-label ] [ -M last-mounted-directory ] [ -S ] [ -t fs-type ] [ -T usage-type ] [ -U UUID ] [ -V ] device [ fs-size ]
mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition (or file) named by device.
The file system size is specified by fs-size. If fs-size does not have a suffix, it is interpreted as power-of-two kilobytes, unless the -b blocksize option is specified, in which case fs-size is interpreted as the number of blocksize blocks. If the fs-size is suffixed by 'k', 'm', 'g', 't' (either upper-case or lower-case), then it is interpreted in power-of-two kilobytes, megabytes, gigabytes, terabytes, etc. If fs-size is omitted, mke2fs will create the file system based on the device size.
If mke2fs is run as mkfs.XXX (i.e., mkfs.ext2, mkfs.ext3, or mkfs.ext4) the option -t XXX is implied; so mkfs.ext3 will create a file system for use with ext3, mkfs.ext4 will create a file system for use with ext4, and so on.
The defaults of the parameters for the newly created filesystem, if not overridden by the options listed below, are controlled by the /etc/mke2fs.conf configuration file. See the (5) manual page for more details.
The filesystem feature set will be further edited using either the feature set specified by this option, or if this option is not given, by the default_features relation for the filesystem type being created, or in the [defaults] section of the configuration file.
The filesystem feature set is comprised of a list of features, separated by commas, that are to be enabled. To disable a feature, simply prefix the feature name with a caret ('^') character. Features with dependencies will not be removed successfully. The pseudo-filesystem feature "none" will clear all filesystem features.
If the -O option is used to explicitly add or remove filesystem options that should be set in the newly created filesystem, the resulting filesystem may not be supported by the requested fs-type. (e.g., "mke2fs -t ext3 -O extent /dev/sdXX" will create a filesystem that is not supported by the ext3 implementation as found in the Linux kernel; and "mke2fs -t ext3 -O ^has_journal /dev/hdXX" will create a filesystem that does not have a journal and hence will not be supported by the ext3 filesystem code in the Linux kernel.)
If this option is is not specified, mke2fs will pick a single default usage type based on the size of the filesystem to be created. If the filesystem size is less than or equal to 3 megabytes, mke2fs will use the filesystem type floppy. If the filesystem size is greater than 3 but less than or equal to 512 megabytes, mke2fs?(8) will use the filesystem type small. If the filesystem size is greater than or equal to 4 terabytes but less than 16 terabytes, mke2fs?(8) will use the filesystem type big. If the filesystem size is greater than or equal to 16 terabytes, mke2fs?(8) will use the filesystem type huge. Otherwise, mke2fs?(8) will use the default filesystem type default.
This version of mke2fs has been written by Theodore Ts'o <[email protected]>.
mke2fs accepts the -f option but currently ignores it because the second extended file system does not support fragments yet.
mke2fs is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net.
Tutoriais de Tecnologia Web