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

Windows diskpart / fdisk equivalent in Linux

Creates, deletes, and modifies disk partitions. Use with extreme care.

Windows diskpart / fdisk
→
Linux equivalents
Debian/Ubuntu same command
fdisk / parted
Fedora same command
fdisk / parted
Arch same command
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.

Migration tip: <strong><code>fdisk</code></strong> is interactive (like diskpart). <strong><code>parted</code></strong> supports GPT disks and is better for modern systems. <code>lsblk</code> and <code>fdisk -l</code> let you safely view partitions first.

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.

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 optionUse
lsblkSafe read-only view of all disks
fdisk -lList all partitions on all disks
fdisk /dev/sdbInteractive partition editor
parted /dev/sdbModern partition manager (GPT support)
gpartedGraphical 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.

DistributionPackage manager / baseEquivalent commandDifference 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

Related System & Storage commands