parted
program to manipulate disk partitions
TLDR
List partitions on all block devices
SYNOPSIS
parted [options] [device [command [options]...]]
DESCRIPTION
parted is a program to manipulate disk partitions. It supports multiple partition table formats, including MS-DOS (MBR) and GPT. It can be used to create space for new operating systems, reorganize disk usage, and copy data to new hard disks.
PARAMETERS
-h, --help
Display help message-l, --list
List partition layout on all block devices-m, --machine
Show machine-parseable output-j, --json
Show JSON output-s, --script
Never prompt for user intervention-f, --fix
Auto-answer "fix" to exceptions in script mode-a, --align TYPE
Set alignment for new partitions (none, cylinder, minimal, optimal)
COMMANDS
mklabel TYPE
Create new partition table (gpt, msdos, etc.)mkpart NAME START END
Create new partition with optional filesystem typeprint
Display partition tablerm NUMBER
Delete partition by numberselect DEVICE
Choose device to editset NUMBER FLAG STATE
Change partition flags (boot, raid, lvm, esp, etc.)name NUMBER NAME
Set partition name (GPT only)resizepart NUMBER END
Modify partition end positionrescue START END
Recover lost partitionstype NUMBER TYPE
Set partition type ID (MBR) or UUID (GPT)unit UNIT
Set display/input units (s, B, kB, MB, GB, TB, %)
CAVEATS
Parted modifies the partition table directly and changes take effect immediately. Always backup important data before modifying partitions. Use -s flag for scripting to avoid interactive prompts.
HISTORY
parted is part of the GNU Parted package, first released in 1999 by Andrew Clausen. It was designed to handle larger disks and more partition types than traditional fdisk.
