vss

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

type DiskExtent struct {
	DiskNumber     uint32
	StartingOffset int64
	Length         int64
}

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

func CreateSnapshotSet(volumes []string) (*Set, error)

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.

func (*Set) Release

func (s *Set) Release() error

Release tears down the snapshot set (notifies writers, deletes the transient copies).

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

func CreateSnapshot(volume string) (*Snapshot, error)

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.

func (*Snapshot) Release

func (s *Snapshot) Release() error

Release tears down the VSS snapshot, notifying writers and deleting the shadow copy. Safe to call on a nil or already-released snapshot.

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).

Jump to

Keyboard shortcuts

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