Windows
Linux
System & Storage
Disk & Storage
Windows diskpart / fdisk equivalent in Linux
Creates, deletes, and modifies disk partitions. Use with extreme care.
Windows
→
diskpart / fdisk
Linux equivalents
fdisk / parted
fdisk / parted
fdisk / parted
Overview
What this command does
Creates, deletes, and modifies disk partitions. Use with extreme care.
Migration tip:
fdisk is interactive (like diskpart). parted supports GPT disks and is better for modern systems. lsblk and fdisk -l let you safely view partitions first.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
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 | 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
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.
Keep learning