Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pages/common/sgdisk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# sgdisk

> GPT partition table manipulator, part of the GPT fdisk suite.
> Useful for scripting and advanced partitioning tasks.
> More information: <https://linux.die.net/man/8/sgdisk>.

- Display the partition table of a device:

`sgdisk -p {{/dev/sdX}}`

- Create a new partition:

`sgdisk -n {{1}}:{{2048}}:{{4095}} -t {{1}}:{{8300}} -c {{1}}:"{{Linux root}}" {{/dev/sdX}}`

- Delete a partition:

`sgdisk -d {{1}} {{/dev/sdX}}`

- Change the partition type:

`sgdisk -t {{1}}:{{ef00}} {{/dev/sdX}}`

- Set a partition name:

`sgdisk -c {{1}}:"{{EFI System Partition}}" {{/dev/sdX}}`

- Wipe all GPT and MBR data from a device:

`sgdisk -Z {{/dev/sdX}}`
29 changes: 29 additions & 0 deletions pages/linux/sgdisk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# sgdisk

> GPT partition table manipulator, part of the GPT fdisk suite.
> Useful for scripting and advanced partitioning tasks.
> More information: <https://linux.die.net/man/8/sgdisk>.

- Display the partition table of a device:

`sgdisk -p {{/dev/sdX}}`

- Create a new partition:

`sgdisk -n {{1}}:{{2048}}:{{4095}} -t {{1}}:{{8300}} -c {{1}}:"{{Linux root}}" {{/dev/sdX}}`

- Delete a partition:

`sgdisk -d {{1}} {{/dev/sdX}}`

- Change the partition type:

`sgdisk -t {{1}}:{{ef00}} {{/dev/sdX}}`

- Set a partition name:

`sgdisk -c {{1}}:"{{EFI System Partition}}" {{/dev/sdX}}`

- Wipe all GPT and MBR data from a device:

`sgdisk -Z {{/dev/sdX}}`