volume

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HFSVolumeTypes = map[string]bool{
	"Apple_HFS":  true,
	"Apple_HFSX": true,
	"Apple_MFS":  true,
}

HFSVolumeTypes are APM partition types that contain HFS or HFS+.

Functions

func DetectHFSMagic

func DetectHFSMagic(c disk.Content) bool

DetectHFSMagic reports whether c looks like an HFS or HFS+ volume at +1024.

func FindVolumeOffset

func FindVolumeOffset(c disk.Content) (int64, bool)

FindVolumeOffset locates an HFS/HFS+ MDB/header. Returns offset of volume start (header is at start+1024). ok is false if none found.

Types

type Kind

type Kind int

Kind of physical volume.

const (
	KindEntireDisk Kind = iota
	KindApplePartition
	KindGPTPartition
)

type Volume

type Volume struct {
	Kind     Kind
	Identity string
	Length   int64
	Type     string
	Open     func() disk.Content
}

Volume is a physical volume: an APM/GPT partition or a volume-only image.

func Scan

func Scan(d disk.Disk) ([]*Volume, error)

Scan enumerates volumes on a disk. 1. APM (or other table) → HFS/HFS+ partitions 2. Else HFS/HFS+ magic at +1024 (or 512-aligned scan) → EntireDisk 3. Else EntireDisk covering the whole content (empty image to format)

func (*Volume) Content

func (v *Volume) Content() disk.Content

Jump to

Keyboard shortcuts

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