← All commands
Topic hub System & Storage
Windows Linux System & Storage Disk & Storage

Windows format equivalent in Linux

Creates a new filesystem on a disk partition, erasing all existing data.

Windows format
Linux equivalents
Debian/Ubuntu same command
mkfs.ext4
Fedora same command
mkfs.ext4
Arch same command
mkfs.ext4

Overview

What this command does

Creates a new filesystem on a disk partition, erasing all existing data.

Migration tip: Linux supports many filesystem types. ext4 is the most common for Linux drives. Use vfat or exfat if you need the drive to work on Windows too.

Practical tasks

Common use cases

Format a disk/partition

Creates a new filesystem on a disk partition, erasing all existing data.

mkfs.ext4

Format as ext4 (standard Linux)

mkfs.vfat

Format as FAT32 (Windows compatible)

mkfs.exfat

Format as exFAT (cross-platform, large files)

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

lsblk
mkfs.ext4 /dev/sdb1
mkfs.vfat -F 32 /dev/sdb1

Walkthrough

Examples with explanations

# Windows: format D: /fs:NTFS /q

# First identify your drive safely:
lsblk                        # list all drives and partitions

# Format (REPLACES ALL DATA on that device!):
mkfs.ext4 /dev/sdb1        # Linux-native format
mkfs.vfat -F 32 /dev/sdb1 # FAT32 for USB sticks

Reference

Common options and variations

Command or optionUse
mkfs.ext4Format as ext4 (standard Linux)
mkfs.vfatFormat as FAT32 (Windows compatible)
mkfs.exfatFormat as exFAT (cross-platform, large files)
mkfs.ntfsFormat as NTFS (Windows compatible)
lsblkList all drives first to find the right one

Distro differences

Debian/Ubuntu vs Fedora vs Arch

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command mkfs.ext4 Same command on this distribution.
Fedora same command mkfs.ext4 Same command on this distribution.
Arch same command mkfs.ext4 Same command on this distribution.

Important

What to watch out for

Double-check the device path (/dev/sdb1, etc.) before formatting. Formatting the wrong drive permanently destroys its data.

Keep learning

Related System & Storage commands