Module gpt

Source
Expand description

Functions for writing GUID Partition Tables for use in a composite disk image.

Structsยง

GptHeader ๐Ÿ”’
GptPartitionEntry
A GPT entry for a particular partition.

Enumsยง

Error

Constantsยง

GPT_BEGINNING_SIZE
The size in bytes of everything before the first partition: i.e. the MBR, GPT header and GPT partition entries.
GPT_END_SIZE
The size in bytes of everything after the last partition: i.e. the GPT partition entries and GPT footer.
GPT_HEADER_SIZE
The size in bytes of a GPT header.
GPT_NUM_PARTITIONS
The number of partition entries in the GPT, which is the maximum number of partitions which are supported.
GPT_PARTITION_ENTRY_SIZE
The size in bytes of a single GPT partition entry.
MBR_PARTITION_ENTRY_SIZE ๐Ÿ”’
The size in bytes on an MBR partition entry.
SECTOR_SIZE
The size in bytes of a disk sector (also called a block).

Functionsยง

write_gpt_header
Write a GPT header for the disk.
write_guid ๐Ÿ”’
Write a UUID in the mixed-endian format which GPT uses for GUIDs.
write_protective_mbr
Write a protective MBR for a disk of the given total size (in bytes).