Skip to main content

Module disk

Module disk 

Source

Structsยง

DeviceInfo ๐Ÿ”’
DiskCollector
Snapshot ๐Ÿ”’

Constantsยง

SECTOR_BYTES ๐Ÿ”’

Functionsยง

block_attr ๐Ÿ”’
collect_zfs_spaces ๐Ÿ”’
Collect space stats for every imported ZFS pool via zpool list -Hp.
dev_root_is_on_device ๐Ÿ”’
Return true if /dev/root (a root-partition alias used by Ubuntu/AWS and similar cloud images) belongs to device_name.
device_source_prefixes ๐Ÿ”’
Build the list of source-path prefixes to look for in /proc/mounts for a given block device.
discover_devices ๐Ÿ”’
Discover all whole-disk block devices from /sys/block/ and cache their static identity. Called once in DiskCollector::new().
mounts_for_device ๐Ÿ”’
Read /proc/mounts and return filesystem space for all mount points whose source device path starts with /dev/<device_name> (covers partitions too).
read_device_info ๐Ÿ”’
statvfs_space ๐Ÿ”’
sysfs_read ๐Ÿ”’
zfs_pool_mount_map ๐Ÿ”’
Build a pool-name โ†’ shallowest-mount-point map from /proc/mounts. The root dataset (source with no /) is preferred; the dataset with the fewest path components (shallowest) is used when multiple datasets match.

Type Aliasesยง

Result ๐Ÿ”’