Disk

fdisk

Interactive disk partition table manipulator for MBR and GPT layouts.

Synopsis

syntax
fdisk [OPTION]... [DEVICE]

Examples

List all disk partitions
sudo fdisk -l
Show partitions on specific disk
sudo fdisk -l /dev/sda
Interactive partitioning of /dev/sdb
sudo fdisk /dev/sdb

Common options

FlagDescription
-lList partition tables
-uDisplay in sectors
-tSpecify partition table type
-bSector size

About fdisk

The `fdisk` command interactive disk partition table manipulator for MBR and GPT layouts. Disk commands handle low-level storage operations including partitioning, formatting, filesystem checks, and block device management.

These tools are critical during system installation, storage expansion, data recovery, and performance tuning. Always exercise caution — disk operations can cause data loss if used incorrectly.

The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man fdisk`). The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Disk Commands

Other commands in the Disk category

Related tools