Ubuntu 20.04 LTS
smartctl
$ sudo apt update && sudo apt upgrade
$ sudo apt install smartmontools
$ sudo smartctl -V
$ sudo smartctl -h
$ lsblk |grep -v ^loop # Tells to exclude any with keyword 'loop'.
$ sudo smartctl --info /dev/sda
$ sudo smartctl --all /dev/sda
$ sudo smartctl --health /dev/sda
$ sudo smartctl -s on /dev/sda # Turn on SMART features on your hard drive.
$ sudo smartctl -i /dev/sda # Show identity information for device.
$ sudo smartctl -t short -a /dev/sda # Run a short test on the drive.
$ sudo smartctl -t long -a /dev/sda # Run a short test on the drive.
$ sudo smartctl -c /dev/sda # Show device SMART capabilities.
$ sudo smartctl -X /dev/sda # Abort any non-captive test on devic.
$ sudo smartctl -d ata -H /dev/sda # To test the overall health of the drive.
$ sudo smartctl -l selftest /dev/sda # Print the self-test result.
$ sudo smartctl -l error /dev/sda # To print only the error log.
smartd
$ sudo systemctl enable/disable smartd
$ sudo systemctl start/stop/restart/status smartd
$ sudo vim /etc/default/smartmontools
smartd_opts="--interval=7200" # Specify intervals in seconds
$ sudo vim/etc/smartd.conf
/dev/sda -m admin@example.com -M test
/dev/sda {
-d sat
-m admin@example.com
-M exec "/usr/bin/logger -t smartd -p daemon.warning"
}
QDiskinfo
QDiskInfo is a frontend for smartctl (part of the smartmontools package). It provides a user experience similar to CrystalDiskInfo. It shows the SMART (Self-Monitoring, Analysis, and Reporting Technology) data of modern hard disk drives.
CentOS 7
# yum -y install smartmontools
# smartctl --version
# smartctl -i /dev/sda #This will give you brief information about your drive.
# smartctl -H /dev/sda
# smartctl -A /dev/sda
# smartctl -a /dev/sda
# smartctl –smart=on –offlineauto=on –saveauto=on /dev/sda
# badblocks -v -s /dev/sdl > resultl.txt
# mount -o remount rw /
# vi /etc/fstab
# mount -a