fdisk

A program for managing partition tables and partitions on a hard disk. See also: partprobe. More information: <https://manned.org/fdisk>.

Install

All systems
curl cmd.cat/fdisk.sh
Debian Debian
apt-get install fdisk
Ubuntu
apt-get install fdisk
Alpine
apk add util-linux
Arch Arch Linux
pacman -S util-linux
image/svg+xml Kali Linux
apt-get install fdisk
CentOS
yum install util-linux
Fedora
dnf install util-linux
Windows (WSL2)
sudo apt-get update sudo apt-get install fdisk
OS X
brew install util-linux
Raspbian
apt-get install util-linux
Docker
docker run cmd.cat/fdisk fdisk powered by Commando

A program for managing partition tables and partitions on a hard disk. See also: partprobe. More information: <https://manned.org/fdisk>.

  • List partitions:
    sudo fdisk -l
  • Start the partition manipulator:
    sudo fdisk /dev/sdX
  • Once partitioning a disk, create a partition:
    n
  • Once partitioning a disk, select a partition to delete:
    d
  • Once partitioning a disk, view the partition table:
    p
  • Once partitioning a disk, write the changes made:
    w
  • Once partitioning a disk, discard the changes made:
    q
  • Once partitioning a disk, open a help menu:
    m

© tl;dr; authors and contributors