Mkfs - Syntax

Syntax

The basic syntax of the command, which is common to all modern implementations, is:

$ mkfs -t

where 'fs type' is the type of the filesystem and 'device' is the target UNIX device to write the filesystem data to. Usually the "device" is a drive partition. Often the command is simply a wrapper for another command that performs the formatting for a specific file system. For example,

$ mkfs -t ext3 /dev/sda1

would call the command mke2fs while passing along the appropriate arguments to format the device /dev/sda1 with the ext3 filesystem. The default options for the command are stored in the file mke2fs.conf, usually in the /etc directory. Depending on the implementation and the specific file system requested, the command may have many options that can be specified such as inode size, block size, volume label, and other features. (See file system for details)

The filesystem-specific commands that mkfs calls may be invoked directly by the user from the command line. In Linux, the convention has been to name the filesystem-specific commands as: mkfs.. Where is an abbreviation for the file system, e.g., mkfs.ext2, mkfs.msdos, mkfs.minix, etc. File systems supported by the command vary by implementation and include: MSDOS, SCO bfs, CPM, ext2, ext3, ext4, minix, fat (vfat), HFS, VXFS, RF disk, RK disk, DECtape, and NTFS.

Read more about this topic:  Mkfs