{"canonical_url":"https://engineer.company/glossary/smart/","content_markdown":"# S.M.A.R.T.\n\n## What it is\n\nS.M.A.R.T. stands for Self-Monitoring, Analysis and Reporting Technology;\nsmartmontools and its manuals write it without the dots, as SMART. It is a\nrecord a disk keeps about itself, in its own firmware, while it works: counts of\nevents, readings of its condition and the results of tests it has run. The\noperating system can ask the drive for that record at any time. smartmontools,\nthe toolkit this page draws on, says most current disks in the ATA/SATA,\nSCSI/SAS and NVMe families implement this technology. The package ships two\nprograms: smartctl, which reads and tests one disk when you run it, and smartd,\na daemon that keeps watch in the background.\n\nWhat a disk can report depends on the command set it speaks. An ATA or SATA disk\nkeeps a table of numbered attributes, from 1 to 253, each with a name; attribute\n12, for example, counts how many times the disk has been powered up. Every\nattribute carries a raw value, the actual count or reading, and a normalized\nvalue between 1 and 254 that the vendor's firmware works out from the raw one by\nits own formula. Next to those sit the worst normalized value the disk has\nrecorded in its life and a threshold chosen by the manufacturer. An attribute\nwhose normalized value drops to its threshold or below has failed.\n\nEach attribute is one of two types. A pre-failure attribute at or below its\nthreshold says the disk is about to fail. An old-age attribute, also called a\nusage attribute, at or below its threshold says the disk has reached the end of\nits life through ordinary wear. The smartctl manual stresses that the Pre-fail\nlabel is no cause for worry by itself: it only carries that meaning once the\nvalue has crossed the threshold.\n\nAbove the table sits one verdict, the health status. An ATA disk answers a\ncommand named SMART RETURN STATUS with pass or fail. A SCSI or SAS disk reports\nthrough an exceptions log page and its sense data, and an NVMe drive sets bits\nin the Critical Warning byte of its SMART/Health Information log. Disks can also\ntest themselves on request: a short test, usually done in under ten minutes, a\nlong one that takes anything from tens of minutes to several hours, and on ATA\ndisks a conveyance test aimed at damage from transport. The outcome of each\nlands in a self-test log on the disk.\n\n## Why it matters\n\nA disk sees its own trouble before anyone else does. It knows which of its\nsectors no longer read, how often it has been switched on and how hot it runs.\nS.M.A.R.T. is the channel through which that knowledge reaches the people\nresponsible for the data, and smartmontools describes the payoff modestly: in\nmany cases, it says, the tools give “advanced warning of disk degradation and\nfailure”. Many cases is not all of them, and much of this page is about that\ndifference.\n\nThe strongest signal is the verdict. When smartctl reports a failing health\nstatus, its manual says the disk has either failed already or expects to fail\nwithin the next 24 hours, and tells the reader to collect the full report and\nmove the data somewhere safe without delay. Weaker signals come earlier. A\npending sector is one the disk wants to mark as bad and swap for a spare,\ntypically because a read from it failed; a non-zero count means some data on the\ndisk is no longer readable. The disk counts those sectors in attribute 197, and\nin attribute 198 it counts sectors that neither an offline scan nor a self-test\nmanaged to read.\n\nNone of this helps if nobody looks. smartd switches S.M.A.R.T. monitoring on for\nATA disks, polls the disks every 30 minutes by default, reports errors and\nattribute changes to syslog and can send a warning by email. It can also start\nself-tests on a schedule, so no cron job is needed for that part. The project is\nold and still moving: it marked the 20th anniversary of its first release in\nOctober 2022, released version 7.5 on 30 April 2025, and moved its development\nfrom SourceForge to GitHub on 1 June 2025. It runs on Linux, the BSDs, macOS,\nSolaris and Windows, among others.\n\n## What it looks like in practice\n\nTake a new server with a SATA disk at `/dev/sda`. Three commands give the\npicture:\n\n```sh\nsmartctl -i /dev/sda\nsmartctl -H /dev/sda\nsmartctl -A /dev/sda\n```\n\nThe first prints the model, serial number and firmware, whether the drive\nsupports S.M.A.R.T. and whether it is switched on, and whether the drive is\nlisted in the smartmontools drive database. The second prints the verdict. The\nthird prints the attribute table: VALUE and WORST hold the normalized numbers,\nTHRESH the threshold, TYPE says Pre-fail or Old_age, RAW_VALUE holds the raw\ncount, and WHEN_FAILED says `FAILING_NOW`, `In_the_past` or a dash for an\nattribute that has never failed. When you want everything in one go,\n`smartctl -x` prints all the information the tool can read, S.M.A.R.T. and\notherwise, with the table in a denser layout.\n\nA long self-test is the more thorough version of the short one:\n\n```sh\nsmartctl -t long /dev/sda\nsmartctl -l selftest /dev/sda\n```\n\nUnless `-C` asks for captive mode, the test runs inside the disk while the\nsystem carries on with its work. It can slow the drive down, heavy traffic from\nthe operating system makes it take longer, and only one test runs at a time. The\nmanual adds that a shutdown in the middle should do no harm, since the test is\neither aborted or resumed. The second command reads the self-test log once the\nestimated time has passed.\n\nScripts should read the exit status rather than the text. smartctl builds it\nfrom eight bits, and the manual's own example tests bit 3, which is set when the\ndisk reports that it is failing:\n\n```sh\nsmartctl -q silent -H /dev/sda\nsmartstat=$(($? \u0026 8))\n```\n\n`-q silent` prints nothing, so the exit status is the only answer. A non-zero\nstatus does not always mean a dying disk: bit 6 alone, for instance, means only\nthat the error log holds entries.\n\nFor the long run, smartd reads its rules from `smartd.conf`. One line can cover\nevery disk the scan finds:\n\n```text\nDEVICESCAN -a -s (S/../.././02|L/../../6/03) -W 2,40,45 \\\n  -m ops@example.com -M test\n```\n\n`-a` turns on the standard set: the health status, the error and self-test logs,\nfailed usage attributes, changes in attribute values and, on ATA disks, the\ncounts in attributes 197 and 198. The `-s` pattern starts a short test every day\nbetween 02:00 and 03:00 and a long one every Saturday between 03:00 and 04:00.\n`-W 2,40,45` reports a temperature change of 2 degrees, logs a note at 40 °C and\nraises a critical warning, by syslog and email, at 45 °C. `-m` names the\nrecipient, and `-M test` sends one test message when smartd starts. After an\nedit, `killall -HUP smartd` makes the daemon read the file again.\n\nNumbers like these matter most while the disk still answers. Our portfolio entry\non\n[recovering data from failed storage](/portfolio/recovered-data-from-sd-cards-hdds-ssds-and-raid/)\nstarts after that point: between 2003 and 2014, people brought in memory cards,\nhard drives, SSDs and RAID arrays that had already failed, and the method had to\nsuit the particular kind of medium.\n\n## Where it goes wrong\n\n**A passing verdict is read as a clean bill.** The health status only says the\ndisk has not declared itself failed. Attributes can be at or below their\nthresholds now or in the past, and pending sectors can already hold unreadable\ndata, while the verdict still reads as passed. The fix is to read the attribute\ntable and the self-test log as well, let smartd report attributes 197 and 198,\nand keep backups that do not rely on the disk's opinion of itself.\n\n**Raw values are taken at face value.** The standard does not say how a raw\nvalue maps to a physical unit. The smartctl manual mentions a Hitachi disk that\ncounts power-on time in minutes rather than hours, and IBM disks that keep three\ntemperatures in their raw values. Since revision 4 of ATA/ATAPI-4 the meaning of\nthe attributes has been left entirely to vendors, and solid-state drives give\nsome numbers other meanings, so the printed name can be wrong unless the drive\nis in the database. The fix is to compare a disk with its own history, not with\na different model, and to check what `-i` says about the database before\ntrusting a name.\n\n**`-a` is used on an ATA disk.** It was the classic way to see everything, but\nthe manual no longer recommends it for ATA, because it leaves out the options\nthat need 48-bit ATA commands, such as the extended error log. The fix is to use\n`-x`.\n\n**A RAID controller hides the disks.** The operating system sees one logical\ndrive, which has nothing useful to report, and smartd's automatic scan on Linux\nleaves out disks behind RAID controllers altogether. The fix is to address each\nphysical disk through the controller, with the matching device type:\n`-d megaraid,N` reaches disk N behind a MegaRAID or Dell PERC controller on\nLinux and FreeBSD, and a line such as `/dev/sda -d megaraid,0 -a` in\n`smartd.conf` puts that disk under watch.\n\n**A USB enclosure sits in the way.** USB storage speaks the SCSI command set to\nthe computer but nearly always holds an ATA or SATA disk or flash memory. The\nmanual names bridge firmware, along with RAID controllers, as a layer that can\nleave the health status unknown, and smartctl then warns and falls back to\ncomparing pre-failure attributes with their thresholds. The fix is to try\n`-d sat`, which wraps the ATA commands in the SCSI-to-ATA translation standard;\n`-d sat,12` selects the shorter of its two command forms.\n\n**The warning email never arrives.** smartd sends mail with the system's `mail`\ncommand, which has to be on the path of the environment smartd was started from.\nIf it is missing, the warning exists only in syslog. The fix is `-M test`, then\nchecking that the test message has actually landed in an inbox someone reads;\n`-M exec` can point smartd at another mailer or a script.\n\n**A test schedule never fires.** In the `-s` pattern, month, day of the month\nand hour each take two digits. A pattern such as `S/../.././2` never matches,\nand the manual warns about exactly that. The fix is to write `02`, and to read\nthe log after the first night to see that a test ran.\n\n**A broken edit goes unnoticed.** When smartd reloads its configuration on a\nhang-up signal and finds a syntax error, it prints the error and carries on with\nthe old rules, as though the signal never came. The fix is to read the log after\nevery reload, or restart the service, since smartd refuses to start at all with\na faulty file.\n\n**Temperature goes unwatched.** All temperature reports are off by default, and\n`-a` does not turn them on. The fix is to add `-W` with limits that suit the\nhardware.\n\n**A check wakes a sleeping disk.** A disk spun down to save power will spin up\nwhen smartctl talks to it. The fix, for scripts that run often, is `-n standby`,\nwhich makes smartctl exit with status 2 instead of waking the disk, or\n`-n standby,0` to treat that case as success.\n\n## Further reading\n\n- [smartmontools](https://www.smartmontools.org/)\n  — the project's home page: both programs, supported systems and release news.\n- [smartctl(8), manual page source](https://github.com/smartmontools/smartmontools/blob/main/src/smartctl.8.in)\n  — attributes, thresholds, health status, self-tests, device types, exit bits.\n- [smartd(8), manual page source](https://github.com/smartmontools/smartmontools/blob/main/src/smartd.8.in)\n  — the daemon: polling, syslog, signals and how it scans for disks.\n- [smartd.conf(5), manual page source](https://github.com/smartmontools/smartmontools/blob/main/src/smartd.conf.5.in)\n  — directives for monitoring, test schedules, temperature limits and email.\n\n\u003chttps://engineer.company/glossary/smart/\u003e\n","date_modified":"2026-10-30T02:51:31Z","description":"What S.M.A.R.T. is, how smartctl and smartd read a disk's attributes and self-tests, and why a passing verdict promises less than it seems.","formats":{"gemtext":"https://engineer.company/glossary/smart/index.gmi","gopher":"https://engineer.company/glossary/smart/gophermap","html":"https://engineer.company/glossary/smart/","json":"https://engineer.company/glossary/smart/index.json","markdown":"https://engineer.company/glossary/smart/index.md","pdf":"https://engineer.company/glossary/smart/index.pdf"},"kind":"page","language":"en","title":"What is S.M.A.R.T.?","url":"https://engineer.company/glossary/smart/","version":1}