harddisks… are blackboxes of data – if something fails… you do not repair – you replace.

65% of all harddisk failurs can be announced with smart. wohoo! so don’t rely on it 😀

apt-get install smartmontools
# some commands
smartctl /dev/sda -i
smartctl -a /dev/sda
smartctl -H /dev/sda

# enable permanent supervision
vim /etc/default/smartmontools; # change those lines
# Defaults for smartmontools initscript (/etc/init.d/smartmontools)
# This is a POSIX shell fragment

# List of devices you want to explicitly enable S.M.A.R.T. for
# Not needed (and not recommended) if the device is monitored by smartd
enable_smart="/dev/sda"

# uncomment to start smartd on system startup
start_smartd=yes

# uncomment to pass additional options to smartd on startup
smartd_opts="--interval=1800"

# save and quit
/etc/init.d/smartmontools start
/etc/init.d/smartmontools status

grep smartd /var/log/syslog; # of course this does not work on hyper-v virtual disks :-D
Jul 10 14:09:29 debian9 smartd[2214]: smartd 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0cuztom] (local build)
Jul 10 14:09:29 debian9 smartd[2214]: Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Jul 10 14:09:29 debian9 smartd[2214]: Opened configuration file /etc/smartd.conf
Jul 10 14:09:29 debian9 smartd[2214]: Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf
Jul 10 14:09:29 debian9 smartd[2214]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sda, opened
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sda, [Msft Virtual Disk 1.0 ], lu id: 0x600224809dc1e216e67567192f1dfd5d, 136 GB
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sda, Bad IEC (SMART) mode page, err=5, skip device
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sdb, opened
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sdb, [Msft Virtual Disk 1.0 ], lu id: 0x60022480e1ae953e1aeb2f0ea469dca8, 136 GB
Jul 10 14:09:29 debian9 smartd[2214]: Device: /dev/sdb, Bad IEC (SMART) mode page, err=5, skip device
Jul 10 14:09:29 debian9 smartd[2214]: Unable to monitor any SMART enabled devices. Try debug (-d) option. Exiting...
Jul 10 14:09:29 debian9 systemd[1]: smartd.service: Main process exited, code=exited, status=17/n/a
Jul 10 14:09:29 debian9 systemd[1]: smartd.service: Unit entered failed state.
Jul 10 14:09:29 debian9 systemd[1]: smartd.service: Failed with result 'exit-code'.
admin