README.md
1# README #
2
3### What is this repository for? ###
4
5* Application to output the SMART values of disks
6
7### How do I get set up? ###
8
9Clone this repository onto a FreeBSD box and run make
10
11 $ git clone https://github.com/ctuffli/smart
12 $ cd smart && make
13
14or install it from ports ( http://www.freshports.org/sysutils/smart/ )
15
16### How to use
17 Usage: smart [-htxi] [-a attribute[,attribute]...] <device name>
18 -h, --help
19 -t, --threshold : also print out the threshold values
20 -x, --hex : print the values out in hexadecimal
21 -a, --attribute : print a specific attribute(s)
22 -i, --info : print general device information
23 -d, --decode: decode the attribute IDs
24 -D, --no-decode: don't decode the attribute IDs
25 -v, --version : print the version and copyright
26
27### Example
28* List the raw attributes of SATA device /dev/ada0
29
30 smart ada0
31
32* List the decoded attributes of NVMe device /dev/nda0
33
34 smart -d nda0
35
36 or
37
38 diskhealth nda0
39
40### What does the raw output mean?
41The format and location of SMART / health data varies across protocols.
42To simplify the output, the application uses a Dumb Unified Model of
43SMART Buffers. In this model, SMART data is located in one or more log
44pages. Each page contains one or more values ("attributes")
45differentiated by an ID. Note that ID's are only unique within a log
46page. Thus, the application outputs:
47
48 <Log Page ID> <Attribute ID> <Attribute value>
49for each selected attribute. Threshold values, if defined by the protocol
50and selected by the user, are printed after the attribute value.
51
52See the shell scripts `atasmart`, `nvmesmart`, and `scsismart` for examples of parsing the output.
53
54### What is the decoded output?
55Decoded output converts numeric values (Log Page, Attribute ID and Value tuples) into human-readable descriptions.
56
57The output for protocols like NVMe and SCSI which provide standardized descriptions will match the text in the specification. ATA, however, allows vendors to define their own attributes. For ATA, descriptions come from the "SMART Attribute Descriptions (SAD)" (ANSI - INCITS TR-54) specification which documents attributes common to multiple ATA drive vendors.
58
59### Protocol Specific Notes
60* __ATA__ : The attribute and values follow the 'standard'. The log page is the Feature value used in ATA command. Thus, the default page is 208 / 0xd0 (a.k.a SMART Read Data). The threshold values printed are status flags, current value, and worst value. The SMART Return Status (Feature 218 / 0xda) indicates the reliability status of the device and is sometimes used as a top-level SMART health indication. While this command does not return data, the application encodes "no errors" as 0x0 and "threshold exceeded" as 0x1 in attribute 0.
61* __NVMe__ : The Log Page is the SMART / Health Information LID value in the Get Log Page command (i.e. 0x2). The attribute ID is the byte offset within this page.
62* __SCSI__ : The Log Page ID is the Page Code value in the Mode Sense command. The attribute ID is the parameter code defined by this page (e.g. 0 in the Write Error Counters log page is 'Errors corrected without substantial delay'). The values will depend on the Page Codes supported by a drive.
63