how to use mkfs command with its examples

  • About mkfs: To build a Linux file system
  • It comes from “util-linux-ng-2.17.2” package.
  • Configuration Files:
  • Path: /sbin/mkfs


1. To make the file system

$ mkfs /dev/sda2

2. To produce the verbose output

$ mkfs -V /dev/sda2

3. To specify the file system type

$ mkfs -t fstype /dev/sda2

4. To file system-specific options to be passed to the real file system builder

$ mkfs fs-options

 5. To check the device for bad blocks before building the file system.

$ mkfs -c

6. To read the bad blocks list from filename

$ mkfs -l filename

7. To produce the verbose output

$ mkfs -v /dev/sda2

Related Commands: fs, badblocks, fsck, mkdosfs, mke2fs, mkfs.bfs, mkfs.ext2, mkfs.ext3, mkfs.minix, mkfs.msdos, mkfs.vfat, mkfs.xfs, mkfs.xiafs 

Leave a Reply

Your email address will not be published. Required fields are marked *