Konubinix' opinionated web of thoughts

Check Whether Storage Drive Is Dying or Not

Fleeting

authorship
this note is edited using Claude/default, governed by the note how to write a literature note
tl;dr
smartctl -x prints what a drive reports about itself, smartctl -t short and -t long start its self-tests, its normalized attributes are compared with the values at which its maker advises replacing it, and the attributes are read again after a big write.
what
note showing the method to analyse how healthy a storage drive is
what
using run/media/sam/surface as guinea pig

Reading what the drive reports about itself

how
smartctl -x « prints all SMART and non-SMART information about the device »1.

Running the self-tests

how
smartctl -t short runs the drive’s short self-test2.
how
smartctl -t long starts the drive’s extended self-test3.
how
both commands can be given while the system runs, unless run in captive mode4.
how
smartctl -l xselftest prints the log of the drive’s self-tests5.

Comparing the attributes to the maker’s criterion

how
the normalized attributes are compared with the values at which the drive’s maker advises replacing it.
example
in a paper on enterprise workloads6, Samsung advises replacing a drive once any of the normalized values of attributes 179, 181, 182 and 183 drops below 107.

Reading the attributes before and after a big write

how
the attributes are read before and after a big write, and compared.
example
Samsung’s procedure for estimating endurance reads « Record initial SMART attributes », then « Run the test », then « Record final SMART attributes »8.

Surface as the guinea pig

example
the partition mounted on /run/media/sam/surface.

findmnt -no SOURCE /run/media/sam/surface
/dev/sda1
example
its drive reports normalized values 99, 100, 100 and 99 for attributes 179, 181, 182 and 1839.
  • therefore: if this drive’s attributes mean what Samsung’s paper says, its criterion does not call for replacing surface’s drive.
    • scope: the paper does not name this model.
example
its drive reports normalized value 87 for attribute 1779.
  • what: Samsung’s paper defines that normalized value as the « Percentage of remaining P/E cycles »10.
  • therefore: if that definition holds for this drive, 87 % of its P/E cycles remain.
example
its drive’s self-test log lists a « Short offline » test « Completed without error »11.
example
between readings taken just before and just after copying a folder onto surface, the raw value of attribute 241 rose from 27760565674 to 27768495544, and the raw values of attributes 181, 182 and 183 stayed at 0, 0 and 312, 13.
  • therefore: if these attributes mean what Samsung’s paper says, its drive counted no new program fail, erase fail or runtime bad block across that copy.
example
its drive’s report, once an extended self-test has completed.

smartctl -x /dev/sda

  1. « Prints all SMART and non-SMART information about the device. » — smartctl(8), smartctl 7.5, primary. ↩︎

  2. « short - [ATA] runs SMART Short Self Test (usually under ten minutes). » — smartctl(8), smartctl 7.5, primary. ↩︎

  3. « long - [ATA] runs SMART Extended Self Test (tens of minutes to several hours). » — smartctl(8), smartctl 7.5, primary. ↩︎

  4. For short: « This command can be given during normal system operation (unless run in captive mode - see the ‘-C’ option below). » For long: « Note that this command can be given during normal system operation (unless run in captive mode - see the ‘-C’ option below). » — smartctl(8), smartctl 7.5, primary. ↩︎

  5. « xselftest[,NUM][,selftest] - [ATA only] prints the Extended SMART self-test log » — smartctl(8), smartctl 7.5, primary. ↩︎

  6. « As enterprise IO workloads vary greatly, the lifespan of an SSD is unique to every workload. » — Samsung, Using SMART Attributes to Estimate Drive Lifetime, undated, April 2016 by its file name, primary. ↩︎

  7. « The four SMART attributes listed in the table below are the most important indicators of drive health. If any of the normalized values drop below the 10% threshold, it’s recommended to replace the drive as soon as possible » / « ID | Description | Raw | Normalized | Threshold » / « 179 | Unused Reserved Block Count | […] | 10% », « 181 | Program Fail Count | Number of program fails | […] | 10% », « 182 | Erase Fail Count | Number of erase fails | […] | 10% », « 183 | Runtime Bad Count | Number of runtime bad blocks | […] | 10% » — Samsung, Using SMART Attributes to Estimate Drive Lifetime, undated, April 2016 by its file name, primary. ↩︎

  8. « The full procedure for estimating endurance and lifetime with SMART attributes consists of four steps: » / « 1. Record initial SMART attributes » / « 2. Run the test and record the duration of the test » / « 3. Record final SMART attributes » — Samsung, Using SMART Attributes to Estimate Drive Lifetime, undated, April 2016 by its file name, primary. ↩︎

  9. smartctl -x /dev/sda, run as root on surface’s drive on [2026-09-27 Sun 12:36], primary.

    ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
    177 Wear_Leveling_Count     PO--C-   087   087   000    -    87
    179 Used_Rsvd_Blk_Cnt_Tot   PO--C-   099   099   010    -    99
    181 Program_Fail_Cnt_Total  -O--CK   100   100   000    -    0
    182 Erase_Fail_Count_Total  -O--CK   100   100   000    -    0
    183 Runtime_Bad_Block       PO--C-   099   099   000    -    3
    
     ↩︎ ↩︎
  10. « ID | Description | Raw | Normalized » / « 177 | Wear Leveling Count | Consumed P/E cycles | Percentage of remaining P/E cycles » — Samsung, Using SMART Attributes to Estimate Drive Lifetime, undated, April 2016 by its file name, primary. ↩︎

  11. smartctl -c -l xselftest /dev/sda, run as root on surface’s drive on [2026-09-27 Sun], primary.

    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Short offline       Completed without error       00%         3         -
    
     ↩︎
  12. smartctl -A /dev/sda, run as root on surface’s drive on [2026-09-27 Sun], just before the copy, primary.

    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
    181 Program_Fail_Cnt_Total  0x0032   100   100   000    Old_age   Always       -       0
    182 Erase_Fail_Count_Total  0x0032   100   100   000    Old_age   Always       -       0
    183 Runtime_Bad_Block       0x0013   099   099   000    Pre-fail  Always       -       3
    241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       27760565674
    
     ↩︎
  13. smartctl -A /dev/sda, run as root on surface’s drive on [2026-09-27 Sun], just after the copy, primary.

    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
    181 Program_Fail_Cnt_Total  0x0032   100   100   000    Old_age   Always       -       0
    182 Erase_Fail_Count_Total  0x0032   100   100   000    Old_age   Always       -       0
    183 Runtime_Bad_Block       0x0013   099   099   000    Pre-fail  Always       -       3
    241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       27768495544
    
     ↩︎