SMARTD(8)
π SMARTD(8) π SMART Monitoring Tools
okay bestie, welcome to the smartd manual page π this is the Linux-flavoured one, and it's giving β¨big important daemon energyβ¨ so grab a snack, we're doing this properly.
πΈ NAME πΈ
smartd β the SMART Disk Monitoring Daemon π¦
β¨ SYNOPSIS β¨
smartd [options]
π« DESCRIPTION π«
Heads up bestie: this man page is generated for the Linux version of smartmontools. It does not contain info specific to other platforms. π
So. smartd is a daemon β a lil background icon β that monitors the Self-Monitoring, Analysis and Reporting Technology (SMART) system baked into most ATA/SATA and SCSI/SAS hard drives and solid-state drives π. The whole point of SMART is to keep an eye on how reliable your drive is, predict drive failures before they ruin your whole life, and run different types of drive self-tests. This version of smartd is compatible with ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards (peep REFERENCES below, iykyk).
smartd will attempt to enable SMART monitoring on ATA devices (that's equivalent to smartctl -s on, fr fr) and polls these and SCSI devices every 30 minutes (configurable, don't worry), logging SMART errors and changes of SMART Attributes via the SYSLOG interface. The default location for these SYSLOG notifications and warnings is system-dependent (typically /var/log/messages or /var/log/syslog). Wanna change that default location? See the -l command-line option below, bestie π.
Not only does smartd log to a file, it can also be configured to send you email warnings if problems are detected π§π. Depending on the type of problem, you may want to run self-tests on the disk, back up the disk, replace the disk, or use a manufacturer's utility to force reallocation of bad or unreadable disk sectors. If disk problems are detected, please check the smartctl manual page and the smartmontools web page/FAQ for further guidance π«Ά.
If you send a USR1 signal to smartd, it will immediately check the status of the disks, and then return to polling the disks every 30 minutes. See the -i option below for additional details π.
smartd can be configured at start-up using the configuration file /etc/smartmontools/smartd.conf (Windows: EXEDIR/smartd.conf). If the configuration file gets modified afterwards, you can tell smartd to re-read it by sending a HUP signal, for example with the command:
killall -HUP smartd
On startup, if smartd finds a syntax error in the configuration file, it will print an error message and then exit π. However β and this is the important part β if smartd is already running, then is told with a HUP signal to re-read the configuration file, and then finds a syntax error in this file, it will print an error message and then continue, ignoring the contents of the (faulty) configuration file, as if the HUP signal had never been received. Not me getting ignored by a daemon π.
When smartd is running in debug mode, the INT signal (normally generated from a shell with CONTROL-C) is treated in the same way as a HUP signal: it makes smartd reload its configuration file. To exit smartd, use CONTROL-\ βοΈ.
[Linux only] If smartd is started as a systemd(1) service and 'Type=Notify' is specified in the service file, the service manager is notified after successful startup β. Other state changes are reported via systemd notify STATUS messages. Notification of successful reloads (after HUP signal) is not supported π. To detect this process start-up type, smartd checks whether the environment variable 'NOTIFY_SOCKET' is set. Note that it is required to set the -n (--nofork) option in the 'ExecStart=/usr/bin/smartd' command line if 'Type=Notify' is used π.
On startup, in the absence of the configuration file /etc/smartmontools/smartd.conf, the smartd daemon first scans for all devices that support SMART π. The scanning is done as follows:
- LINUX: Examine all entries
"/dev/hd[a-t]"for IDE/ATA devices, and"/dev/sd[a-z]","/dev/sd[a-z][a-z]"for ATA/SATA or SCSI/SAS devices. Disks behind RAID controllers are not included.- If directive
-d nvmeor no-ddirective is specified, examine all entries"/dev/nvme[0-99]"for NVMe devices.
- If directive
smartd then monitors for all possible SMART errors (corresponding to the -a Directive in the configuration file; see the smartd.conf(5) man page).
π OPTIONS π
okay this is the part where we list every single one, no skipping, periodt π
-A PREFIX,--attributelog=PREFIXβ Writes drive attribute information to files'PREFIX''MODEL-SERIAL[-NSID].PRT.csv'. ποΈPREFIXspecifies the destination directory if it includes a trailing slash. Otherwise its last path component specifies the prefix of the filename. The path must be absolute, except if debug mode is enabled.MODELandSERIALare build from drive identify information, invalid characters are replaced by underline.NSIDis the NVMe namespace id if an individual namespace is addressed.PRTis one of'ata','scsi'or'nvme'.- At each check cycle, attributes are logged as a line of tab separated tuples which consists of semicolon separated names or values. Each line is led by a date string of the form
"yyyy-mm-dd HH:MM:SS"(in local time). The remaining part is protocol-specific:[ATA]Writes ATA SMART attributes as"id;normalized-value;raw-value;".[SCSI]Writes SCSI error counters and temperature as"name;value;".[NVMe: NEW EXPERIMENTAL SMARTD 7.5 FEATURE]Writes NVMe SMART/Health information as"name;value;".
- At each check cycle, attributes are logged as a line of tab separated tuples which consists of semicolon separated names or values. Each line is led by a date string of the form
-B [+]FILE,--drivedb=[+]FILEβ [ATA only] Read the drive database from FILE. The new database replaces the built in database by default. If'+'is specified, then the new entries prepend the built in entries. Please see thesmartctl(8)man page for further details π.-c FILE,--configfile=FILEβ Readsmartdconfiguration Directives from FILE, instead of from the default location/etc/smartmontools/smartd.conf(Windows:EXEDIR/smartd.conf). If FILE does not exist, thensmartdwill print an error message and exit with nonzero status π. Thus,-c /etc/smartmontools/smartd.confcan be used to verify the existence of the default configuration file. Sneaky but iconic β¨.- By using
'-'for FILE, the configuration is read from standard input. This is useful for commands like:
- By using
echo /dev/sdb -m user@home -M test | smartd -c - -q onecheck
to perform quick and simple checks without a configuration file π₯.
-C,--capabilities[=mail]β [Linux only] Use libcap-ng to drop unneeded Linux processcapabilities(7). The following capabilities are kept in the effective and permissive sets:CAP_SYS_ADMIN,CAP_SYS_RAWIO,CAP_MKNOD. If the-u, --warn_as_useroption (see below) is used with a non-privileged user or group, the following capabilities are also kept:CAP_SETGID,CAP_SETUID. The capability bounding set is cleared. It depends on the local MTA whether mail could be send from a root process with all capabilities dropped. It works with the postfix MTA π¬.- If
--capabilities=mailis specified, the following capabilities are added to the bounding set:CAP_SETGID,CAP_SETUID,CAP_CHOWN,CAP_FOWNER,CAP_DAC_OVERRIDE. This allows one to send mail with the exim MTA π.
- If
-d,--debugβ Runssmartdin "debug" mode π. In this mode, it displays status information to STDOUT rather than logging it to SYSLOG and does notfork(2)into the background and detach from the controlling terminal. In this mode,smartdalso prints more verbose information about what it is doing than when operating in "daemon" mode. In this mode, theINTsignal (normally generated from a terminal with CONTROL-C) makessmartdreload its configuration file. Please use CONTROL-\ to exit πͺ.-D,--showdirectivesβ Prints a list (to STDOUT) of all the possible Directives which may appear in the configuration file/etc/smartmontools/smartd.conf, and then exits π. These Directives are described in thesmartd.conf(5)man page. They may appear in the configuration file following the device name.-h,--help,--usageβ Prints usage message to STDOUT and exits π«‘.-i N,--interval=Nβ Sets the interval between disk checks to N seconds, where N is a decimal integer. The minimum allowed value is ten and the maximum is the largest positive integer that can be represented on your system (often2^31-1). The default is 1800 seconds β°. The interval could be overridden with the-c i=Ndirective, seesmartd.conf(5)man page.- Note that the superuser can make
smartdcheck the status of the disks at any time by sending it theSIGUSR1signal, for example with the command:
- Note that the superuser can make
kill -SIGUSR1 <pid>
where <pid> is the process id number of smartd. One may also use:
killall -USR1 smartd
for the same purpose π .
-l FACILITY,--logfacility=FACILITYβ Uses syslog facility FACILITY to log the messages fromsmartd. Here FACILITY is one oflocal0,local1, ...,local7, ordaemon[default] π. If this command-line option is not used, then by default messages fromsmartdare logged to the facilitydaemon.- If you would like to have
smartdmessages logged somewhere other than the default location, include (for example)-l local3in its start up argument list. Tell the syslog daemon to log all messages from facilitylocal3to (for example)/var/log/smartd.logπ. - For more detailed information, please refer to the man pages for the local syslog daemon, typically
syslogd(8),syslog-ng(8)orrsyslogd(8)π§.
- If you would like to have
-n,--no-forkβ Do not fork into background; this is useful when executed from modern init methods likeinitng,minit,superviseorsystemdπ.-p NAME,--pidfile=NAMEβ Writes pidfile NAME containing thesmartdProcess ID number (PID). To avoid symlink attacks make sure the directory to which pidfile is written is only writable for root β οΈ. Without this option, or if the--debugoption is given, no PID file is written on startup. Ifsmartdis killed with a maskable signal then the pidfile is removed π§Ή.-q WHEN,--quit=WHENβ Specifies when, if ever,smartdshould exit. The valid arguments are to this option are:nodevβ Exit if there are no devices to monitor, or if any errors are found at startup in the configuration file. This is the default.errorsβ Exit if there are no devices to monitor, or if any errors are found in the configuration file/etc/smartmontools/smartd.confat startup or whenever it is reloaded.
nodevstartupβ dip out if there's, like, zero devices to monitor at startup? But bestie, if no devices show up when the config gets reloaded later, it just keeps running anyway. πneverβ the only way out is a fatal error (no remaining system memory, invalid command line arguments). In this mode, even with no devices to monitor, or even if/etc/smartmontools/smartd.confis full of errors,smartdjust keeps vibing, waiting for a config file that lists valid devices. Periodt. β¨nodev0β same as'nodev', except the exit status is0if there are no devices to monitor.nodev0startupβ same as'nodevstartup', except the exit status is0if there are no devices to monitor.errors,nodev0β same as'errors', except the exit status is0if there are no devices to monitor.onecheckβ startsmartdin debug mode, then register devices, then check the device's SMART status exactly once, then exit with zero exit status if every single one of those steps worked correctly. π«Ά
This last option is for the 'distribution-writers' out there who wanna build automated scripts that figure out whether or not to automatically start up smartd after installing smartmontools. So like: after starting smartd with this command-line option, the distribution's install scripts should wait a reasonable length of time (say ten seconds, no rush). If smartd hasn't exited with zero status by then, the script should send smartd a SIGTERM or SIGKILL and assume that smartd will not operate correctly on the host. Conversely β flip side, bestie β if smartd exits with zero status, then it is safe to run smartd in normal daemon mode. And if smartd is unable to monitor any devices or encounters other problems, then it will return with non-zero exit status. π
showtestsβ startsmartdin debug mode, then register devices, then write a list of future scheduled self tests to stdout, and then exit with zero exit status if all of these steps worked correctly. Device's SMART status is not checked, ngl.
This option is intended to test whether the -s REGEX directives in smartd.conf will have the desired effect. The output lists the next test schedules, limited to 5 tests per type and device. This is followed by a summary of all tests of each device within the next 90 days. ποΈ
-r TYPE,--report=TYPEβ mainly here to help smartmontools developers understand the behavior of smartmontools on non-conforming or poorly-conforming hardware. This option reports details ofsmartdtransactions with the device. You can use it multiple times, and it stacks. Use it just once β it shows a record of theioctl()transactions with the device. Use it more than once β the detail of theseioctl()transactions are reported in greater detail. π
The valid arguments to this option are:
ioctlβ report allioctl()transactions.ataioctlβ report onlyioctl()transactions with ATA devices.scsiioctlβ report onlyioctl()transactions with SCSI devices.nvmeioctlβ report onlyioctl()transactions with NVMe devices.
Any argument may include a positive integer to specify the level of detail that should be reported. The argument should be followed by a comma then the integer with no spaces. For example, ataioctl,2. The default level is 1, so -r ataioctl,1 and -r ataioctl are equivalent. π
-s PREFIX,--savestates=PREFIXβ reads/writessmartdstate information from/to files'PREFIX''MODEL-SERIAL[-NSID].PRT.state'. ForPREFIX,MODEL,SERIAL,NSIDandPRT, see the-Aoption above.
The state information files preserve various information across smartd restarts, for example: SMART attributes, drive min and max temperatures (-W directive), info about last sent warning email (-m directive), the time of next check of the self-test REGEXP (-s directive), and info about the last reported error log entries (-l [x]error directives). π§
The state information files are read on smartd startup. The files are always (re)written after reading the configuration file, before rereading the configuration file (SIGHUP), before smartd shutdown, and after a check forced by SIGUSR1. After a normal check cycle, a file is only rewritten if an important change (which usually results in a SYSLOG output) occurred.
-w PATH,--warnexec=PATHβ run the executablePATHinstead of the default script whensmartdneeds to send warning messages.PATHmust point to an executable binary file or script. The default script is/etc/smartmontools/smartd_warning.sh. π₯-u USER[:GROUP],--warn-as-user=USER[:GROUP]β run the warning script as a non-privileged user instead of root. TheUSERand optionalGROUPmay be specified as numeric ids or names. If noGROUPis specified, the default group ofUSERis used instead.
If a warning occurs, a child process is created with fork(2). This process closes all inherited file descriptors, connects stdio to /dev/null, changes the user and group ids, removes any supplementary group ids and then calls the popen(3) function from the standard library. π
If '0:0' is specified, user and group are not changed, but the remaining actions still apply.
If '-' is specified, popen(3) is called directly. This is the default.
-V,--version,--license,--copyrightβ prints version, copyright, license, home page and SVN revision information for your copy ofsmartdtoSTDOUTand then exits. π
π EXAMPLES π
smartd
Runs the daemon in forked mode. This is the normal way to run smartd. Entries are logged to SYSLOG. β¨
smartd -d -i 30
Run in foreground (debug) mode, checking the disk status every 30 seconds.
smartd -q onecheck
Registers devices, and checks the status of the devices exactly once. The exit status (the shell $? variable) will be zero if all went well, and nonzero if no devices were detected or some other problem was encountered. π€
π CONFIGURATION π
The syntax of the smartd.conf(5) file is discussed separately.
πΈ NOTES πΈ
smartd will make log entries at loglevel LOG_INFO if the Normalized SMART Attribute values have changed, as reported using the -t, -p, or -u Directives. For example:
'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93'
Note that in this message, the value given is the 'Normalized' not the 'Raw' Attribute value (the disk temperature in this case is about 22 Celsius). The -R and -r Directives modify this behavior, so that the information is printed with the Raw values as well, for example:
'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]'
Here the Raw values are the actual disk temperatures in Celsius. The way in which the Raw values are printed, and the names under which the Attributes are reported, is governed by the various -v Num,Description Directives described previously.
Please see the smartctl manual page for further explanation of the differences between Normalized and Raw Attribute values.
smartd will make log entries at loglevel LOG_CRIT if a SMART Attribute has failed, for example:
'Device: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct'
This loglevel is used for reporting enabled by the -H, -f', -l selftest, and -l error Directives. Entries reporting failure of SMART Prefailure Attributes should not be ignored: they mean that the disk is failing. Use the smartctl utility to investigate. π
π¦ LOG TIMESTAMP TIMEZONE π¦
When smartd makes log entries, these are time-stamped. The time stamps are in the computer's local time zone, which is generally set using either the environment variable TZ or using a time-zone file such as /etc/localtime. You may wish to change the timezone while smartd is running (for example, if you carry a laptop to a new time-zone and don't reboot it). Due to a bug in the tzset(3) function of many unix standard C libraries, the time-zone stamps of smartd might not change. For some systems, smartd will work around this problem if the time-zone is set using /etc/localtime. The work-around fails if the time-zone is set using the 'TZ' variable (or a file that it points to). π
β EXIT STATUS β
The exit status (return value) of smartd can have the following values:
0β Daemon startup successful, orsmartdwas killed by aSIGTERM(or in debug mode, aSIGQUIT).1β Commandline did not parse.2β There was a syntax error in the config file.3β Forking the daemon failed.4β Couldn't create PID file.5β Config file does not exist (only returned in conjunction with the-coption).6β Config file exists, but cannot be read.8βsmartdran out of memory during startup.10β An inconsistency was found insmartd's internal data structures. This should never happen. It must be due to either a coding or compiler bug. Please report such failures to smartmontools developers, see REPORTING BUGS below. π16β A device explicitly listed in/etc/smartmontools/smartd.confcan't be monitored.17βsmartddidn't find any devices to monitor. This could be changed to0(success) with one of the-q *nodev0*options, see above.254β When in daemon mode,smartdreceived aSIGINTorSIGQUIT. (Note that in debug mode,SIGINThas the same effect asSIGHUP, and makessmartdreload its configuration file.SIGQUIThas the same effect asSIGTERMand causessmartdto exit with zero exit status.132and above βsmartdwas killed by a signal that is not explicitly listed above. The exit status is then128plus the signal number. For example ifsmartdis killed bySIGKILL(signal 9) then the exit status is137. π
π FILES π
okay bestie, here's where all the smartd stuff actually lives on your system. no cap, these paths are the whole map πΊοΈβ¨
/usr/bin/smartdβ full path of this executable. yes, the actual binary, the main character itself./etc/smartmontools/smartd.confβ configuration file (seesmartd.conf(5)man page). this is where you tell smartd what to watch./etc/smartmontools/smartd_warning.shβ script run on warnings (see-woption above and-M execdirective onsmartd.conf(5)man page). the drama alert script, basically./etc/smartmontools/smartd_warning.d/β plugin directory for smartd warning script (see-mdirective onsmartd.conf(5)man page). extras go in here, iykyk./usr/share/smartmontools/drivedb.hβ drive database (see-Boption). the big book of drives./etc/smartmontools/smart_drivedb.hβ optional local drive database (see-Boption). your own personal add-on drive lore.
π AUTHORS π
these are the legends who made smartmontools happen. show some respect, bestie π«Ά
- Bruce Allen (project initiator),
- Christian Franke (project manager, Windows port and all sort of things),
- Douglas Gilbert (SCSI subsystem),
- Volker Kuhlmann (moderator of support and database mailing list),
- Gabriele Pohl (wiki & development team support),
- Alex Samorukov (FreeBSD port and more, new Trac wiki).
Many other individuals have made contributions and corrections, see AUTHORS, ChangeLog and repository files.
The first smartmontools code was derived from the smartsuite package, written by Michael Cornwell and Andre Hedrick.
π REPORTING BUGS π
found something cursed? don't just scream into the void, bestie π
To submit a bug report, create a ticket in smartmontools wiki: <https://www.smartmontools.org/>.
Alternatively send the info to the smartmontools support mailing list: <https://listi.jpberlin.de/mailman/listinfo/smartmontools-support>.
fr fr, bug reports are a love language. help the devs help you π
π SEE ALSO π
π REFERENCES π
Please see the following web site for more info: <https://www.smartmontools.org/>
An introductory article about smartmontools is Monitoring Hard Disks with SMART, by Bruce Allen, Linux Journal, January 2004, pages 74β77. See <https://www.linuxjournal.com/article/6983>.
If you would like to understand better how SMART works, and what it does, a good place to start is with Sections 4.8 and 6.54 of the first volume of the 'AT Attachment with Packet Interface-7' (ATA/ATAPI-7) specification Revision 4b. This documents the SMART functionality which the smartmontools utilities provide access to.
The functioning of SMART was originally defined by the SFF-8035i revision 2 and the SFF-8055i revision 1.4 specifications. These are publications of the Small Form Factors (SFF) Committee.
Links to these and other documents may be found on the Links page of the smartmontools Wiki at <https://www.smartmontools.org/wiki/Links>.
π¦ PACKAGE VERSION π¦
smartmontools-7.5 2025-04-30 r5714
$Id: smartd.8.in 5693 2025-04-22 12:00:11Z chrfranke $
okay bestie, that's the whole smartd(8) page, and we are DONE π the source/version is smartmontools-7.5, the date is 2025-04-30, and the footer would've just said SMARTD(8) but we're sending you off with love instead. periodt πβ¨
π¦ where this page comes from
- fedora 43: smartmontools 1:7.5-10.fc43
- fedora 43: smartmontools 1:7.5-11.fc43 Β· GPL-2.0-or-later
- fedora 43: smartmontools 1:7.5-4.fc43 Β· GPL-2.0-or-later
- fedora 44: smartmontools 1:7.5-10.fc44
- fedora 44: smartmontools 1:7.5-11.fc44 Β· GPL-2.0-or-later
- fedora 44: smartmontools 1:7.5-6.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms