Usage: sgdisk [OPTION...] <device>
-A, --attributes=list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]] operate on partition attributes
-a, --set-alignment=value set sector alignment
-b, --backup=file backup GPT to file
-B, --byte-swap-name=partnum byte-swap partition's name
-c, --change-name=partnum:name change partition's name
-C, --recompute-chs recompute CHS values in protective/hybrid MBR
-d, --delete=partnum delete a partition
-D, --display-alignment show number of sectors per allocation block
-e, --move-second-header move second/backup header to end of disk
-E, --end-of-largest show end of largest free block
-f, --first-in-largest show start of the largest free block
-F, --first-aligned-in-largest show start of the largest free block, aligned
-g, --mbrtogpt convert MBR to GPT
-G, --randomize-guids randomize disk and partition GUIDs
-h, --hybrid=partnum[:partnum...][:EE] create hybrid MBR
-i, --info=partnum show detailed information on partition
-I, --align-end align partition end points
-j, --move-main-table=sector change the start sector of the main partition table
-k, --move-backup-table=sector change the start sector of the second/backup partition table
-l, --load-backup=file load GPT backup from file
-L, --list-types list known partition types
-m, --gpttombr=partnum[:partnum...] convert GPT to MBR
-n, --new=partnum:start:end create new partition
-N, --largest-new=partnum create largest possible new partition
-o, --clear clear partition table
-O, --print-mbr print MBR partition table
-p, --print print partition table
-P, --pretend make changes in memory, but don't write them
-r, --transpose=partnum:partnum transpose two partitions
-R, --replicate=device_filename replicate partition table
-s, --sort sort partition table entries
-S, --resize-table=numparts resize partition table
-t, --typecode=partnum:{hexcode|GUID} change partition type code
-T, --transform-bsd=partnum transform BSD disklabel partition to GPT
-u, --partition-guid=partnum:guid set partition GUID
-U, --disk-guid=guid set disk GUID
-v, --verify check partition table integrity
-V, --version display version information
-z, --zap zap (destroy) GPT (but not MBR) data structures
-Z, --zap-all zap (destroy) GPT and MBR data structures
Help options:
-?, --help Show this help message
--usage Display brief usage message
Options (42)
| Option | Description | Source |
|---|---|---|
-A, --attributes | operate on partition attributes | help |
-a, --set-alignment value | Set the sector alignment multiple. | help + man |
-b, --backup file | Save partition data to a backup file. | help + man |
-B, --byte-swap-name partnum | Swap the byte order for the name of the specified partition. | help + man |
-c, --change-name partnum:name | Change the GPT name of a partition. | help + man |
-C, --recompute-chs | Recompute CHS values in protective or hybrid MBR. | help + man |
-d, --delete partnum | Delete a partition. | help + man |
-D, --display-alignment | show number of sectors per allocation block | help + man |
-e, --move-second-header | Move backup GPT data structures to the end of the disk. | help + man |
-E, --end-of-largest | Displays the sector number of the end of the largest available block of sectors on the disk. | help + man |
-f, --first-in-largest | Displays the sector number of the start of the largest available block of sectors on the disk. | help + man |
-F, --first-aligned-in-largest | Similar to -f (--first-in-largest), except returns the sector number with the current alignment correction applied. | help + man |
-g, --mbrtogpt | Convert an MBR or BSD disklabel disk to a GPT disk. | help + man |
-G, --randomize-guids | Randomize the disk's GUID and all partitions' unique GUIDs (but not their partition type code GUIDs). | help + man |
-h, --hybrid partnum[:partnum...][:EE | Create a hybrid MBR. | help + man |
-i, --info partnum | show detailed information on partition | help + man |
-I, --align-end | When possible, align the end points of partitions to one less than a multiple of the alignment value. | help + man |
-j, --move-main-table sector | change the start sector of the main partition table | help + man |
-k, --move-backup-table sector | change the start sector of the second/backup partition table | help + man |
-l, --load-backup file | Load partition data from a backup file. | help + man |
-L, --list-types | Display a summary of partition types. | help + man |
-m, --gpttombr partnum[:partnum... | Convert disk from GPT to MBR form. | help + man |
-n, --new partnum:start:end | Create a new partition. | help + man |
-N, --largest-new partnum | Create a new partition that fills the largest available block of space on the disk. | help + man |
-o, --clear | Clear out all partition data. | help + man |
-O, --print-mbr | Display basic MBR partition summary data. | help + man |
-p, --print | Display basic GPT partition summary data. | help + man |
-P, --pretend | make changes in memory, but don't write them | help + man |
-r, --transpose partnum:partnum | Swap two partitions' entries in the partition table. | help + man |
-R, --replicate device_filename | Replicate the main device's partition table on the specified second device. | help + man |
-s, --sort | sort partition table entries | help + man |
-S, --resize-table numparts | resize partition table | help |
-t, --typecode partnum:{hexcode|GUID | Change a single partition's type code. | help + man |
-T, --transform-bsd partnum | Transform BSD partitions into GPT partitions. | help + man |
-u, --partition-guid partnum:guid | Set the partition unique GUID for an individual partition. | help + man |
-U, --disk-guid guid | Set the GUID for the disk. | help + man |
-v, --verify | check partition table integrity | help + man |
-V, --version | Display program version information. | help + man |
-z, --zap | Zap (destroy) the GPT data structures and then exit. | help + man |
-Z, --zap-all | Zap (destroy) the GPT and MBR data structures and then exit. | help + man |
-?, --help | Print a summary of options. | help + man |
--usage | Print a brief summary of available options. | help + man |
Exit status (7) from the manual page
0 | Normal program execution |
1 | Too few arguments |
2 | An error occurred while reading the partition table |
3 | Non-GPT disk detected and no -g option, but operation requires a write action |
4 | An error prevented saving changes |
5 | An error occurred while reading standard input (should never occur with sgdisk, but may with gdisk) |
8 | Disk replication operation (-R) failed |