brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: smartctl -l devstat prints standard smart statistics with readable names

Smart
~/tips/tip-smart-devstat-statistics

sudo smartctl -l devstat /dev/sda

Shows device statistics with plain descriptions instead of vendor attribute numbers.

Attribute tables are a mess because every vendor picks its own numbers and meanings. The Device Statistics log is a standardised alternative, and the labels are plain English.

Ask for it on any SATA drive:

sudo smartctl -l devstat /dev/sda

You get pages with entries such as power on hours, logical sectors written and read, error counts and temperature figures, each with a description. If you only want one page, add its number. Page 0 lists which pages the drive supports:

sudo smartctl -l devstat,0 /dev/sda

I reach for this when two drives from different makers need comparing, or when a raw attribute value looks absurd and I want a second opinion. Sectors written, for example, tells you how hard an SSD has worked in a unit that doesn’t need guessing: multiply by the logical sector size, which smartctl -i shows, and you have bytes.

It is newer than the classic attribute table. The man page says Device Statistics arrived with ACS-2 and only some recent drives support it, so older disks will answer with a message that the log isn’t supported. Behind USB adapters you may need the -d sat option before any of it appears. And NVMe drives have their own health log, which plain smartctl -a already shows.

Further reading: smartctl man page

More Smart tips sudo nvme smart-log /dev/nvme0 sudo smartctl -q silent -a /dev/sda sudo smartctl -l scttemphist /dev/sda sudo smartctl -t select,1000000-2000000 /dev/sda sudo smartctl -l sataphy /dev/sda All Smart tips (19) All topics

Link