Skip to content

Instantly share code, notes, and snippets.

@pauloeli
Created February 21, 2023 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauloeli/9f92bfcaf65908732652064731787c3c to your computer and use it in GitHub Desktop.
Save pauloeli/9f92bfcaf65908732652064731787c3c to your computer and use it in GitHub Desktop.
Disks Health in Linux

On Debian-based computers execute:

apt-get install smartmontools

However when I execute the command to show the drive info, it looks like SMART was disabled:

smartctl -a /dev/sda 

SMART support is: Available - device has SMART capability.
SMART support is: Disabled

You need to enable that by executing the following as root:

smartctl -s on -a /dev/sda

You can then execute a self-test by doing either a short test (which took me about 1 minute):

smartctl -t short -a /dev/sda

or a more thorough test (which took me about 1.5 hours):

smartctl -t long -a /dev/sda

Note, in most circumstances you do not need to unmount the drive to execute these tests. If you do, see man smartctl.

Now, when you execute smartctl -a /dev/sda you should then see a self-assessment test result. This is probably all you really need to concern yourself with:

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
If you like details, you will also see a table like this:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x0032   095   095   050    Old_age   Always       -       0/178007034
  5 Retired_Block_Count     0x0033   100   100   003    Pre-fail  Always       -       0
  9 Power_On_Hours_and_Msec 0x0032   092   092   000    Old_age   Always       -       7626h+46m+45.580s
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       8
171 Program_Fail_Count      0x000a   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
174 Unexpect_Power_Loss_Ct  0x0030   000   000   000    Old_age   Offline      -       4
177 Wear_Range_Delta        0x0000   000   000   000    Old_age   Offline      -       1
181 Program_Fail_Count      0x000a   100   100   000    Old_age   Always       -       0
182 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0012   100   100   000    Old_age   Always       -       0
189 Airflow_Temperature_Cel 0x0000   030   035   000    Old_age   Offline      -       30 (Min/Max 24/35)
194 Temperature_Celsius     0x0022   030   035   000    Old_age   Always       -       30 (Min/Max 24/35)
195 ECC_Uncorr_Error_Count  0x001c   120   120   000    Old_age   Offline      -       0/178007034
196 Reallocated_Event_Count 0x0033   100   100   003    Pre-fail  Always       -       0
201 Unc_Soft_Read_Err_Rate  0x001c   120   120   000    Old_age   Offline      -       0/178007034
204 Soft_ECC_Correct_Rate   0x001c   120   120   000    Old_age   Offline      -       0/178007034
230 Life_Curve_Status       0x0013   100   100   000    Pre-fail  Always       -       100
231 SSD_Life_Left           0x0013   100   100   010    Pre-fail  Always       -       0
233 SandForce_Internal      0x0032   000   000   000    Old_age   Always       -       3498
234 SandForce_Internal      0x0032   000   000   000    Old_age   Always       -       2885
241 Lifetime_Writes_GiB     0x0032   000   000   000    Old_age   Always       -       2885
242 Lifetime_Reads_GiB      0x0032   000   000   000    Old_age   Always       -       868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment