S.M.A.R.T.: Difference between revisions

From David's Wiki
Line 5: Line 5:
* Add <code>-d sat</code>
* Add <code>-d sat</code>


For some seagate hard drives, it will run in uas mode and smart won't work.   
For Seagate USB hard drives, it will run in uas mode and smart won't work.   
See [https://www.smartmontools.org/wiki/SAT-with-UAS-Linux https://www.smartmontools.org/wiki/SAT-with-UAS-Linux].   
See [https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive].   
To fix this, you can find your id by looking in <code>/var/log/kern.log</code> and filling in:
To fix this:
<pre>
# Run <code>lsusb</code> to find the id of your HDD
GRUB_CMDLINE_LINUX="usb_storage.quirks=0bc2:[id]:u"
#* It should start with <code>0bc2</code>.
</pre>
# Create file <code>/etc/modprobe.d/ignore_uas.conf</code> and add this following:
 
#* <pre>options usb-storage quirks=[ids]</pre>
* Multiple hard drives should be comma separated:
#* E.g. <code>options usb-storage quirks=0bc2:ab31:,0bc2:a0a4:</code>
** E.g. <code>0bc2:abcd:u,0bc2:efgh:u</code>
# Run <code>sudo update-initramfs -u</code>
* <code>0bc2</code> is the manufacturer id for Seagate drives.
# Reboot


===Remote monitoring===
===Remote monitoring===

Revision as of 03:40, 28 February 2021

SMART Testing

smartctl

USB Hard Drives

  • Add -d sat

For Seagate USB hard drives, it will run in uas mode and smart won't work.
See https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive.
To fix this:

  1. Run lsusb to find the id of your HDD
    • It should start with 0bc2.
  2. Create file /etc/modprobe.d/ignore_uas.conf and add this following:
    • options usb-storage quirks=[ids]
    • E.g. options usb-storage quirks=0bc2:ab31:,0bc2:a0a4:
  3. Run sudo update-initramfs -u
  4. Reboot

Remote monitoring

See Reference

  1. Install the following:
    sudo apt install mailutils msmtp msmtp-mta smartmontools
  2. Edit /etc/smartd.conf
  3. Add some options

See smartd.conf reference

Example:

/dev/disk/by-id/usb-WD_easystore_264D_394B47573334314C-0:0 -s (S/../../6/01) -a -m [email protected] -M test -M daily
  • -a turns on some defaults for checking smart attributes
  • -M Test sends a test email when smartd starts
  • -M daily sends daily reminders for failures
  • -s (S/../../6/01) runs a short test every saturday at 1AM.

gsmartcontrol

gsmartcontrol is a GUI frontend for smartctl