parted.interactive
Manage disk partitions interactively
TLDR
Start interactive mode with the specified disk selected
[Interactive] Show partition information in interactive mode
[Interactive] Select a disk in interactive mode
[Interactive] Create a 16 GB partition with the specified filesystem in interactive mode (GPT partition table)
[Interactive] Create a 16 GB partition with the specified filesystem in interactive mode (MBR partition table)
[Interactive] Resize a partition in interactive mode
[Interactive] Remove a partition in interactive mode
[Interactive] Display help
SYNOPSIS
parted [options] [device]
PARAMETERS
-h, --help
Display brief usage information.
-l, --list
List partitions on all block devices.
-m, --machine
Output in machine-parseable format.
-s, --script
Run non-interactively; skip confirmations (requires readline).
--align-check optimal|none|minimal type comparison-file
Verify partition alignment against a file.
-a alignment-type, --align alignment-type
alignment-type: none|cylinder|minimal|optimal. Ensures optimal alignment for mkpart/resizepart.
-v, --version
Show version information.
DESCRIPTION
The parted command in interactive mode provides a command-line interface for creating, resizing, deleting, and managing disk partitions on Linux systems. Invoke it by running parted <device> (e.g., parted /dev/sda), which drops you into the (parted) prompt. From here, use commands like print to list partitions, mklabel to set partition table type (e.g., gpt, msdos), mkpart to create new partitions, resizepart to resize, and rm to delete.
It supports various filesystems and partition tables, including GPT and MBR. Key advantage: non-destructive resizing for ext2/3/4, FAT, and others via libparted library. However, it's low-level and powerful, making it ideal for complex tasks like converting MBR to GPT or aligning partitions for SSDs.
Interactive mode is scriptable with --script, but prompts are skipped only with readline support. Exit with quit or Ctrl+D. Always verify with print before committing changes. Essential for server admins, rescue disks, and advanced partitioning beyond GUI tools.
CAVEATS
Extremely dangerous: can cause irreversible data loss. Always backup data and verify with print. Not for beginners; prefer fdisk or GUI tools for simple tasks. Some operations (e.g., resizing) require unmounted filesystems.
COMMON INTERACTIVE COMMANDS
print: Show partition table.
mklabel gpt: Create GPT label.
mkpart primary ext4 1MiB 100%: Make partition.
resizepart 1 100%: Resize partition 1.
quit: Exit.
UNITS SUPPORT
Uses suffixes like MiB, GiB, % for human-readable input. Default: cylinders (legacy).
HISTORY
Developed by Andrew Clausen starting 1998 as part of GNU Parted project. Reached version 3.4 in 2021. Evolved from partition resizing tools; now uses libparted for broad filesystem support. Widely used in installers like Debian.


