10 releases

0.3.1 Jan 25, 2023
0.3.0 Jun 2, 2020
0.2.0 May 19, 2020
0.1.7 May 19, 2020
0.1.2 Feb 18, 2016

#1249 in Filesystem

32 downloads per month

MIT license

16KB
291 lines

libatasmart

Rust friendly interface for libatasmart-sys Docs

Using libatasmart might require some compiling. If you're using ubuntu you can install libatasmart-dev and that should be sufficient. Otherwise head on over to http://git.0pointer.net/libatasmart.git/ and pull down the latest copy of the code. Follow the readme instructions in there to get yourself a libatasmart shared library installed. From there this code should work fine.

The backing C library for this code was written roughly 14yrs ago and hasn't really been updated since. If anyone is interested I think it would be worth rewriting this wrapper interface to parse the data blobs given back by the hard drives directly and then just remove the C dependency all together.


lib.rs:

A library to interface with libatasmart-sys. For more information about libatasmart-sys see libatasmart-sys This library is useful for gathering ata smart information from your hard drives concerning their remaining lifetime. The underlying libatasmart doesn't expose every possible metric like smartmontools but it does expose a few important ones like bad sector count and overall status. This also has the advantage of avoiding CLI calls and scraping the text output which makes it more reliable and also a lot more performant!

Dependencies

~1.5MB
~34K SLoC