Skip to content

Instantly share code, notes, and snippets.

@meinside
Last active October 17, 2024 17:32
Show Gist options
  • Save meinside/0538087cc60a2f0654bb to your computer and use it in GitHub Desktop.
Save meinside/0538087cc60a2f0654bb to your computer and use it in GitHub Desktop.
For checking health of usb hdd on raspberry pi with smartctl.

for testing external hdd with smartctl,

install smartmontools

$ sudo apt-get install smartmontools

start test,

#$ sudo smartctl -t short -d sat /dev/sda
$ sudo smartctl -t long -d sat /dev/sda -T permissive

then it will say

Testing has begun.
Please wait 100 minutes for test to complete.
Test will complete after Thu Oct  6 11:36:22 2016

so wait for it...

After its completion,

$ sudo smartctl -l selftest -d sat /dev/sda -T permissive

to see the test result.

@thebigmacburger
Copy link

NVME drives need something like sudo smartctl -t long -d nvme /dev/nvme0 -T permissive to start the test and sudo smartctl -l selftest -d nvme /dev/nvme0 -T permissive to see the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment