Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GUIDPartitionTable ¶
type GUIDPartitionTable struct { Header Header Entries [128]PartitionEntry }
GUIDPartitionTable represents a GPT on EFI systems
func ReadFrom ¶
func ReadFrom(filename string) (*GUIDPartitionTable, error)
ReadFrom reads the GPT header from a file
func (*GUIDPartitionTable) String ¶
func (table *GUIDPartitionTable) String() string
type Header ¶
type Header struct { Signature [8]byte Revision uint32 HeaderSize uint32 HeaderCRC32 uint32 CurrentLBA uint64 BackupLBA uint64 FirstUsableLBA uint64 LastUsableLBA uint64 DiskGUID GUID StartLBA uint64 NumberOfPartitionEntries uint32 SizeOfSinglePartitionEntry uint32 PartitionArrayCRC32 uint32 // contains filtered or unexported fields }
Header represents the header of a GPT at LBA1
func (*Header) CalculateCRC32 ¶
CalculateCRC32 calculates the crc32 of the Header
func (*Header) CheckCRC32 ¶
CheckCRC32 calculates the actual CRC32 of the header and compares it against the declared CRC32
type PartitionEntry ¶
type PartitionEntry struct { PartitionType GUID UniquePartitionID GUID FirstLBA uint64 LastLBA uint64 Flags uint64 PartitonName [72]byte }
PartitionEntry represents one entry in the GPT Partition Array
func (PartitionEntry) IsUnused ¶
func (entry PartitionEntry) IsUnused() bool
IsUnused checks if a partition entry does not point to an existing partition
Click to show internal directories.
Click to hide internal directories.