Windows diskpart / fdisk equivalent in Linux
Creates, deletes, and modifies disk partitions. Use with extreme care.
diskpart / fdisk
fdisk / parted
fdisk / parted
fdisk / parted
Overview
What this command does
On Windows, "diskpart / fdisk" is used to manage disk partitions. On Linux, the closest practical mapping shown here is "fdisk / parted". Creates, deletes, and modifies disk partitions. Use with extreme care. This reference is grouped under System & Storage → Disk & Storage.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows diskpart / fdisk maps to fdisk / parted for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
Command-specific caution
Partition changes only take effect when you write them (w command). But once written, data loss is immediate. Use lsblk first to confirm the correct disk.
For the broader concept behind this mapping, read Linux disks, storage and mounts.
Practical tasks
Common use cases
Manage disk partitions
Creates, deletes, and modifies disk partitions. Use with extreme care.
lsblk
Safe read-only view of all disks
fdisk -l
List all partitions on all disks
fdisk /dev/sdb
Interactive partition editor
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
lsblk
sudo fdisk -l
sudo fdisk /dev/sdb
Walkthrough
Examples with explanations
# List disks safely first:
lsblk # visual tree of disks & partitions
sudo fdisk -l # detailed partition info
# Interactive partition editor:
sudo fdisk /dev/sdb # opens interactive mode
m = help menu
p = print partition table
n = new partition
d = delete partition
w = write and exit
Reference
Common options and variations
| Command or option | Use |
|---|---|
lsblk | Safe read-only view of all disks |
fdisk -l | List all partitions on all disks |
fdisk /dev/sdb | Interactive partition editor |
parted /dev/sdb | Modern partition manager (GPT support) |
gparted | Graphical partition tool (GUI) |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "fdisk / parted" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | fdisk / parted |
Same command on this distribution. |
| Fedora | same command | fdisk / parted |
Same command on this distribution. |
| Arch | same command | fdisk / parted |
Same command on this distribution. |
Important
What to watch out for
Keep learning