Disk

parted

GNU partition editor supporting MBR, GPT, and various filesystem types.

Synopsis

syntax
parted [OPTION]... [DEVICE [COMMAND]]...

Examples

List all partitions
sudo parted -l
Show partition table for sda
sudo parted /dev/sda print
Create partition using full disk
sudo parted /dev/sdb mkpart primary ext4 1MiB 100%
Resize partition 1 to 50GiB
sudo parted /dev/sda resizepart 1 50GiB

Common options

FlagDescription
-lList partitions on all devices
-sScript mode — never prompt
printShow partition table
mkpartCreate partition
resizepartResize partition

About parted

The `parted` command gNU partition editor supporting MBR, GPT, and various filesystem types. 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 5 commonly used flags shown above, though the full set of options is available in the man page (`man parted`). The 4 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