parted Command Examples

A partition manipulation program. See also: partprobe. More information: https://www.gnu.org/software/parted/parted.html.

sudo parted --list

sudo parted {{/dev/sdX}}

sudo parted --script {{/dev/sdX}} mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}

print

select {{/dev/sdX}}

mkpart {{primary|logical|extended}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}

resizepart {{/dev/sdXN}} {{end_position_of_partition}}

rm {{/dev/sdXN}}