gdisk
TLDR
List partitions
SYNOPSIS
gdisk [options] device
DESCRIPTION
gdisk is an interactive GPT (GUID Partition Table) partitioning tool, similar to fdisk but designed specifically for GPT disks. It can create, delete, and modify partitions on modern UEFI systems.
GPT is the modern partitioning scheme that replaces MBR (Master Boot Record), supporting disks larger than 2TB and more than 4 primary partitions (up to 128). gdisk maintains both primary and backup partition tables for redundancy.
gdisk can also convert MBR disks to GPT (and vice versa with sgdisk), though this should be done carefully with backups.
PARAMETERS
-l, --list
List partition tables for all devices and exitdevice
Device to partition (e.g., /dev/sda, /dev/nvme0n1)
INTERACTIVE COMMANDS
?
Open help menup
Print partition tablen
Add new partitiond
Delete a partitiont
Change partition typec
Change partition namew
Write table to disk and exitq
Quit without saving changes
CAVEATS
Requires root privileges. Changes are only written when using w command. Converting between MBR and GPT can cause boot issues if not done correctly. Always backup important data before partitioning.
HISTORY
gdisk (GPT fdisk) was created by Roderick W. Smith and first released around 2009. It was developed to provide a text-mode GPT partitioning tool similar in interface to the classic fdisk, as UEFI and GPT became the standard for modern systems.


