package
0.0.0-20250312152250-ea85ec9d2454
Repository: https://github.com/snapcore/snapd.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
BlkIDDecodeLabel decodes a string such as a filesystem or partition label encoded by udev in BlkIDEncodeLabel for normal comparison, i.e.
BlkIDEncodeLabel encodes a name for use as a partition or filesystem label symlink by udev.
No description provided by the author
CandidateByLabelPath searches for a filesystem with label matching "label".
CreateLinearMapperDevice creates a linear device mapping of the given device with the given offset and size.
Devlinks returns all the /dev symlinks for a node.
DiskFromDeviceName finds a matching Disk using the specified name, such as vda, or mmcblk0, etc.
DiskFromDeviceName finds a matching Disk using the specified path in the kernel's sysfs, such as /sys/devices/pci0000:00/0000:00:04.0/virtio2/block/vdb.
DiskFromMountPoint finds a matching Disk for the specified mount point.
DiskFromPartitionDeviceNode finds a matching Disk that the specified partition node resides on.
DMCryptUUIDFromMountPoint finds the UUID of a device mapper device mounted at mountpoint.
FilesystemUUID retrieves the UUID of the filesystem for a give node path.
No description provided by the author
No description provided by the author
MockDeviceNameToDiskMapping will mock DiskFromDeviceName such that the provided map of device names to mock disks is used instead of the actual implementation using udev.
MockDevicePathToDiskMapping will mock DiskFromDevicePath such that the provided map of device names to mock disks is used instead of the actual implementation using udev.
MockMountPointDisksToPartitionMapping will mock DiskFromMountPoint such that the specified mapping is returned/used.
MockPartitionDeviceNodeToDiskMapping will mock DiskFromPartitionDeviceNode such that the provided map of device names to mock disks is used instead of the actual implementation using udev.
No description provided by the author
MountPointsForPartitionRoot returns all mounts from the mount table which are for the root directory of the specified partition and have matching mount options as specified.
No description provided by the author
RegisterDeviceMapperBackResolver takes a callback function which is used when the disks package through some of it's various methods to locate/create a disk needs to trace a device mapper node back to the original device node location such as /dev/mapper/something -> /dev/sda1 -> /dev/sda.
No description provided by the author
# Variables
ErrMountPointNotFound is returned by DMCryptUUIDFromMountPoint a path is not a mount point.
ErrNoDmUUID is returned by DMCryptUUIDFromMountPoint when the device at the mount point is not a device mapper device.
# Structs
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_table_header_(LBA_1).
MockDiskMapping is an implementation of Disk for mocking purposes, it is exported so that other packages can easily mock a specific disk layout without needing to mock the mount setup, sysfs, or udev commands just to test high level logic.
Mountpoint is a combination of a mountpoint location and whether that mountpoint is a decrypted device.
Options is a set of options used when querying information about partition and disk devices.
Partition represents a partition on a Disk device.
PartitionNotFoundError is an error where a partition matching the SearchType was not found.
# Interfaces
Disk is a single physical disk device that contains partitions.