How to check SSD life left on linux

To check ssd life left on a (solid-state drive) ssd, you will need to install the smartmontools package. It contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.) built into most modern ATA and SCSI hard disks.

For Ubuntu, Mint, or Debian based distributions

For Fedora, Centos, or Red Hat based distributions

The Media_Wearout_Indicator is what you are looking for. For 100 means your ssd has 100% life, the lower number means less life left.

Output from my laptop

233 Media_Wearout_Indicator 0×0032 100 100 000 Old_age Always – 0

If you want to see more details and full attributes from your drive, you can run

and the output

# smartctl -data -A /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-49-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0×0032 100 100 000 Old_age Always – 0
9 Power_On_Hours 0×0032 000 000 000 Old_age Always – 232959027031342
12 Power_Cycle_Count 0×0032 100 100 000 Old_age Always – 279
170 Unknown_Attribute 0×0033 100 100 010 Pre-fail Always – 0
171 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 0
172 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 0
174 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 278
184 End-to-End_Error 0×0033 100 100 090 Pre-fail Always – 0
187 Reported_Uncorrect 0×0032 100 100 000 Old_age Always – 0
192 Power-Off_Retract_Count 0×0032 100 100 000 Old_age Always – 278
225 Load_Cycle_Count 0×0032 100 100 000 Old_age Always – 10752
226 Load-in_Time 0×0032 100 100 000 Old_age Always – 65535
227 Torq-amp_Count 0×0032 100 100 000 Old_age Always – 66
228 Power-off_Retract_Count 0×0032 100 100 000 Old_age Always – 65535
232 Available_Reservd_Space 0×0033 100 100 010 Pre-fail Always – 0
233 Media_Wearout_Indicator 0×0032 100 100 000 Old_age Always – 0
241 Total_LBAs_Written 0×0032 100 100 000 Old_age Always – 10752
242 Total_LBAs_Read 0×0032 100 100 000 Old_age Always – 21803
249 Unknown_Attribute 0×0013 100 100 000 Pre-fail Always – 357

To show your sdd information (mine is Intel 520 Series Cherryville 180 GB)

smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-49-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model: INTEL SSDSC2CW180A3
Serial Number: CVCV204408A6180EGN
LU WWN Device Id: 5 001517 bb2824682
Firmware Version: 400i
User Capacity: 180,045,766,656 bytes [180 GB]
Sector Size: 512 bytes logical/physical
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 8
ATA Standard is: ACS-2 revision 3
Local Time is: Thu Jul 11 00:55:16 2013 PDT
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

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

General SMART Values:
Offline data collection status: (0×00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed

without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 2097) seconds.
Offline data collection
capabilities: (0x7f) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Abort Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0×0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0×01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 48) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0×0021) SCT Status supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0×0032 100 100 000 Old_age Always – 0
9 Power_On_Hours 0×0032 000 000 000 Old_age Always – 46385647693103
12 Power_Cycle_Count 0×0032 100 100 000 Old_age Always – 279
170 Unknown_Attribute 0×0033 100 100 010 Pre-fail Always – 0
171 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 0
172 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 0
174 Unknown_Attribute 0×0032 100 100 000 Old_age Always – 278
184 End-to-End_Error 0×0033 100 100 090 Pre-fail Always – 0
187 Reported_Uncorrect 0×0032 100 100 000 Old_age Always – 0
192 Power-Off_Retract_Count 0×0032 100 100 000 Old_age Always – 278
225 Load_Cycle_Count 0×0032 100 100 000 Old_age Always – 10754
226 Load-in_Time 0×0032 100 100 000 Old_age Always – 65535
227 Torq-amp_Count 0×0032 100 100 000 Old_age Always – 66
228 Power-off_Retract_Count 0×0032 100 100 000 Old_age Always – 65535
232 Available_Reservd_Space 0×0033 100 100 010 Pre-fail Always – 0
233 Media_Wearout_Indicator 0×0032 100 100 000 Old_age Always – 0
241 Total_LBAs_Written 0×0032 100 100 000 Old_age Always – 10754
242 Total_LBAs_Read 0×0032 100 100 000 Old_age Always – 21803
249 Unknown_Attribute 0×0013 100 100 000 Pre-fail Always – 357

SMART Error Log not supported
SMART Self-test Log not supported
Note: selective self-test log revision number (0) not 1 implies that no selective self-test has ever been run
SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0×0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

To check if TRIM is enabled on your system or not, replacing /dev/sda with your SSD device name

