libnvme(9)
β¨ libnvme(9) β API Manual β¨
okay bestie, buckle up π this is libnvme(9), and it's the page about the big one β the SMART / Health Information Log. it's giving "your SSD's annual checkup but make it a data structure" π©Ίβ¨
π NAME π
struct nvme_smart_log β the SMART / Health Information Log, a.k.a. Log Identifier 02h π
like, this is the struct where your drive spills all its health tea: how hot it's running, how much life it's got left, how many times you yanked the power like a menace π literally everything the SMART log carries lives in here, fr fr.
π©Ί SYNOPSIS π©Ί
no cap, here's the whole struct, exactly as it is β don't touch a single byte bestie, this is a hardware layout β¨
struct nvme_smart_log {
__u8 critical_warning;
__u8 temperature[2];
__u8 avail_spare;
__u8 spare_thresh;
__u8 percent_used;
__u8 endu_grp_crit_warn_sumry;
__u8 informative_warning;
__u8 rsvd8[24];
__u8 data_units_read[16];
__u8 data_units_written[16];
__u8 host_reads[16];
__u8 host_writes[16];
__u8 ctrl_busy_time[16];
__u8 power_cycles[16];
__u8 power_on_hours[16];
__u8 unsafe_shutdowns[16];
__u8 media_errors[16];
__u8 num_err_log_entries[16];
__le32 warning_temp_time;
__le32 critical_comp_time;
__le16 temp_sensor[8];
__le32 thm_temp1_trans_count;
__le32 thm_temp2_trans_count;
__le32 thm_temp1_total_time;
__le32 thm_temp2_total_time;
__le64 op_lifetime_energy_consumed;
__le32 interval_power_measurement;
__u8 rsvd244[268];
};
πΈ MEMBERS πΈ
every field got its own little moment, so let's go down the list one by one, main-character energy only π
π critical_warning
so this one is literally the drive yelling "hey bestie something's wrong" π¨ it tells you about critical warnings for the state of the controller, and those warnings may result in an asynchronous event notification to the host (drama π ).
the bits in this field represent the current associated state and are not persistent β meaning they're a vibe check, not a permanent record. see enum nvme_smart_crit for what all the bits mean iykyk.
π‘οΈ temperature
Composite Temperature β this holds a value corresponding to a temperature in Kelvins that represents the current composite temperature of the controller and the namespace(s) associated with that controller β¨
and here's the tea: the manner in which this value is computed is implementation specific, and it may not represent the actual temperature of any physical point in the NVM subsystem π like, it's an average-ish vibe the firmware decided on, not a probe.
warning and critical overheating composite temperature threshold values are reported by the WCTEMP and CCTEMP fields in the Identify Controller data structure π
π avail_spare
Available Spare β contains a normalized percentage (0% to 100%) of the remaining spare capacity available π so basically how much backup real estate the drive still has in the tank.
π spare_thresh
Available Spare Threshold β when the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur β οΈ the value is indicated as a normalized percentage (0% to 100%). the values 101 to 255 are reserved β don't go there, bestie, that's not your lane.
π₯ percent_used
Percentage Used β contains a vendor specific estimate of the percentage of NVM subsystem life used, based on the actual usage and the manufacturer's prediction of NVM life.
so the important bits, no skipping:
- a value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed β but that may not indicate an NVM subsystem failure π«Ά so don't panic-spiral, it's a prediction not a death sentence
- the value is allowed to exceed 100 π³
- percentages greater than 254 shall be represented as 255
- this value shall be updated once per power-on hour (when the controller is not in a sleep state)
π endu_grp_crit_warn_sumry
Endurance Group Critical Warning Summary β this field indicates critical warnings for the state of Endurance Groups. the bits in this field represent the current associated state and are not persistent (see enum nvme_smart_egcw) π
π informative_warning
Informative Warning β this field indicates warnings that the host may choose to act upon π the bits in this field are not persistent, see enum nvme_smart_infw.
π rsvd8
Reserved β nothing to see here bestie, eyes off β
π data_units_read
Data Units Read β contains the number of 512 byte data units the host has read from the controller; this value does not include metadata β¨
the fine print, because detail is the whole point:
- the value is reported in thousands β i.e. a value of
1corresponds to 1000 units of 512 bytes read - and it's rounded up β e.g.
oneindicates that the number of 512 byte data units read is from 1 to 1000,threeindicates that the number of 512 byte data units read is from 2001 to 3000 π’ - when the LBA size is a value other than 512 bytes, the controller shall convert the amount of data read to 512 byte units
- for the NVM command set, logical blocks read as part of Compare, Read, and Verify operations shall be included in this value
- a value of
0hin this field indicates that the number of Data Units Read is not reported β so0his "no data", not "zero reads", okay? π
βοΈ data_units_written
Data Units Written β contains the number of 512 byte data units the host has written to the controller; this value does not include metadata π
same energy as above:
- reported in thousands β i.e. a value of
1corresponds to 1000 units of 512 bytes written - rounded up β e.g.
oneindicates that the number of 512 byte data units written is from 1 to 1,000,threeindicates that the number of 512 byte data units written is from 2001 to 3000 - when the LBA size is a value other than 512 bytes, the controller shall convert the amount of data written to 512 byte units
- for the NVM command set, logical blocks written as part of Write operations shall be included in this value
- Write Uncorrectable commands and Write Zeroes commands shall not impact this value π
- a value of
0hin this field indicates that the number of Data Units Written is not reported
π₯ host_reads
Host Read Commands β contains the number of read commands completed by the controller. for the NVM command set, this value is the sum of the number of Compare commands and the number of Read commands π
π€ host_writes
Host Write Commands β contains the number of write commands completed by the controller. for the NVM command set, this is the number of Write commands β¨
β³ ctrl_busy_time
Controller Busy Time β contains the amount of time the controller is busy with I/O commands π« and "busy" has a very specific definition here, so listen up:
the controller is busy when there is a command outstanding to an I/O Queue β specifically, a command was issued via an I/O Submission Queue Tail doorbell write and the corresponding completion queue entry has not been posted yet to the associated I/O Completion Queue π
this value is reported in minutes β±οΈ
π power_cycles
Power Cycles β contains the number of power cycles. that's it, that's the field, iconic β¨
β° power_on_hours
Power On Hours β contains the number of power-on hours. this may not include time that the controller was powered and in a non-operational power state π΄ so sleepy-time might not count, ngl.
π unsafe_shutdowns
Unsafe Shutdowns β contains the number of unsafe shutdowns π this count is incremented when a Shutdown Notification (CC.SHN) is not received prior to loss of power. basically: every time you held the power button instead of shutting down properly, this field remembers π«£
𧨠media_errors
Media and Data Integrity Errors β contains the number of occurrences where the controller detected an unrecovered data integrity error π¨ errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.
errors introduced as a result of a Write Uncorrectable command may or may not be included in this field β so it's a maybe, not a guarantee, iykyk π
π num_err_log_entries
Number of Error Information Log Entries β contains the number of Error Information log entries over the life of the controller π a whole lifetime of receipts.
π‘οΈ warning_temp_time
Warning Composite Temperature Time β contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure π₯
and the caveat, which matters: if the value of the WCTEMP or CCTEMP field is 0h, then this field is always cleared to 0h regardless of the Composite Temperature value π
π¨ critical_comp_time
Critical Composite Temperature Time β contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure π
same caveat bestie: if the value of the CCTEMP field is 0h, then this field is always cleared to 0h regardless of the Composite Temperature value β¨
π‘οΈ temp_sensor
Temperature Sensor 1-8 β contains the current temperature in degrees Kelvin reported by temperature sensors 1-8 π
the physical point in the NVM subsystem whose temperature is reported by the temperature sensor and the temperature accuracy is implementation specific π and an implementation that does not implement the temperature sensor reports a value of 0h.
π thm_temp1_trans_count
Thermal Management Temperature 1 Transition Count β contains the number of times the controller transitioned to lower power active power states or performed vendor specific thermal management actions while minimizing the impact on performance in order to attempt to reduce the Composite Temperature because of the host controlled thermal management feature (i.e., the Composite Temperature rose above the Thermal Management Temperature 1) π₯΅
the deets:
- this counter shall not wrap once the value
FFFFFFFFhis reached π - a value of
0hindicates that this transition has never occurred or this field is not implemented
π thm_temp2_trans_count
Thermal Management Temperature 2 Transition Count
okay that's where part 1 wraps, bestie β the log keeps going and so do we π
thm_temp1_total_timeβ Total Time For Thermal Management Temperature 1, and bestie it is literally a stopwatch for the controller's chill era π It holds the number of seconds the controller spent transitioning to lower power active power states, or doing vendor specific thermal management actions β all while minimizing the impact on performance β in order to attempt to reduce the Composite Temperature, because of the host controlled thermal management feature. So yeah, it's the "how long did we vibe in low-power mode to cool down" counter π₯β‘οΈπ§
Heads up: this counter shall not wrap once the valueFFFFFFFFhis reached. And a value of0h,means either this transition has never occurred or this field is not implemented.
thm_temp2_total_timeβ Total Time For Thermal Management Temperature 2. Yeah that's it, that's the whole description π«Ά (the man page keeps it short and so do we, no invented lore, periodt).op_lifetime_energy_consumedβ Operational Lifetime Energy Consumed β‘ this one's iconic: it contains the cumulative operational energy consumed by the NVM subsystem in watt-hours, calculated from all interval power measurements collected from the time of manufacture all the way up to the point that this log page is read. It's giving "full life story, but in joules-adjacent units" π
The value is rounded up β like, two means the number of watt-hours consumed is greater than 1 and less than or equal to 2. Sneaky but documented π
This field shall not wrap once the valueFFFFFFFFFFFFFFFFhis reached. And a value of0hindicates that the cumulative operational energy consumed is not reported. No cap.
interval_power_measurementβ Interval Power Measurement πΈ contains the average of power measurement samples over the most recent one second interval at the time of processing the Get Log Page command. The math is giving main character energy:- The power in Watts equals the Interval Power Measurement Value (bits 15:0) multiplied by the scale indicated in the Interval Power Measurement Scale field (bits 17:16) β¨
And a value of 0h indicates that the interval power measurement is not reported π
rsvd244β Reserved. It's reserved, bestie, it's just sitting there being mysterious π do not perceive it, do not write to it, iykyk.
okay that's the whole struct nvme_smart_log dump and honestly? ate π
This page came from the struct nvme_smart_log source in the libnvme manual, dated October 2026 β so go forth, read your SMART log, and slay responsibly ππ
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms