parted
GNU partition editor supporting MBR, GPT, and various filesystem types.
Synopsis
parted [OPTION]... [DEVICE [COMMAND]]...
Examples
sudo parted -l
sudo parted /dev/sda print
sudo parted /dev/sdb mkpart primary ext4 1MiB 100%
sudo parted /dev/sda resizepart 1 50GiB
Common options
| Flag | Description |
|---|---|
| -l | List partitions on all devices |
| -s | Script mode — never prompt |
| Show partition table | |
| mkpart | Create partition |
| resizepart | Resize 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