How do I install smartctl?
sudo apt install -y smartmontools # Ubuntu, Debian sudo dnf install -y smartmontools # AlmaLinux, Rocky, CentOS Stream sudo pkg install smartmontools # FreeBSD 14
The package brings two tools: smartctl for manual checks and smartd, a daemon that watches drives and alerts you. Our machines use SATA SSDs on the Entry line and NVMe drives everywhere else, and smartctl handles both.
Which drives are in my machine?
lsblk -dno NAME,MODEL,SIZE,TRAN sudo smartctl --scan-open
lsblk -d lists whole disks with model and transport. NVMe drives show as nvme0n1, nvme1n1; SATA drives as sda, sdb. On S3, for example, you should see 2x 1 TB NVMe. --scan-open prints the device type smartctl will use for each one.
How do I read an NVMe drive's health?
sudo smartctl -H -A /dev/nvme0 sudo nvme smart-log /dev/nvme0 # from the nvme-cli package
NVMe reports a short, standard health log. These fields matter most:
| Field | What to watch for |
|---|---|
| Critical Warning | Must be 0x00. Any other value is a real problem |
| Percentage Used | Wear estimate; 100% means rated endurance reached, not instant failure |
| Available Spare | Spare blocks left; alarm when it drops near the threshold |
| Media and Data Integrity Errors | Should stay at 0; growing numbers mean the flash is failing |
| Data Units Written | Lifetime writes in units of 512,000 bytes |
| Unsafe Shutdowns | Power loss count; harmless unless it climbs fast |
To turn Data Units Written into terabytes, multiply by 512,000 and divide by 1012. Compare that with the drive's rated endurance to see how much life is left; NVMe endurance (TBW and DWPD) explains the ratings.
How do I read a SATA SSD?
sudo smartctl -a /dev/sda | sed -n '/ATTRIBUTE_NAME/,/^$/p'
SATA attributes vary by vendor, but a few are common: Reallocated_Sector_Ct and Reported_Uncorrect should stay at or near zero, Wear_Leveling_Count or Percent_Lifetime_Remain shows wear, and CRC_Error_Count points at a cable or backplane rather than the flash. Look at the RAW_VALUE column for counts and VALUE against THRESH for the vendor's own verdict.
How do I run a self test?
sudo smartctl -t short /dev/nvme0 sleep 150; sudo smartctl -l selftest /dev/nvme0 sudo smartctl -t long /dev/sdb
A short test takes a minute or two and checks the controller and a sample of the media. A long test reads the whole surface and can take an hour or more on large drives. Both run inside the drive while the server keeps working, though a long test adds some read load. Older nvme drives may not support self tests; smartctl says so if that is the case.
How do I get alerts automatically?
Configure smartd to watch every drive and run tests on a schedule. Replace the content of /etc/smartd.conf (on Debian it is /etc/smartd.conf, on the RHEL family /etc/smartmontools/smartd.conf) with:
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././03|L/../../7/04) -W 4,45,60 -m ops@example.net
That checks all attributes, runs a short test at 03:00 daily and a long one on Sundays at 04:00, warns on temperature jumps and mails the address. Mail needs a working local MTA such as postfix or msmtp. Then enable the daemon: sudo systemctl enable --now smartd (the unit is smartmontools on Debian).
What should I do if a drive looks bad?
Copy your data off first. Do not wait for the next test. Then open a ticket from the panel with the smartctl output attached, so the hardware can be checked. If your machine has two drives and you built a mirror as described in Two-drive mirror (RAID 1), the array keeps running on the healthy disk while the bad one is dealt with. Without a mirror, your backups are the only copy, which is why we push Back up data with rsync so hard.
How often should I check by hand?
With smartd running, a manual look once a month is plenty. Write down Percentage Used and Data Units Written each time. A sudden jump in writes usually means an app is logging or swapping far more than you expected, which is worth fixing long before the drive wears out.
Machines and the Drives They Carry
| Server | Processor | Cores / threads | Memory | Storage | Network | Per month | Smallest order |
|---|---|---|---|---|---|---|---|
| E1 | Intel Xeon E3-1240 v3 | 4 / 8 | 16 GB DDR3 | 2x 240 GB SSD | 2x 1 Gbps | $30.52 | $91.56 (3 months) |
| S3 | Intel Xeon E-2356G | 6 / 12 | 64 GB DDR4 | 2x 1 TB NVMe | 2x 10 Gbps | $80.38 | $80.38 (1 month) |
| S12 | Intel Core i9-14900K | 24 / 32 | 192 GB DDR5 | 2x 4 TB NVMe | 2x 10 Gbps | $202.82 | $202.82 (1 month) |
| D21 | 2x Intel Xeon Gold 6430 | 64 / 128 | 256 GB DDR5 | 6x 15.36 TB NVMe + 1x 1 TB NVMe (boot) | 2x 25 Gbps | $1,152.97 | $1,152.97 (1 month) |
Keep Reading
NVMe endurance (TBW and DWPD)
How much data a flash drive can absorb before it wears out, and how to watch wear on your own machine.
OpenTwo-drive mirror (RAID 1)
How RAID 1 keeps a full copy of your data on two drives, which machines have two drives and how to check it with mdadm.
OpenMeasure storage speed and IOPS
Benchmark a server drive with fio: random IOPS, sequential throughput and latency, with job files that match real database and file workloads.
OpenBack up data with rsync
Build dated, space-saving snapshot backups with rsync and hard links, pull them from a second machine and test restores.
OpenFAQ
Quick Answers
Yes. Use the controller device such as /dev/nvme0, or nvme-cli for the same health log.
No. It means the rated write endurance is reached. Many drives keep working long after, but plan a replacement and keep backups current.
Yes. Tests run inside the drive while the system keeps working.
The device path or type may be wrong. Try smartctl --scan-open and use the type it suggests.
Most server NVMe drives run fine up to about 70 C and throttle near their warning threshold.