Checking TLER setting for linux hard drives

When using hard drives in a NAS, it’s important that the drives have a proper TLER setting. This setting tells the hard drive to stop error recovery after a certain amount of time. NAS systems have their own error recovery system, so a drive taking a long time to recover for an error can actually negatively impact the rest of the NAS array.

for drive in $(ls -la /dev | grep -E 'sd[a-z]$' | awk '{print $10}'); do echo "Checking TLER setting for drive ${drive}:"; smartctl -l scterc /dev/${drive}; echo ''; done

To turn the setting on for a drive that states it is disabled:

smartctl -l scterc,70,70 /dev/sdg