Skip to content

A rust library (crate) for listing mounted or mountable drives on linux (flash drives, sd-cards, etc.)

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

sorcerersr/drives

Repository files navigation

Build and Tests codecov crates.io docs.rs

drives

A rust library (crate) for listing mounted or mountable drives on linux (flash drives, sd-cards, etc.)

Uses the virtual kernel filesystems (/sys, /proc and /dev) to gather information about the block devices known by the linux kernel. Optionally reads the GUID Partition Table (GPT) to enrich gathered data with informations from the partition table.

Data

  • devices
    • name
    • model, serial
    • size
    • partitions
    • is removable
    • uuid (optionally from GPT)
  • partition
    • name
    • size
    • mountpoint (path, filesystem)
    • part_uuid (optionally from GPT)

Example

For an simple example see simple_main.rs:

cargo run --example simple_main

Optional Data from GUID Partition Table (GPT)

Currently only the UUID for a device and the PART_UUID of partitions are retreived using the GPT. This needs the feature "gpt" to be enabled.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

About

A rust library (crate) for listing mounted or mountable drives on linux (flash drives, sd-cards, etc.)

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages