Crate block_utils

source ·

Modules

Structs

Enums

Functions

  • Synchronous utility to format a block device with a given filesystem. Note: ZFS creation can be slow because there’s potentially several commands that need to be run. async_format_block_device will be faster if you have many block devices to format
  • Returns device info on every device it can find in the devices slice The device info may not be in the same order as the slice so be aware. This function is more efficient because it only call udev list once
  • Returns iterator over device info on every device it can find in the devices slice The device info may not be in the same order as the slice so be aware. This function is more efficient because it only call udev list once
  • Get properties for device with devpath device_path (like “/dev/sda”) if present
  • Get property value by key tag for device with devpath device_path (like “/dev/sda”) if present
  • Scan a system and return all block devices that udev knows about This function will skip udev devices identified as partition. If it can’t discover this it will error on the side of caution and return the device
  • Scan a system and return iterator over all block devices that udev knows about This function will skip udev devices identified as partition. If it can’t discover this it will error on the side of caution and return the device
  • Scan a system and return all block devices that udev knows about This function will only retun the udev devices identified as partition. If it can’t discover this it will error on the side of caution and return the device
  • Scan a system and return iterator over all block devices that udev knows about This function will only retun the udev devices identified as partition. If it can’t discover this it will error on the side of caution and return the device
  • Get the children devices paths from a device path
  • Get the children devices paths from a device path Note: It has square algorithmic complexity
  • returns the device info and possibly partition entry for the device with the path or symlink given
  • Returns device information that is gathered with udev.
  • Parse mtab and return the device which is mounted at a given directory
  • Parse mtab and return all mounted block devices not including LVM
  • Parse mtab and return iterator over all mounted block devices not including LVM
  • Parse mtab and return the mountpoint the device is mounted at. This is the opposite of get_mount_device
  • get the parent device path from a device path (If not a partition or disk, return None)
  • Gathers all available scsi information
  • Checks to see if the subsystem this device is using is block
  • check if the path is a disk device path
  • Checks and returns if a particular directory is a mountpoint
  • Utility function to mount a device at a mount point NOTE: This assumes the device is formatted at this point. The mount will fail if the device isn’t formatted.
  • Examine the ScsiInfo devices and associate a host ScsiInfo device if it exists
  • Examine the ScsiInfo devices and associate a host ScsiInfo device if it exists

Type Aliases