Skip to content

Commit 35ddc28

Browse files
sgdisk: add page (#19290)
Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
1 parent 6a06187 commit 35ddc28

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

pages/common/sgdisk.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# sgdisk
2+
3+
> Manage GUID Partition Tables (GPT).
4+
> Part of the GPT fdisk suite; designed for scripting and automation.
5+
> More information: <https://manned.org/sgdisk>.
6+
7+
- Display basic GPT partition summary data for a device:
8+
9+
`sudo sgdisk {{[-p|--print]}} {{/dev/sdX}}`
10+
11+
- Wipe both GPT and MBR data structures from a device (destroys all partition information):
12+
13+
`sudo sgdisk {{[-Z|--zap-all]}} {{/dev/sdX}}`
14+
15+
- Convert a GPT disk to MBR format using up to four partitions:
16+
17+
`sudo sgdisk {{[-m|--gpttombr]}} {{1:2:3:4}} {{/dev/sdX}}`
18+
19+
- Delete a partition entry by number (data in sectors remains untouched):
20+
21+
`sudo sgdisk {{[-d|--delete]}} {{1}} {{/dev/sdX}}`
22+
23+
- Save the current in-memory GPT data (protective MBR, headers, and table) to a binary backup file:
24+
25+
`sudo sgdisk {{[-b|--backup]}} {{/path/to/backup.gpt}} {{/dev/sdX}}`
26+
27+
- Load GPT data from a backup file (restoring from a non-original disk is not recommended):
28+
29+
`sudo sgdisk {{[-l|--load-backup]}} {{/path/to/backup.gpt}} {{/dev/sdX}}`
30+
31+
- Verify GPT structures for CRC errors, mismatches, or inconsistencies:
32+
33+
`sudo sgdisk {{[-v|--verify]}} {{/dev/sdX}}`
34+
35+
- Display a summary of available partition type codes (no device required):
36+
37+
`sgdisk {{[-L|--list-types]}}`

0 commit comments

Comments
 (0)