Documentation ¶
Index ¶
- Variables
- func FormatVolume(volumeID string) (err error)
- func GetClosestVolumeIDFromTargetPath(targetPath string) (string, error)
- func GetDiskNumberFromVolumeID(volumeID string) (uint32, error)
- func GetVolumeIDFromTargetPath(mount string) (string, error)
- func IsVolumeFormatted(volumeID string) (bool, error)
- func ListVolumesOnDisk(diskNumber uint32, partitionNumber uint32) (volumeIDs []string, err error)
- func MountVolume(volumeID, path string) error
- func ResizeVolume(volumeID string, size int64) error
- func UnmountVolume(volumeID, path string) error
- func WriteVolumeCache(volumeID string) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // VolumeRegexp matches a Windows Volume // example: Volume{452e318a-5cde-421e-9831-b9853c521012} // // The field UniqueId has an additional prefix which is NOT included in the regex // however the regex can match UniqueId too // PS C:\disks> (Get-Disk -Number 1 | Get-Partition | Get-Volume).UniqueId // \\?\Volume{452e318a-5cde-421e-9831-b9853c521012}\ VolumeRegexp = regexp.MustCompile(`Volume\{[\w-]*\}`) )
Functions ¶
func FormatVolume ¶
FormatVolume - Formats a volume with the NTFS format.
func GetClosestVolumeIDFromTargetPath ¶
GetVolumeIDFromTargetPath returns the volume id of a given target path.
func GetDiskNumberFromVolumeID ¶
GetDiskNumberFromVolumeID - gets the disk number where the volume is.
func GetVolumeIDFromTargetPath ¶
GetVolumeIDFromTargetPath - gets the volume ID given a mount point, the function is recursive until it find a volume or errors out
func IsVolumeFormatted ¶
IsVolumeFormatted - Check if the volume is formatted with the pre specified filesystem(typically ntfs).
func ListVolumesOnDisk ¶
ListVolumesOnDisk - returns back list of volumes(volumeIDs) in a disk and a partition.
func MountVolume ¶
MountVolume - mounts a volume to a path. This is done using the Add-PartitionAccessPath for presenting the volume via a path.
func ResizeVolume ¶
ResizeVolume - resizes a volume with the given size, if size == 0 then max supported size is used
func UnmountVolume ¶
UnmountVolume - unmounts the volume path by removing the partition access path
func WriteVolumeCache ¶
WriteVolumeCache - Writes the file system cache to disk with the given volume id
Types ¶
This section is empty.