2020-12-12 05:06:23 +08:00
|
|
|
# parted
|
|
|
|
|
|
|
|
> A partition manipulation program.
|
2025-01-05 20:05:32 +02:00
|
|
|
> See also: `parted-interactive`, `partprobe`.
|
2020-12-12 05:06:23 +08:00
|
|
|
> More information: <https://www.gnu.org/software/parted/parted.html>.
|
|
|
|
|
|
|
|
- List partitions on all block devices:
|
|
|
|
|
|
|
|
`sudo parted --list`
|
|
|
|
|
2021-03-19 10:10:13 -04:00
|
|
|
- Create a new partition table of the specified label-type:
|
2020-12-12 05:06:23 +08:00
|
|
|
|
2025-01-05 20:05:32 +02:00
|
|
|
`sudo parted {{/dev/sdX}} --script mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}`
|
2020-12-12 05:06:23 +08:00
|
|
|
|
2025-01-05 20:05:32 +02:00
|
|
|
- Create a new `gpt` partition table with a 500MiB boot partition and give the rest for the system partition:
|
2020-12-12 05:06:23 +08:00
|
|
|
|
2025-01-05 20:05:32 +02:00
|
|
|
`sudo parted {{/dev/sdX}} --script mklabel gpt mkpart primary 0% 500MiB mkpart primary 500MiB 100%`
|
2020-12-12 05:06:23 +08:00
|
|
|
|
2025-01-05 20:05:32 +02:00
|
|
|
- Start interactive mode with the specified disk selected:
|
2020-12-12 05:06:23 +08:00
|
|
|
|
2025-01-05 20:05:32 +02:00
|
|
|
`sudo parted {{/dev/sdX}}`
|