English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux mkfs Command

Linux Command大全

The Linux mkfs command (full English name: make file system) is used to create a Linux file system on a specific partition.

Usage :

mkfs [-V] [-t fstype] [fs-options] filesys [blocks]

Parameters :

  • device: The partition to be prepared for checking, for example:/dev/sda1
  • -V: Detailed display mode
  • -t: Specify the type of the file system, the default value for Linux is ext2
  • -c: Check if the partition has bad tracks before creating the file system
  • -l bad_blocks_file: Add the block information with bad tracks to the bad_blocks_file
  • block: The size of the given block

Online Examples

In /dev/hda5 Create a msdos file system, check for bad tracks, and list the process in detail:

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

Format sda6Partition formatted as ext3Format

mfks -t ext3 /dev/sda6  

Note:The file system to be specified, for example, ext3 ;reiserfs;ext2 ;fat32 ;msdos and others.

Linux Command大全