oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


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.


-b block-size

Specify block size in bytes.


Scan device for bad blocks before execution.

-E featurelist

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


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


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

-f fragment-size

Specify fragment size in bytes.


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.


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:


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).


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.


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:


Use hashed B-trees to index directories.


Store file type information in directory entries.


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


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


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


Quiet mode.

-r revision

Set filesystem revision number to revision.


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:


Four kilobytes per inode.


One megabyte per inode.


Four megabytes per inode.


Verbose mode.


Print version number, then exit.

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: