Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

mkfs

Create a filesystem on a device

Syntax

mkfs [OPTION]... [-t TYPE] DEVICE [SIZE]

Common Options

-tSpecify filesystem type
-cCheck for bad blocks
-LSet volume label
-nDry run
-vVerbose output
-VVery verbose output

Common Examples

mkfs -t ext4 /dev/sdb1

Create ext4 filesystem

mkfs -t xfs /dev/sdc1

Create XFS filesystem

mkfs -L data /dev/sdb1

Create filesystem with label

mkfs.ext4 /dev/sdb1

Create with type shortcut

Related Commands

Related Tools

More Code & Dev Tools