[embed_url: https://raw.githubusercontent.com/panticz/installit/master/install.smartmontools.sh]
Show health from all SAS devices
for DISK in $(lsblk -S | grep sas | cut -d" " -f1); do
smartctl -d scsi -H /dev/${DISK}
doneCheck all discs
for SERVER in ceph{1..6}-stage.example.com; do
for DISK in sd{a..z}; do
echo ${SERVER} ${DISK}
#ssh ${SERVER} sudo smartctl --smart=on -t short /dev/${DISK}
ssh ${SERVER} sudo smartctl --smart=on -t offline /dev/${DISK}
#ssh ${SERVER} sudo smartctl -a /dev/${DISK} | grep -i failure
done
echo
doneEnable SMART on device
sudo smartctl -s on /dev/sdbShow device SMART Health status
sudo smartctl -H /dev/sdaShow device selftest log
smartctl -l selftest /dev/sdbGet info from usb data
sudo smartctl -d sat -a /dev/sdbTest
smartctl -t short /dev/sdb
smartctl -t offline /dev/sdbCalculate total writen GB from a SSD
echo "Total GB written: $(echo "scale=3; $(sudo /usr/sbin/smartctl -A /dev/sda | grep "Total_LBAs_Written" | awk '{print $10}') * 512 / $((1024*1024*1024))" | bc)"SAT pass-through Linux UAS blacklisting
lsusb | grep Seagate
echo "0x0bc2:0xab28:u" | sudo tee > /sys/module/usb_storage/parameters/quirks
smartctl -a /dev/sdd
smartctl -a -d sat /dev/sdd
Links
https://www.smartmontools.org/wiki/Supported_USB-Devices