Linux

mkfs

DestructiveCreate a filesystem

mkfs.ext4 <device>

Formats a partition, wiping all data. Confirm the device with lsblk before running.

Examples

  • mkfs.xfs /dev/sdb1Format as XFS

Syntax

mkfs.<type> [options] <device>

Before you run it

Erases everything on the device.

Related commands

Check it once more before you run it

Some commands cannot be undone if one flag is wrong. An on-device reference works with no connection. Free to install, no ads.

Get it free on the App Store