Crate lfs_core

Source
Expand description

Use lfs_core::read_mounts to get information on all mounted volumes on a unix system.

// get all mount points
let options = lfs_core::ReadOptions::default();
let mut mounts = lfs_core::read_mounts(&options).unwrap();
// only keep the one with size stats
mounts.retain(|m| m.stats.is_ok());
// print them
for mount in mounts {
    dbg!(mount);
}

The lfs application is a viewer for lfs-core and shows you the information you’re expected to find in mounts.

Structs§

BlockDevice
a “block device”, that is a device listed in the /sys/block tree with a device id
BlockDeviceList
the list of all found block devices
DeviceId
Id of a device, as can be found in MetadataExt.dev().
Disk
what we have most looking like a physical device
Inodes
inode information
Labelling
the labelling of a file-system, that is the pair (label, fs)
Mount
A mount point
MountInfo
A mount point as described in /proc/self/mountinfo
ParseDeviceIdError
ParseMountInfoError
ReadOptions
Stats
inode & blocs information given by statvfs

Enums§

Error
lfs error type
StatsError

Functions§

get_label
read_by
try to read all mappings defined in /dev/disk/by-<by_kind>, where by_kind is one of “label”, “uuid”, “partuuid”, “diskseq”, etc.
read_mountinfo
read all the mount points
read_mounts
Read all the mount points and load basic information on them

Type Aliases§

MountId
An id of a mount