Updated: 28 September 2026 · Applies to: smartmontools 7.2 to 7.4 on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13 (dedicated servers with SATA, SAS or NVMe drives)
Hard disks and SSDs track their own health with S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology). The smartd service from the smartmontools package reads these values regularly, runs self-tests, and warns you before a failing drive loses data. It needs a physical drive, so it is for dedicated servers: a VPS disk is virtual and has no S.M.A.R.T. data.
1. Install smartmontools
dnf install smartmontools # AlmaLinux, Rocky Linux, RHEL apt install smartmontools # Ubuntu, Debian
2. Check a drive by hand
- List the drives:
smartctl --scan - Show the drive and whether S.M.A.R.T. is available and enabled:
smartctl -i /dev/sda
If it says "SMART support is: Disabled", switch it on withsmartctl -s on /dev/sda. - Overall health:
smartctl -H /dev/sda. "PASSED" is good, but read the attributes too, because a drive can pass and still be failing. - All values:
smartctl -a /dev/sda(for NVMe drives,smartctl -a /dev/nvme0).
Values to watch on SATA and SAS drives: Reallocated_Sector_Ct, Current_Pending_Sector and Offline_Uncorrectable should be 0; if they grow, plan a replacement. A rising UDMA_CRC_Error_Count usually points to a cable problem. On NVMe drives, check Critical Warning (should be 0x00), Percentage Used (wear) and Media and Data Integrity Errors.
3. Run a self-test
smartctl -t short /dev/sda # about 2 minutes smartctl -t long /dev/sda # an hour or more on large disks smartctl -l selftest /dev/sda # results
Tests run inside the drive while the server keeps working.
4. Configure automatic monitoring
- Open the configuration file:
/etc/smartmontools/smartd.confon AlmaLinux, Rocky Linux and RHEL, or/etc/smartd.confon Ubuntu and Debian. - Comment out the existing
DEVICESCANline with#and add:DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -W 4,45,55 -m admin@example.com
- Restart the service and enable it at boot:
systemctl enable --now smartd systemctl restart smartd
On Ubuntu and Debian,smartdis another name for thesmartmontoolsservice, so the same commands work. - Check that it found your drives:
journalctl -u smartd -b
What the line does: DEVICESCAN monitors every drive found; -a checks health, attributes and error logs; -o on and -S on switch on the drive's background data collection; -n standby,q skips drives that are asleep; -s runs a short test every day at 02:00 and a long test every Saturday at 03:00; -W 4,45,55 reports temperature changes of 4 °C and warns at 45 °C and 55 °C; -m is where warnings are emailed.
5. Make sure warnings reach you
smartd sends email with the system's mail command, so the server needs a working mail setup (for example the s-nail package and a mail relay). Test it by adding -M test to the line and restarting smartd: you should get a test message for each drive. Remove -M test afterwards.
Common problems
- "Unable to detect device type" or no drives found: the drives sit behind a hardware RAID controller. Name them with the controller type, for example
/dev/sda -d megaraid,0 -a -m admin@example.com, one line per drive. - No email arrives: test the mail command itself with
echo test | mail -s test admin@example.com. - On a VPS: smartctl reports no S.M.A.R.T. support. The host's drives are monitored by the provider.
On a Ucartz dedicated server, if smartctl shows reallocated or pending sectors, open a support ticket with the smartctl -a output so the drive can be checked.
Official documentation: smartmontools project (smartctl and smartd.conf manual pages).
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
