parted: add page (#4961)

This commit is contained in:
Ein Verne 2020-12-12 05:06:23 +08:00 committed by GitHub
parent c978cc8172
commit 6db7d9f7d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

36
pages/linux/parted.md Normal file
View File

@ -0,0 +1,36 @@
# parted
> A partition manipulation program.
> More information: <https://www.gnu.org/software/parted/parted.html>.
- List partitions on all block devices:
`sudo parted --list`
- Start to manipulate disk partition:
`sudo parted {{/dev/sdX}}`
- Create a new partition table of label-type directly, label-type can be gpt, msdos etc:
`sudo parted --script {{/dev/sdX}} mklabel {{gpt}}`
- Show disk partition information in interactive mode:
`print`
- Select a disk in interactive mode:
`select {{/dev/sdX}}`
- Interactively create a 16GB partition with a given filesystem:
`mkpart {{primary|logical|extended}} {{filesystem}} {{0%}} {{16G}}`
- Resize partition size:
`resizepart {{/dev/sdXN}} {{end_position_of_partition}}`
- Remove partition:
`rm {{/dev/sdXN}}`