18

I have a laptop with NVMe SSD:

# nvme list

Node             SN                   Model                                    Namespace Usage                      Format           FW Rev  
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     <-CENSORED->         KXG50ZNV512G NVMe TOSHIBA 512GB          1         512.11  GB / 512.11  GB    512   B +  0 B   AADA4107

S.M.A.R.T. does not tell me the usual raw values apart from the ~ 22 TB written.

# smartctl -a /dev/nvme0n1

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-74-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       KXG50ZNV512G NVMe TOSHIBA 512GB
Serial Number:                      <-CENSORED->
Firmware Version:                   AADA4107
PCI Vendor/Subsystem ID:            0x1179
IEEE OUI Identifier:                0x00080d
Total NVM Capacity:                 512,110,190,592 [512 GB]
Unallocated NVM Capacity:           0
Controller ID:                      0
Number of Namespaces:               1
Namespace 1 Size/Capacity:          512,110,190,592 [512 GB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            00080d 0500023e1d
Local Time is:                      Thu Jun  3 14:12:35 2021 CEST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     78 Celsius
Critical Comp. Temp. Threshold:     82 Celsius
Namespace 1 Features (0x02):        NA_Fields

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     6.00W       -        -    0  0  0  0        0       0
 1 +     2.40W       -        -    1  1  1  1        0       0
 2 +     1.90W       -        -    2  2  2  2        0       0
 3 -   0.0500W       -        -    3  3  3  3     1500    1500
 4 -   0.0030W       -        -    4  4  4  4    50000   80000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         2
 1 -    4096       0         1

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        35 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    9%
Data Units Read:                    63,196,994 [32.3 TB]
Data Units Written:                 43,370,182 [22.2 TB]
Host Read Commands:                 549,038,974
Host Write Commands:                420,271,939
Controller Busy Time:               2,885
Power Cycles:                       2,160
Power On Hours:                     17,684
Unsafe Shutdowns:                   211
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               35 Celsius

Error Information (NVMe Log 0x01, max 128 entries)
No Errors Logged

Also, I just looked at:

# nvme error-log /dev/nvme0n1

and it contains only 64 of these entries:

.................
error_count  : 0
sqid         : 0
cmdid        : 0
status_field : 0(SUCCESS: The command completed successfully)
parm_err_loc : 0
lba          : 0
nsid         : 0
vs           : 0
cs           : 0
.................

Question: Is it possible to evaluate the wear level of my SSD? Maybe via the Available Spare tags?

1
  • While you got the official answer, I suspect the real answer is that we have no idea until the disk fails, as the kernel docs say: unix.stackexchange.com/q/748009/59808 SSDs tend to fail "slowly, then all at once".
    – Nemo
    Commented Jun 5, 2023 at 11:48

1 Answer 1

28

The wear level is given by the “Percentage Used” field, which is specified as (page 184):

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. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. 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).

9
  • 1. Why is the percentage just a single byte? 2. Is this the result of a complex formula or simply some linear function of bytes/sectors/pages written?
    – einpoklum
    Commented Jun 3, 2021 at 21:12
  • 6
    @einpoklum: I suppose it's a wild guess, so there's really no need to use 8 bytes for a double and display 47.452345234236236 %. Commented Jun 3, 2021 at 21:33
  • 1
    @einpoklum as Eric says, it’s not supposed to be very precise. As to the formula, it’s vendor-specific; some vendors might document it (as Micron did for the “percentage lifetime used” attribute on some of their SSDs — “The average erase count of all blocks on Channel 0 CE 0 divided by the specified MaxEraseCount (10k for MLC or 100k for SLC), reported as a percentage from 0 to 100%.”), I haven’t looked. Commented Jun 4, 2021 at 4:31
  • On my Thinkpad T470, that is at least 2 years old (bought secondhand) and that it has been used daily for at least 8 hours a day during the last 2 years, the smartctl command reports a Percentage Used of 0%. Does it really mean the estimate is about the same of a brand new NVMe drive or that that estimate is not supported by my system? Commented Jan 5, 2023 at 8:56
  • 1
    @LucioCrusca I suspect it’s more likely to mean that the estimate is not supported by your drive, unless you’ve not written much to the drive. My Thinkpad’s NVMe, with 37.7TiB written, reports 2%. Commented Jan 5, 2023 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .