Disk and Storage

mkfs

Creates a filesystem on a device.

mkfs formats a partition or block device with a filesystem such as ext4, xfs, or btrfs.

Syntax
mkfs -t type device

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Create ext4 filesystem
sudo mkfs -t ext4 /dev/sdb1

Formats /dev/sdb1 as ext4.

Use specific helper
sudo mkfs.ext4 /dev/sdb1

Calls the ext4 mkfs helper directly.

mkfs Command
FieldDetails
Commandmkfs
CategoryDisk and Storage
Primary useCreates a filesystem on a device.
Syntaxmkfs -t type device