首页
首页 » 磁盘维护 » mke2fs(make ext2 file system)

mke2fs(make ext2 file system)

mke2fs(make ext2 file system)
功能说明:建立ext2文件系统。
语  法:mke2fs [-cFMqrSvV][-b <区块大小>][-f <不连续区段大小>][-i <字节>][-N <inode数>][-l <文件>][-L <标签>][-m <百分比值>][-R=<区块数>][ 设备名称][区块数]
补充说明:mke2fs可建立Linux的ext2文件系统。
参  数:
  -b<区块大小>   指定区块大小,单位为字节。
  -c   检查是否有损坏的区块。
  -f<不连续区段大小>   指定不连续区段的大小,单位为字节。
  -F   不管指定的设备为何,强制执行mke2fs。
  -i<字节>   指定"字节/inode"的比例。
  -N<inode数>   指定要建立的inode数目。
  -l<文件>   从指定的文件中,读取文件西中损坏区块的信息。
  -L<标签>   设置文件系统的标签名称。
  -m<百分比值>   指定给管理员保留区块的比例,预设为5%。
  -M   记录最后一次挂入的目录。
  -q   执行时不显示任何信息。
  -r   指定要建立的ext2文件系统版本。
  -R=<区块数>   设置磁盘阵列参数。
  -S   仅写入superblock与group descriptors,而不更改inode able inode bitmap以及block bitmap。
  -v   执行时显示详细信息。
  -V   显示版本信息。

mke2fs

mke2fs [options] device [blocks] mkfs.ext2 [options] device [blocks]

System administration command. Format device as a Linux Second Extended Filesystem. You may specify the number of blocks on the device or allow mke2fs to guess.

Options

-b block-size

Specify block size in bytes.

-c

Scan device for bad blocks before execution.

-E featurelist

Specify extended features. This option's parameters may be given in a comma-separated list:

stride=size

Configure filesystem for a RAID array. Set stride size to size blocks per stripe.

resize=blocks

Reserve descriptor table space to grow filesystem to the specified number of blocks.

-f fragment-size

Specify fragment size in bytes.

-F

Force mke2fs to run even if filesystem is mounted or device is not a block special device. This option is probably best avoided.

-i bytes-per-inode

Create an inode for each bytes-per-inode of space. bytes-per-inode must be 1024 or greater; it is 4096 by default.

-j

Create an ext3 journal. This is the same as invoking mkfs.ext3.

-J parameterlist

Use specified parameterlist to create an ext3 journal. The following two parameters may be given in a comma-separated list:

size=journal-size

Create a journal of journal-size megabytes. The size may be between 1024 filesystem blocks and 102,400 filesystem blocks in size (e.g., 1-100 megabytes if using 1K blocks, 4-400 megabytes if using 4K blocks).

device=journal-device

Use an external journal-device to hold the filesystem journal. The journal-device can be specified by name, by volume label, or by UUID.

-l filename

Consult filename for a list of bad blocks.

-L label

Set volume label for filesystem.

-m percentage

Reserve percentage percent of the blocks for use by privileged users.

-M directory

Set the last mounted directory for filesystem to directory.

-n

Don't create the filesystem; just show what would happen if it were run. This option is overridden by -F.

-N inodes

Specify number of inodes to reserve for filesystem. By default, this number is calculated from the number of blocks and the inode size.

-o os

Set filesystem operating system type to os. The default value is usually Linux.

-O featurelist

Use specified featurelist to create filesystem. The sparse_super and filetype features are used by default on kernels 2.2 and later. The following parameters may be given in a comma-separated list:

dir_index

Use hashed B-trees to index directories.

filetype

Store file type information in directory entries.

has_journal

Create an ext3 journal. Same as using the -j option.

journal_dev

Prepare an external journaling device by creating an ext3 journal on device instead of formatting it.

sparse_super

Save space on a large filesystem by creating fewer superblock backup copies.

-q

Quiet mode.

-r revision

Set filesystem revision number to revision.

-S

Write only superblock and group descriptors; suppress writing of inode table and block and inode bitmaps. Useful only when attempting to salvage damaged systems.

-T use

Set bytes-per-inode based on the intended use of the filesystem. Supported filesystem types are:

news

Four kilobytes per inode.

largefile

One megabyte per inode.

largefile4

Four megabytes per inode.

-v

Verbose mode.

-V

Print version number, then exit.