Documentation
¶
Overview ¶
Package vss creates and releases Windows Volume Shadow Copy snapshots for consistent volume backups. It is a thin adapter over github.com/SmithOperatingSolutions/go-vss (a pure-Go COM requester); the surrounding disknexus code depends only on the small Snapshot shape defined here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveDevicePaths ¶
func ActiveDevicePaths() []string
ActiveDevicePaths returns every snapshot device this process currently holds open, across all live snapshots and sets.
func RegisterActiveDevicesForProbe ¶
func RegisterActiveDevicesForProbe(devices []string) func()
RegisterActiveDevicesForProbe is registerActiveDevices for callers outside the package: the wake-tolerance tests (no Windows, no real VSS) stand in for a live capture with it. Production registration happens inside the constructors, so a real capture cannot forget to register.
Types ¶
type DiskExtent ¶
DiskExtent locates a slice of a volume on a physical disk.
type Set ¶
type Set struct {
Members []SetMember
// contains filtered or unexported fields
}
Set is an atomic multi-volume shadow-copy set (#68): every member snapshot is from the same instant, the way cross-volume applications expect. Release tears the whole set down.
func CreateSnapshotSet ¶
CreateSnapshotSet snapshots all given volumes in ONE VSS snapshot set (file-consistent, writer-participating; VSS caps a set at 64 volumes). Members are returned in the order requested.
type SetMember ¶
type SetMember struct {
Volume string // as requested (e.g. "C:", or a \\?\Volume{GUID}\ name)
ID string // snapshot GUID
DevicePath string // shadow device to read
}
SetMember is one volume's snapshot within an atomic multi-volume set.
type Snapshot ¶
type Snapshot struct {
ID string // VSS snapshot ID (GUID, "{...}" form)
DevicePath string // Shadow device path, e.g. \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
Volume string // Source volume as requested (e.g. "C:")
// contains filtered or unexported fields
}
Snapshot represents an active VSS shadow copy.
func CreateSnapshot ¶
CreateSnapshot creates a VSS snapshot of the given volume (e.g. "C:"). On non-Windows platforms it returns an error directing the user to file-based input instead.
type VolumeOnDisk ¶
type VolumeOnDisk struct {
VolumeName string // \\?\Volume{GUID}\ form — usable with CreateSnapshotSet
MountPoint string // "" when unmounted
Extents []DiskExtent
}
VolumeOnDisk describes a volume found during disk enumeration (#68): its canonical GUID name, mount point when mounted (empty for e.g. the ESP), and where it lives on physical disks.
func VolumesOnDisk ¶
func VolumesOnDisk(diskNumber uint32) ([]VolumeOnDisk, error)
VolumesOnDisk enumerates all volumes that have at least one extent on the given physical disk, for correlating GPT partitions with snapshot-able volumes (BMR disk capture).