1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/linux/parted.md

26 lines
779 B
Markdown
Raw Normal View History

2020-12-12 05:06:23 +08:00
# parted
> A partition manipulation program.
> See also: `parted-interactive`, `partprobe`.
> More information: <https://www.gnu.org/software/parted/manual/html_node/Invoking-Parted.html>.
2020-12-12 05:06:23 +08:00
- List partitions on all block devices:
`sudo parted {{[-l|--list]}}`
2020-12-12 05:06:23 +08:00
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
`sudo parted {{/dev/sdX}} {{[-s|--script]}} mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}`
2020-12-12 05:06:23 +08: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
`sudo parted {{/dev/sdX}} {{[-s|--script]}} mklabel gpt mkpart primary 0% 500MiB mkpart primary 500MiB 100%`
2020-12-12 05:06:23 +08:00
- Start interactive mode with the specified disk selected:
2020-12-12 05:06:23 +08:00
`sudo parted {{/dev/sdX}}`
2025-03-26 00:36:41 +02:00
- Display help:
`parted {{[-h|--help]}}`