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
mkfs.ext4
mkfs.ext4
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 option | Use |
|---|---|
mkfs.ext4 | Format as ext4 (standard Linux) |
mkfs.vfat | Format as FAT32 (Windows compatible) |
mkfs.exfat | Format as exFAT (cross-platform, large files) |
mkfs.ntfs | Format as NTFS (Windows compatible) |
lsblk | List 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.
| Distribution | Package manager / base | Equivalent command | Difference 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