2

I was casually using smartctl to peek on my disks without really diving in. After reading a comment on Hacker News I decided to schedule daily short and weekly long tests.

How to actually make good use of them?

When I look at the results of smartctl -a /dev/sda, I see a lot of information which is not immediately obvious:

# smartctl -a /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-32-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs
Device Model:     Crucial_CT500MX200SSD4
Serial Number:    160311862C1C
LU WWN Device Id: 5 00a075 111862c1c
Firmware Version: MU03
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      < 1.8 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Sep  3 10:49:49 2018 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:  (0x80) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Enabled.
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:                ( 1271) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (   7) minutes.
Conveyance self-test routine
recommended polling time:        (   3) minutes.
SCT capabilities:              (0x0035) SCT Status 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     0x002f   100   100   000    Pre-fail  Always       -       0
  5 Reallocate_NAND_Blk_Cnt 0x0032   100   100   010    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       16446
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       44
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Ave_Block-Erase_Count   0x0032   094   094   000    Old_age   Always       -       139
174 Unexpect_Power_Loss_Ct  0x0032   100   100   000    Old_age   Always       -       29
180 Unused_Reserve_NAND_Blk 0x0033   000   000   000    Pre-fail  Always       -       5548
183 SATA_Interfac_Downshift 0x0032   100   100   000    Old_age   Always       -       0
184 Error_Correction_Count  0x0032   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   058   049   000    Old_age   Always       -       42 (Min/Max 23/51)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       0
202 Percent_Lifetime_Used   0x0030   094   094   001    Old_age   Offline      -       6
206 Write_Error_Rate        0x000e   100   100   000    Old_age   Always       -       0
210 Success_RAIN_Recov_Cnt  0x0032   100   100   000    Old_age   Always       -       0
246 Total_Host_Sector_Write 0x0032   100   100   000    Old_age   Always       -       15420692355
247 Host_Program_Page_Count 0x0032   100   100   000    Old_age   Always       -       481912759
248 Bckgnd_Program_Page_Cnt 0x0032   100   100   000    Old_age   Always       -       1753257160

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  Short offline       Completed without error       00%     16446         -
# 2  Short offline       Completed without error       00%     10532         -
# 3  Short offline       Completed without error       00%      8040         -
# 4  Vendor (0xff)       Completed without error       00%      3608         -
# 5  Vendor (0xff)       Completed without error       00%       597         -
# 6  Vendor (0xff)       Completed without error       00%       585         -
# 7  Vendor (0xff)       Completed without error       00%       520         -
# 8  Vendor (0xff)       Completed without error       00%       161         -
# 9  Vendor (0xff)       Completed without error       00%        98         -
#10  Vendor (0xff)       Completed without error       00%        65         -

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  Completed [00% left] (57881389-57946924)
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  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.

Specifically, there is no clear indication of

  • errors
  • history of tests

Beside running a smartctl -a /dev/sdX from time to time and hope to recognize any unusual events, is there a best practice for analysis?

WoJ
  • 1,445
  • 1
  • 19
  • 38

2 Answers2

4

If you have configured smartmontools so that it can send you email, you’ll get email if it ever spots a problem.

Apart from that, errors and logs are visible in smartctl’s output. I tend to look at the “Offline_Uncorrectable” field first, since non-zero there means there are defects in the medium which the drive can’t do anything about (in your case, with an SSD, it usually means that the drive has run out of replacement flash for cells which have died). Other attributes indicate read or write errors, but their significance can depend on the cause of the error.

Drive errors are also logged in the error log:

SMART Error Log Version: 1
No Errors Logged

and test results in the test log:

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     16446         -
# 2  Short offline       Completed without error       00%     10532         -
# 3  Short offline       Completed without error       00%      8040         -
# 4  Vendor (0xff)       Completed without error       00%      3608         -
# 5  Vendor (0xff)       Completed without error       00%       597         -
# 6  Vendor (0xff)       Completed without error       00%       585         -
# 7  Vendor (0xff)       Completed without error       00%       520         -
# 8  Vendor (0xff)       Completed without error       00%       161         -
# 9  Vendor (0xff)       Completed without error       00%        98         -
#10  Vendor (0xff)       Completed without error       00%        65         -

Here you want tests marked “Completed without error”, with a lifetime field which is not too far from the drive’s current lifetime (depending on the test schedule). In your case, the drive’s lifetime is 16446 hours and you have a test which just completed. You also want to see extended offline tests regularly, since that’s when certain attributes are updated (e.g. offline uncorrectable).

I tend to use smartctl -x rather than smartctl -a, it shows even more information.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
1

The smart technology started on magnetic disks about dozen years ago with internaly logging the potential problems on the surface. You are using SSD disk which is based on quite different technology (fomerly known as Electricaly Erasable Programable ROM). The data are written in blocks called sectors on magnetic disk while on SSD the data are written in bigger blocks and before the block is written (in fact programmed) it must be erased. Erasing the block makes the small damage to the block elements and therefore the firmware tries to spread the writes (=erasings=damages) evently over all the blocks because the amount of wirites to the same block is limited (SLC about 100000 times, MLC about 5000 times, TLC about 300 time only).

Well, the errors reported with the smartctl has other meaning for both of the basic thechnology. At magnetic disk you need to check the Current_Pending_Sector what indicate the bad written (unreadable) data (ID 197) and Reallocated_sector_count (ID 5) what indicate the poor magnetic surface and also the ID 194 Temperature_Celsius. While at SSD the ID 5 is renamed to Reallocate_NAND_Blk_Cnt what showes the number of blocks out of livetime.

In both cases the simple existence of a few bad blocks (sectors) does not necessarily mean the disk is out. The problem may be either when a lot of faulty blocks suddenly appears or if their number is growing day by day.

The livetime of magnetic disk could be extended with the carefull choice of a good brand and type for the supposed use (server 24x7, desktop, videorecorder) and supporting it with as good conditionas as is possible (fan for decrease the temperature, enough of power, strictly horizontal or vertical position).

The livetime of SSD disk can be extended with the choice of SLC (slower but better) - today you can buy the MLC only, but even those can has longer live than TLC. And do any possible restriction of needless writes. So you have to move out of it the swap (pagefile.sys) to a magnetic disk as the user directory (homes) and log files. At linux you can extra add the noatime, nodiratime mount options. And often make backups! Checking the smart regularly can be helpful but cannot give you back the lost data.

schweik
  • 1,160
  • 8
  • 16