From 6db7d9f7d13eb092903e2b2c098a800b96bc0dfb Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Sat, 12 Dec 2020 05:06:23 +0800 Subject: [PATCH] parted: add page (#4961) --- pages/linux/parted.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/linux/parted.md diff --git a/pages/linux/parted.md b/pages/linux/parted.md new file mode 100644 index 0000000000..bf63cd2ded --- /dev/null +++ b/pages/linux/parted.md @@ -0,0 +1,36 @@ +# parted + +> A partition manipulation program. +> More information: . + +- 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}}`