#apt-get install smartmontools
See HardDrives
#lshw -C diskor you could figure it out from
#cat /proc/partitions
See if SMART support is available and enabled
#smartctl -i /dev/sdbIf SMART support is available and not enabled
#smartctl -s on /dev/sdb
Print all SMART information that smartctl can find about a disk drive
#smartctl -a /dev/sdb
Print generic SMART capabilities and how much time would take to run Self-tests.
#smartclt -c /dev/sdb
Run a short test.
#smartctl -t short /dev/sdb smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 2 minutes for test to complete.View test statistics
#smartctl -l selftest /dev/sdb smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF READ SMART DATA SECTION === SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 15033 -
To enable the SMARTmontools Daemon set-uncomment start_smartd=yes in /etc/default/smartmontools
# grep start_smartd /etc/default/smartmontools start_smartd=yes
Configure smartd in /etc/smartd.conf You could use the directive DEVISCAN to let smartd find disk drives or list the drives you want tested explicitly. The configuration file has many examples that you can adjust to your needs eg.
#DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner /dev/sda -a m syswatch -M test /dev/sdb -a m syswatch -M test # Monitor all attributes except normalized Temperature (usually 194), # but track Temperature changes >= 4 Celsius, report Temperatures # >= 45 Celsius and changes in Raw value of Reallocated_Sector_Ct (5). # Send mail on SMART failures or when Temperature is >= 55 Celsius. /dev/sda -a -I 194 -W 4,45,55 -R 5 -m syswatch@bot.ipduh.com /dev/sdb -a -I 194 -W 4,45,55 -R 5 -m syswatch@bot.ipduh.com # A very silent check. Only report SMART health status if it fails # But send an email in this case /dev/sda -H -C 0 -U 0 -m syswatch@bot.ipduh.com /dev/sdb -H -C 0 -U 0 -m syswatch@bot.ipduh.com # A very silent check. Only report SMART health status if it fails # But send an email in this case /dev/sda -H -C 0 -U 0 -m syswatch@bot.ipduh.com /dev/sdb -H -C 0 -U 0 -m syswatch@bot.ipduh.com
/etc/init.d/smartmontools start Starting S.M.A.R.T. daemon: smartd.
Check
# tail -f /var/log/syslog |grep smartd Mar 8 11:17:26 looky smartd[8738]: Device: /dev/sdb [SAT], initial Temperature is 53 Celsius (Min/Max ??/53) Mar 8 11:17:26 looky smartd[8738]: Device: /dev/sdb [SAT], Temperature 53 Celsius reached limit of 45 Celsius (Min/Max ??/53) Mar 8 11:17:26 looky smartd[8738]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST2000DM001_9YN164-Z1E0BMF4.ata.state
SMART ... linux ...