mbr

package
v1.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Empty        partType = 0x00
	AppleUFS     partType = 0xA8
	AppleBoot    partType = 0xAB
	AppleRAID    partType = 0xAC
	AppleHFSPlus partType = 0xAF
	LegacyMBR    partType = 0xEE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterBootRecord

type MasterBootRecord struct {
	BootLoader [446]byte
	Partitions [4]Partition
	Signature  uint16
}

MasterBootRecord is a MBR object (512 bytes)

func NewMasterBootRecord

func NewMasterBootRecord(r io.Reader) (*MasterBootRecord, error)

NewMasterBootRecord reads a MBR from a given io.Reader

type Partition

type Partition struct {
	Boot          bool
	StartCHS      chs // These bytes represent the partition’s starting sector in CHS (Cylinder-Head-Sector)
	Type          partType
	EndCHS        chs
	StartLBA      uint32
	NumberSectors uint32
}

Partition is a MBR partition object

func (Partition) String

func (p Partition) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL