When to use parted
Use parted's print operations to inspect disk labels, partitions and unallocated regions. Keep inspection distinct from partition editing: changes can affect live data and may be applied immediately.
Syntax
parted [OPTIONS] [DEVICE [COMMAND]]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
View list of disks
sudo parted -lDetected disks and partition tables are listed.
View the layout of one disk
sudo parted /dev/vdb printOne disk's current table is printed without requesting a change.
View free areas
sudo parted /dev/vdb unit MiB print freeFree regions are included and sizes are displayed in mebibytes.
Notes and limitations
- Layout modification commands can be applied immediately. The examples here are limited to viewing.
- Before any changes, a backup is required; the /dev/vdb path in the example does not identify your drive.
Common questions and troubleshooting
Does print free allocate unused disk space?
No. It reports the layout. Allocation requires separate operations and may also require filesystem resizing afterward.
Why are disk size and free filesystem space different?
Partition layout, filesystem capacity and filesystem free space are separate layers. Inspect each before choosing a resize operation.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man parted.