Comments

  1. Sirgado says:

    Thanks for your post, good info.

    I’ve run smartctl -a /dev/sdb (my SSD drive), but the Media_Wearout_Indicator attribute is missing, nor the 233 ID attribute (or E9 using hexadecimal notation). Do you know why this attribute could be missing?

    I’ve searched the web but nobody talks about that missing attribute…

  2. Sirgado says:

    Thanks for your quick reply.

    It’s a Toshiba THNSNH128GMCTm with HTGAN102 firmware version.

    • Can you post here the output of smartctl -a /dev/sda
      I think either your toshiba ssd doesnt have the 233 ID attribute or smartmontools is missing some attritubeS for your ssd in their database.

      • Sirgado says:

        This is the ouptput:

        # smartctl -a /dev/sdb
        smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.8.0-27-generic] (local build)
        Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

        === START OF INFORMATION SECTION ===
        Device Model: TOSHIBA THNSNH128GMCT
        Serial Number: 43GS103WTOLY
        LU WWN Device Id: 5 00080d b00048999
        Firmware Version: HTGAN102
        User Capacity: 128.035.676.160 bytes [128 GB]
        Sector Size: 512 bytes logical/physical
        Device is: Not in smartctl database [for details use: -P showall]
        ATA Version is: 8
        ATA Standard is: ACS-2 (revision not indicated)
        Local Time is: Sat Aug 3 21:42:02 2013 CEST
        SMART support is: Available – device has SMART capability.
        SMART support is: Enabled

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

        General SMART Values:
        Offline data collection status: (0×02) Offline data collection activity
        was completed without error.
        Auto Offline Data Collection: Disabled.
        Self-test execution status: ( 0) The previous self-test routine completed
        without error or no self-test has ever
        been run.
        Total time to complete Offline
        data collection: ( 120) seconds.
        Offline data collection
        capabilities: (0x5b) SMART execute Offline immediate.
        Auto Offline data collection on/off support.
        Suspend Offline collection upon new
        command.
        Offline surface scan supported.
        Self-test supported.
        No Conveyance Self-test supported.
        Selective Self-test supported.
        SMART capabilities: (0×0003) Saves SMART data before entering
        power-saving mode.
        Supports SMART auto save timer.
        Error logging capability: (0×01) Error logging supported.
        General Purpose Logging supported.
        Short self-test routine
        recommended polling time: ( 2) minutes.
        Extended self-test routine
        recommended polling time: ( 8) minutes.
        SCT capabilities: (0×0039) SCT Status supported.
        SCT Error Recovery Control supported.
        SCT Feature Control supported.
        SCT Data Table supported.

        SMART Attributes Data Structure revision number: 16
        Vendor Specific SMART Attributes with Thresholds:
        ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
        1 Raw_Read_Error_Rate 0x000a 100 100 000 Old_age Always – 0
        2 Throughput_Performance 0×0005 100 100 050 Pre-fail Offline – 0
        3 Spin_Up_Time 0×0007 100 100 050 Pre-fail Always – 0
        5 Reallocated_Sector_Ct 0×0013 100 100 050 Pre-fail Always – 0
        7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always – 0
        8 Seek_Time_Performance 0×0005 100 100 050 Pre-fail Offline – 0
        9 Power_On_Hours 0×0012 100 100 000 Old_age Always – 189
        10 Spin_Retry_Count 0×0013 100 100 050 Pre-fail Always – 0
        12 Power_Cycle_Count 0×0012 100 100 000 Old_age Always – 41
        167 Unknown_Attribute 0×0022 100 100 000 Old_age Always – 0
        168 Unknown_Attribute 0×0012 100 100 000 Old_age Always – 0
        169 Unknown_Attribute 0×0013 100 100 010 Pre-fail Always – 100
        170 Unknown_Attribute 0×0013 100 100 010 Pre-fail Always – 0
        173 Unknown_Attribute 0×0012 200 200 000 Old_age Always – 1128012
        174 Unknown_Attribute 0×0012 200 200 000 Old_age Always – 107374
        175 Program_Fail_Count_Chip 0×0013 100 100 010 Pre-fail Always – 0
        187 Reported_Uncorrect 0×0032 100 100 000 Old_age Always – 0
        192 Power-Off_Retract_Count 0×0012 100 100 000 Old_age Always – 13
        194 Temperature_Celsius 0×0022 041 034 000 Old_age Always – 59 (Min/Max 27/66)
        197 Current_Pending_Sector 0×0012 100 100 000 Old_age Always – 0
        240 Head_Flying_Hours 0×0013 100 100 050 Pre-fail Always – 0
        241 Total_LBAs_Written 0×0012 100 100 000 Old_age Always – 7219
        242 Total_LBAs_Read 0×0012 100 100 000 Old_age Always – 2029
        243 Unknown_Attribute 0×0012 100 100 000 Old_age Always – 0

        SMART Error Log Version: 1
        No Errors Logged

        SMART Self-test log structure revision number 1
        Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
        # 1 Extended offline Completed without error 00% 189 -
        # 2 Short offline Completed without error 00% 188 -

        SMART Selective self-test log data structure revision number 1
        SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
        1 0 0 Not_testing
        2 0 0 Not_testing
        3 0 0 Not_testing
        4 0 0 Not_testing
        5 0 0 Not_testing
        Selective self-test flags (0×0):
        After scanning selected spans, do NOT read-scan remainder of disk.

        • Interesting, maybe your TOSHIBA THNSNH128GMCT does not have 233 attribute. In that case, you can run

          -H, –health
          to check the overall health sometimes, if it gives you “PASS” so you don’t have to worry.

          This is from http://smartmontools.sourceforge.net/man/smartctl.8.html

          If the device reports failing health status, this means either that the device has already failed, or that it is predicting its own failure within the next 24 hours. If this happens, use the ‘-a’ option to get more information, and get your data off the disk and to someplace safe as soon as you can.

          • Sirgado says:

            Sad, it’s always good to know how much time left you got ;)

            Anyway if I find some way to get the information I’ll post here.

            Thank you very much for your time Nam.

          • I found this at smartctl page. “projected by the manufacturer” so toshiba does not include the 233 attribute for your ssd.

            ssd – [SCSI] prints the Solid State Media percentage used endurance indicator. A value of 0 indicates as new condition while 100 indicates the device is at the end of its lifetime as projected by the manufacturer. The value may reach 255.

            Even though it’s good to know how much time the ssd’s life left. Those numbers are just to predict when they will fail. It’s not 100% accurate. Have you done any tune up for ssd on your machine? like move logs, temp files to ram, mount “noatime”, move browsers caches to ram …. ? Those little things will help your ssd to live longer.

  3. Sirgado says:

    No, I have done no tune up, because I’ve read that latest drives are very long, so my plan was to use the system for a month or so and check the wear out indicator to aproximately know if it’s worth tune up the drive.

    I’ll tune it to minimize risks.

Leave a Reply