2025-09-14 18:48:49 -06:00
|
|
|
# parted
|
|
|
|
|
|
|
|
|
|
> A partition manipulation program.
|
|
|
|
|
> See also: `parted`, `partprobe`.
|
|
|
|
|
> More information: <https://www.gnu.org/software/parted/parted.html>.
|
|
|
|
|
|
|
|
|
|
- Start interactive mode with the specified disk selected:
|
|
|
|
|
|
|
|
|
|
`sudo parted {{/dev/sdX}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Show partition information in interactive mode:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`print`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Select a disk in interactive mode:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`select {{/dev/sdX}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Create a 16 GB partition with the specified filesystem in interactive mode (`GPT` partition table):
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`mkpart {{partition_name}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Create a 16 GB partition with the specified filesystem in interactive mode (`MBR` partition table):
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`mkpart {{primary|logical|extended}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Resize a partition in interactive mode:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`resizepart {{/dev/sdXN}} {{end_position_of_partition}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Remove a partition in interactive mode:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`rm {{/dev/sdXN}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- [Interactive] Display help:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
|
|
|
|
`?`
|