Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GUID_LVM = PartType([16]byte{0x79, 0xd3, 0xd6, 0xe6, 0x7, 0xf5, 0xc2, 0x44, 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28}) // E6D6D379-F507-44C2-A23C-238F2A3DF928
)
Functions ¶
func StringToGuid ¶
Use for create guid predefined values in snippet http://play.golang.org/p/uOd_WQtiwE
Types ¶
type Header ¶
type Header struct {
Signature [8]byte // Offset 0. "EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h
Revision uint32 // Offset 8
Size uint32 // Offset 12
CRC uint32 // Offset 16. Autocalc when save Header.
Reserved uint32 // Offset 20
HeaderStartLBA uint64 // Offset 24
HeaderCopyStartLBA uint64 // Offset 32
FirstUsableLBA uint64 // Offset 40
LastUsableLBA uint64 // Offset 48
DiskGUID Guid // Offset 56
PartitionsTableStartLBA uint64 // Offset 72
PartitionsArrLen uint32 // Offset 80
PartitionEntrySize uint32 // Offset 84
PartitionsCRC uint32 // Offset 88. Autocalc when save Table.
TrailingBytes []byte // Offset 92
}
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_table_header_.28LBA_1.29
type NewTableArgs ¶
NewTableArgs - arguments NewTable creation.
type Partition ¶
type Partition struct {
Type PartType // Offset 0
Id Guid // Offset 16
FirstLBA uint64 // Offset 32
LastLBA uint64 // Offset 40
Flags Flags // Offset 68
PartNameUTF16 [72]byte // Offset 56
TrailingBytes []byte // Offset 128. Usually it is empty
}
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries
type Table ¶
func NewTable ¶
func NewTable(diskSize uint64, args *NewTableArgs) Table
NewTable - return a valid empty Table for given sectorSize and diskSize
Note that a Protective MBR is needed for lots of software to read the GPT table.
func ReadTable ¶
func ReadTable(reader io.ReadSeeker, SectorSize uint64) (table Table, err error)
Read GPT partition Have to set to first byte of GPT Header (usually start of second sector on disk)
func (Table) CreateOtherSideTable ¶
func (Table) CreateTableForNewDiskSize ¶
Create primary table for resized disk size - in sectors
Click to show internal directories.
Click to hide internal directories.