LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gdisk

interactive GPT partitioning tool

TLDR

List partitions
$ sudo gdisk -l
copy
Start the interactive partition manipulator
$ sudo gdisk /dev/sdX
copy

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 exit
device
Device to partition (e.g., /dev/sda, /dev/nvme0n1)

INTERACTIVE COMMANDS

?

Open help menu
p
Print partition table
n
Add new partition
d
Delete a partition
t
Change partition type
c
Change partition name
w
Write table to disk and exit
q
Quit without saving changes

INSTALL

sudo apt install gdisk
copy
sudo dnf install gdisk
copy
sudo pacman -S gptfdisk
copy
sudo apk add gptfdisk
copy
sudo zypper install gptfdisk
copy
brew install gptfdisk
copy
nix profile install nixpkgs#gptfdisk
copy

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.

SEE ALSO

fdisk(8), parted(8), cfdisk(8), sgdisk(8)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid