Linux VPS

Check server disk health with SMART and smartctl

Use smartmontools to read SMART data on SATA and NVMe drives, understand the attributes that predict failure, run self-tests and set up smartd email alerts on a Linux server.

IntermediateDedicated servers3 min read

SMART (Self-Monitoring, Analysis and Reporting Technology) is built into hard drives and SSDs and records signs of wear and failure. Checking it regularly on a dedicated server lets you replace a dying disk before it takes data with it. This guide uses smartctl to check disk health on SATA and NVMe drives.

Before you start

  • Root access to a dedicated or bare-metal server. On a VPS, virtual disks usually do not expose SMART data – the host monitors the physical drives.
  • Drives behind a hardware RAID controller may need extra options (for example -d megaraid,0).

Install smartmontools

  • Ubuntu/Debian: sudo apt install -y smartmontools
  • AlmaLinux/Rocky: sudo dnf install -y smartmontools

List drives and check overall health

  1. Find the drives: sudo smartctl --scan or lsblk -d.
  2. Quick health verdict:
    sudo smartctl -H /dev/sda

    You want PASSED (SATA) or OK (NVMe). A pass does not guarantee health – read the details too.

  3. Full report:
    sudo smartctl -a /dev/nvme0

SATA attributes that matter

IDAttributeWarning sign
5Reallocated_Sector_CtAny non-zero raw value that keeps rising
187Reported_UncorrectNon-zero
197Current_Pending_SectorNon-zero – sectors waiting to be remapped
198Offline_UncorrectableNon-zero
199UDMA_CRC_Error_CountRising – often a cable or backplane issue, not the disk
177/231/233Wear leveling / SSD life (vendor-specific)Approaching end of rated life

NVMe health fields

  • Critical Warning – should be 0x00.
  • Percentage Used – estimated wear; 100% means rated endurance reached.
  • Available Spare – should stay above the threshold.
  • Media and Data Integrity Errors – should be 0.
  • Temperature – sustained high temperatures shorten life and cause throttling.

Run self-tests

  1. Short test (a few minutes): sudo smartctl -t short /dev/sda
  2. Long test (hours on large HDDs): sudo smartctl -t long /dev/sda
  3. Read results when done: sudo smartctl -l selftest /dev/sda

Self-tests run in the background while the server keeps working, though long tests add some I/O load.

Enable automatic monitoring with smartd

  1. Edit /etc/smartd.conf (or /etc/smartmontools/smartd.conf) and replace the DEVICESCAN line with:
    DEVICESCAN -a -o on -S on -s (S/../.././02|L/../../6/03) -m admin@example.com

    This monitors all disks, runs a short test daily at 02:00, a long test on Saturdays at 03:00, and emails on problems.

  2. Make sure the server can send mail, then enable the service: sudo systemctl enable --now smartd (named smartmontools on some Debian versions).

What to do when a disk is failing

  1. Confirm your latest backup is good.
  2. Check RAID state with cat /proc/mdstat or the controller tool.
  3. Note the drive's serial number from smartctl -i so the right disk is replaced.
  4. Open a ticket with your provider to replace it, then rebuild the array.

FAQ: SMART disk health

Can SMART predict every failure?

No. Many failures show warning signs first, but some drives fail suddenly. RAID and backups are still essential.

Why does smartctl show nothing on my VPS?

Virtual disks don't pass through SMART. Your provider monitors the physical hardware.

Is a rising CRC error count a bad disk?

Usually it points to a cable, connector or backplane issue rather than the disk itself.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.