Linux mkfs command
The Linux mkfs (short for make file system) command is used to create a Linux file system on a specific partition.
**Usage**:
mkfs [-V] [-t fstype] [fs-options] filesys [blocks]
**Parameters **:
- device: the hard disk partition to be checked, for example: /dev/sda1
- -V: verbose display mode
- -t: specify the type of file system; the default value on Linux is ext2
- -c: check the partition for bad sectors before creating the file system
- -l bad_blocks_file : add data about blocks with bad sectors to bad_blocks_file
- block: specify the size of the block
Example
Create an msdos file system on /dev/hda5, check for bad sectors at the same time, and list the process in detail:
mkfs -V -t msdos -c /dev/hda5
Format the sda6 partition to ext3 format
mkfs -t ext3 /dev/sda6
Note: The file system here needs to be specified, such as ext3, reiserfs, ext2, fat32, msdos, etc.
Linux Command Reference