Linux mkfs Command

Linux 命令大全Complete Linux Commands

The Linux mkfs (full English name: 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, e.g.: /dev/sda1
  • -V : verbose display mode
  • -t : specify the type of file system; the Linux default value is ext2
  • -c : check whether the partition has bad blocks before creating the file system
  • -l bad_blocks_file : add the bad block data to the bad_blocks_file
  • block : specify the size of the block

Examples

Create an msdos file system on /dev/hda5, check whether there are bad blocks, and list the process in detail:

mkfs -V -t msdos -c /dev/hda5

Format the sda6 partition as ext3 format

mkfs -t ext3 /dev/sda6  

Note: The file system here must be specified, such as ext3; reiserfs; ext2; fat32; msdos, etc.

Linux 命令大全Complete Linux Commands

Other Extensions