1SMARTD(8)                   SMART Monitoring Tools                   SMARTD(8)
2
3
4

NAME

6       smartd - SMART Disk Monitoring Daemon
7
8

SYNOPSIS

10       smartd [options]
11
12

DESCRIPTION

14       [This man page is generated for the Linux version of smartmontools.  It
15       does not contain info specific to other platforms.]
16
17       smartd is a daemon that monitors the Self-Monitoring, Analysis and  Re‐
18       porting Technology (SMART) system built into most ATA/SATA and SCSI/SAS
19       hard drives and solid-state drives.  The purpose of SMART is to monitor
20       the  reliability  of  the hard drive and predict drive failures, and to
21       carry out different types of drive self-tests.  This version of  smartd
22       is  compatible  with  ACS-3,  ACS-2,  ATA8-ACS, ATA/ATAPI-7 and earlier
23       standards (see REFERENCES below).
24
25       smartd will attempt to enable SMART monitoring on ATA devices  (equiva‐
26       lent  to smartctl -s on) and polls these and SCSI devices every 30 min‐
27       utes (configurable), logging SMART errors  and  changes  of  SMART  At‐
28       tributes via the SYSLOG interface.  The default location for these SYS‐
29       LOG  notifications  and   warnings   is   system-dependent   (typically
30       /var/log/messages  or  /var/log/syslog).   To change this default loca‐
31       tion, please see the '-l' command-line option described below.
32
33       In addition to logging to a file, smartd can also be configured to send
34       email  warnings  if  problems are detected.  Depending upon the type of
35       problem, you may want to run self-tests on the disk, back up the  disk,
36       replace the disk, or use a manufacturer's utility to force reallocation
37       of bad or unreadable disk sectors.   If  disk  problems  are  detected,
38       please  see the smartctl manual page and the smartmontools web page/FAQ
39       for further guidance.
40
41       If you send a USR1 signal to smartd it will immediately check the  sta‐
42       tus  of  the  disks, and then return to polling the disks every 30 min‐
43       utes.  See the '-i' option below for additional details.
44
45       smartd can be configured  at  start-up  using  the  configuration  file
46       /etc/smartmontools/smartd.conf  (Windows:  EXEDIR/smartd.conf).  If the
47       configuration file is subsequently modified, smartd can be told to  re-
48       read  the  configuration  file  by sending it a HUP signal, for example
49       with the command:
50       killall -HUP smartd.
51
52       On startup, if smartd finds a syntax error in the  configuration  file,
53       it will print an error message and then exit.  However if smartd is al‐
54       ready running, then is told with a HUP signal to re-read the configura‐
55       tion  file, and then find a syntax error in this file, it will print an
56       error message and then continue, ignoring the contents of the  (faulty)
57       configuration file, as if the HUP signal had never been received.
58
59       When  smartd  is running in debug mode, the INT signal (normally gener‐
60       ated from a shell with CONTROL-C) is treated in the same way as  a  HUP
61       signal:  it makes smartd reload its configuration file.  To exit smartd
62       use CONTROL-\.
63
64       [Linux only] [NEW EXPERMIMENTAL SMARTD FEATURE] If smartd is started as
65       a  systemd(1)  service  and  'Type=Notify'  is specified in the service
66       file, the service manager is notified after successful startup.   Other
67       state changes are reported via systemd notify STATUS messages.  Notifi‐
68       cation of successful reloads (after HUP signal) is not  supported.   To
69       detect  this  process start-up type, smartd checks whether the environ‐
70       ment variable 'NOTIFY_SOCKET' is set.  Note that it is required to  set
71       the  '-n'  ('--nofork') option in the 'ExecStart=/usr/sbin/smartd' com‐
72       mand line if 'Type=Notify' is used.
73
74       On startup, in the absence of  the  configuration  file  /etc/smartmon‐
75       tools/smartd.conf,  the  smartd daemon first scans for all devices that
76       support SMART.  The scanning is done as follows:
77
78       LINUX:   Examine all entries "/dev/hd[a-t]" for  IDE/ATA  devices,  and
79                "/dev/sd[a-z]",  "/dev/sd[a-c][a-z]"  for ATA/SATA or SCSI/SAS
80                devices.  Disks behind RAID controllers are not included.
81
82                If directive '-d nvme' or no '-d' directive is specified,  ex‐
83                amine all entries "/dev/nvme[0-99]" for NVMe devices.
84
85       smartd  then  monitors  for all possible SMART errors (corresponding to
86       the '-a' Directive in the configuration file;  see  the  smartd.conf(5)
87       man page).
88
89

OPTIONS

91       -A PREFIX, --attributelog=PREFIX
92              Writes  smartd  attribute information (normalized and raw attri‐
93              bute values) to files  'PREFIX''MODEL-SERIAL.ata.csv'  or  'PRE‐
94              FIX''VENDOR-MODEL-SERIAL.scsi.csv'.   At  each  check  cycle at‐
95              tributes are logged as a line of semicolon separated triplets of
96              the    form    "attribute-ID;attribute-norm-value;attribute-raw-
97              value;".   For  SCSI  devices  error  counters  and  temperature
98              recorded  in  the form "counter-name;counter-value;".  Each line
99              is led by a date string of the form  "yyyy-mm-dd  HH:MM:SS"  (in
100              UTC).
101
102              MODEL  and SERIAL are build from drive identify information, in‐
103              valid characters are replaced by underline.
104
105              If   the   PREFIX    has    the    form    '/path/dir/'    (e.g.
106              '/var/lib/smartd/'),  then files 'MODEL-SERIAL.ata.csv' are cre‐
107              ated in directory '/path/dir'.   If  the  PREFIX  has  the  form
108              '/path/name' (e.g. '/var/lib/misc/attrlog-'), then files 'nameM‐
109              ODEL-SERIAL.ata.csv' are created  in  directory  '/path/'.   The
110              path must be absolute, except if debug mode is enabled.
111
112       -B [+]FILE, --drivedb=[+]FILE
113              [ATA  only] Read the drive database from FILE.  The new database
114              replaces the built in database by default.  If '+' is specified,
115              then  the  new entries prepend the built in entries.  Please see
116              the smartctl(8) man page for further details.
117
118       -c FILE, --configfile=FILE
119              Read smartd configuration Directives from FILE, instead of  from
120              the  default  location  /etc/smartmontools/smartd.conf (Windows:
121              EXEDIR/smartd.conf).  If FILE does not exist, then  smartd  will
122              print  an error message and exit with nonzero status.  Thus, '-c
123              /etc/smartmontools/smartd.conf' can be used to verify the  exis‐
124              tence of the default configuration file.
125
126              By  using  '-' for FILE, the configuration is read from standard
127              input.  This is useful for commands like:
128              echo /dev/sdb -m user@home -M test | smartd -c - -q onecheck
129              to perform quick and simple checks without a configuration file.
130
131       -C, --capabilities
132              [Linux only] Use libcap-ng to drop unneeded Linux process  capa‐
133              bilities(7).   The  following capabilities are kept: CAP_SYS_AD‐
134              MIN, CAP_SYS_RAWIO, CAP_MKNOD.
135
136              Warning: Mail notification does not work when used.
137
138       -d, --debug
139              Runs smartd in "debug" mode.  In this mode, it  displays  status
140              information  to STDOUT rather than logging it to SYSLOG and does
141              not fork(2) into the background and detach from the  controlling
142              terminal.   In this mode, smartd also prints more verbose infor‐
143              mation about what it is doing than when  operating  in  "daemon"
144              mode.   In  this mode, the INT signal (normally generated from a
145              terminal with CONTROL-C) makes smartd reload  its  configuration
146              file.  Please use CONTROL-\ to exit
147
148       -D, --showdirectives
149              Prints  a  list (to STDOUT) of all the possible Directives which
150              may   appear   in   the   configuration   file    /etc/smartmon‐
151              tools/smartd.conf,  and  then  exits.   These Directives are de‐
152              scribed in the smartd.conf(5) man page.  They may appear in  the
153              configuration file following the device name.
154
155       -h, --help, --usage
156              Prints usage message to STDOUT and exits.
157
158       -i N, --interval=N
159              Sets the interval between disk checks to N seconds, where N is a
160              decimal integer.  The minimum allowed value is ten and the maxi‐
161              mum  is  the largest positive integer that can be represented on
162              your system (often 2^31-1).  The default is 1800 seconds.
163
164              Note that the superuser can make smartd check the status of  the
165              disks  at any time by sending it the SIGUSR1 signal, for example
166              with the command:
167              kill -SIGUSR1 <pid>
168              where <pid> is the process id number of smartd.   One  may  also
169              use:
170              killall -USR1 smartd
171              for the same purpose.
172
173       -l FACILITY, --logfacility=FACILITY
174              Uses  syslog  facility FACILITY to log the messages from smartd.
175              Here FACILITY is one of local0, local1, ..., local7,  or  daemon
176              [default].  If this command-line option is not used, then by de‐
177              fault messages from smartd are logged to the facility daemon.
178
179              If you would like to have smartd messages logged somewhere other
180              than  the default location, include (for example) '-l local3' in
181              its start up argument list.  Tell the syslog daemon to  log  all
182              messages    from    facility    local3    to    (for    example)
183              '/var/log/smartd.log'.
184
185              For more detailed information, please refer to the man pages for
186              the  local  syslog daemon, typically syslogd(8), syslog-ng(8) or
187              rsyslogd(8).
188
189       -n, --no-fork
190              Do not fork into background; this is useful when  executed  from
191              modern init methods like initng, minit, supervise or systemd.
192
193       -p NAME, --pidfile=NAME
194              Writes  pidfile  NAME  containing  the  smartd Process ID number
195              (PID).  To avoid symlink attacks  make  sure  the  directory  to
196              which  pidfile  is  written  is only writable for root.  Without
197              this option, or if the --debug option is given, no PID  file  is
198              written  on startup.  If smartd is killed with a maskable signal
199              then the pidfile is removed.
200
201       -q WHEN, --quit=WHEN
202              Specifies when, if ever, smartd should exit.   The  valid  argu‐
203              ments are to this option are:
204
205              nodev  -  Exit if there are no devices to monitor, or if any er‐
206              rors are found at startup in the configuration  file.   This  is
207              the default.
208
209              errors  - Exit if there are no devices to monitor, or if any er‐
210              rors  are  found  in  the  configuration   file   /etc/smartmon‐
211              tools/smartd.conf at startup or whenever it is reloaded.
212
213              nodevstartup  -  Exit  if  there  are  no  devices to monitor at
214              startup.  But continue to run if no devices are  found  whenever
215              the configuration file is reloaded.
216
217              never  -  Only exit if a fatal error occurs (no remaining system
218              memory, invalid command line arguments).  In this mode, even  if
219              there  are  no  devices to monitor, or if the configuration file
220              /etc/smartmontools/smartd.conf has errors, smartd will  continue
221              to  run,  waiting to load a configuration file listing valid de‐
222              vices.
223
224              onecheck - Start smartd in debug mode,  then  register  devices,
225              then  check  device's SMART status once, and then exit with zero
226              exit status if all of these steps worked correctly.
227
228              This last option is intended for 'distribution-writers' who want
229              to create automated scripts to determine whether or not to auto‐
230              matically start up smartd after installing smartmontools.  After
231              starting  smartd  with  this  command-line option, the distribu‐
232              tion's install scripts should wait a reasonable length  of  time
233              (say ten seconds).  If smartd has not exited with zero status by
234              that time, the script should send smartd a  SIGTERM  or  SIGKILL
235              and  assume  that smartd will not operate correctly on the host.
236              Conversely, if smartd exits with zero status, then it is safe to
237              run  smartd in normal daemon mode.  If smartd is unable to moni‐
238              tor any devices or encounters other problems then it will return
239              with non-zero exit status.
240
241              showtests  -  Start smartd in debug mode, then register devices,
242              then write a list of future scheduled self tests to stdout,  and
243              then  exit  with  zero  exit status if all of these steps worked
244              correctly.  Device's SMART status is not checked.
245
246              This option is intended to test whether the  '-s  REGEX'  direc‐
247              tives  in  smartd.conf will have the desired effect.  The output
248              lists the next test schedules, limited to 5 tests per  type  and
249              device.   This is followed by a summary of all tests of each de‐
250              vice within the next 90 days.
251
252       -r TYPE, --report=TYPE
253              Intended primarily to help smartmontools  developers  understand
254              the  behavior  of smartmontools on non-conforming or poorly-con‐
255              forming hardware.  This option reports details of smartd  trans‐
256              actions with the device.  The option can be used multiple times.
257              When used just once, it shows a record of the  ioctl()  transac‐
258              tions  with the device.  When used more than once, the detail of
259              these ioctl() transactions are reported in greater detail.   The
260              valid arguments to this option are:
261
262              ioctl - report all ioctl() transactions.
263
264              ataioctl - report only ioctl() transactions with ATA devices.
265
266              scsiioctl - report only ioctl() transactions with SCSI devices.
267
268              nvmeioctl - report only ioctl() transactions with NVMe devices.
269
270              Any argument may include a positive integer to specify the level
271              of detail that should be reported.  The argument should be  fol‐
272              lowed  by a comma then the integer with no spaces.  For example,
273              ataioctl,2 The default level is 1, so '-r  ataioctl,1'  and  '-r
274              ataioctl' are equivalent.
275
276       -s PREFIX, --savestates=PREFIX
277              Reads/writes   smartd  state  information  from/to  files  'PRE‐
278              FIX''MODEL-SERIAL.ata.state'    or     'PREFIX''VENDOR-MODEL-SE‐
279              RIAL.scsi.state'.   This  preserves  SMART attributes, drive min
280              and max temperatures (-W directive), info about last sent  warn‐
281              ing  email  (-m  directive),  and  the time of next check of the
282              self-test REGEXP (-s directive) across boot cycles.
283
284              MODEL and SERIAL are build from drive identify information,  in‐
285              valid characters are replaced by underline.
286
287              If    the    PREFIX    has    the    form   '/path/dir/'   (e.g.
288              '/var/lib/smartd/'),  then  files  'MODEL-SERIAL.ata.state'  are
289              created  in  directory  '/path/dir'.  If the PREFIX has the form
290              '/path/name' (e.g. '/var/lib/misc/smartd-'), then files 'nameMO‐
291              DEL-SERIAL.ata.state'  are  created  in directory '/path/'.  The
292              path must be absolute, except if debug mode is enabled.
293
294              The state information files are read  on  smartd  startup.   The
295              files  are  always  (re)written  after reading the configuration
296              file, before rereading the configuration file  (SIGHUP),  before
297              smartd  shutdown,  and after a check forced by SIGUSR1.  After a
298              normal check cycle, a file is only  rewritten  if  an  important
299              change (which usually results in a SYSLOG output) occurred.
300
301       -w PATH, --warnexec=PATH
302              Run  the  executable  PATH  instead  of  the default script when
303              smartd needs to send warning messages.  PATH must  point  to  an
304              executable  binary  file  or  script.   The  default  script  is
305              /etc/smartmontools/smartd_warning.sh.
306
307       -V, --version, --license, --copyright
308              Prints version, copyright, license, home page and  SVN  revision
309              information for your copy of smartd to STDOUT and then exits.
310
311

EXAMPLES

313       smartd
314       Runs  the daemon in forked mode.  This is the normal way to run smartd.
315       Entries are logged to SYSLOG.
316
317       smartd -d -i 30
318       Run in foreground (debug) mode, checking the disk status every 30  sec‐
319       onds.
320
321       smartd -q onecheck
322       Registers  devices,  and checks the status of the devices exactly once.
323       The exit status (the shell $?  variable) will be zero if all went well,
324       and  nonzero  if no devices were detected or some other problem was en‐
325       countered.
326
327

CONFIGURATION

329       The syntax of the smartd.conf(5) file is discussed separately.
330
331

NOTES

333       smartd will make log entries at loglevel  LOG_INFO  if  the  Normalized
334       SMART  Attribute values have changed, as reported using the '-t', '-p',
335       or '-u' Directives.  For example:
336       'Device: /dev/sda, SMART  Attribute:  194  Temperature_Celsius  changed
337       from 94 to 93'
338       Note  that in this message, the value given is the 'Normalized' not the
339       'Raw' Attribute value (the disk temperature in this case  is  about  22
340       Celsius).   The  '-R' and '-r' Directives modify this behavior, so that
341       the information is printed with the Raw values as well, for example:
342       'Device: /dev/sda, SMART  Attribute:  194  Temperature_Celsius  changed
343       from 94 [Raw 22] to 93 [Raw 23]'
344       Here  the  Raw values are the actual disk temperatures in Celsius.  The
345       way in which the Raw values are printed, and the names under which  the
346       Attributes  are  reported,  is governed by the various '-v Num,Descrip‐
347       tion' Directives described previously.
348
349       Please see the smartctl manual page for further explanation of the dif‐
350       ferences between Normalized and Raw Attribute values.
351
352       smartd  will make log entries at loglevel LOG_CRIT if a SMART Attribute
353       has failed, for example:
354       'Device: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct'
355        This loglevel  is  used  for  reporting  enabled  by  the  '-H',  -f',
356       '-l selftest', and '-l error' Directives.  Entries reporting failure of
357       SMART Prefailure Attributes should not be ignored: they mean  that  the
358       disk is failing.  Use the smartctl utility to investigate.
359
360

LOG TIMESTAMP TIMEZONE

362       When smartd makes log entries, these are time-stamped.  The time stamps
363       are in the computer's local time zone, which is generally set using ei‐
364       ther  the  environment  variable 'TZ' or using a time-zone file such as
365       /etc/localtime.  You may wish to change the timezone  while  smartd  is
366       running  (for  example,  if  you  carry a laptop to a new time-zone and
367       don't reboot it).  Due to a bug in the tzset(3) function of  many  unix
368       standard  C libraries, the time-zone stamps of smartd might not change.
369       For some systems, smartd will work around this problem if the time-zone
370       is set using /etc/localtime.  The work-around fails if the time-zone is
371       set using the 'TZ' variable (or a file that it points to).
372
373

EXIT STATUS

375       The exit status (return value) of smartd can have the following values:
376
377       0:     Daemon startup successful, or smartd was killed by a SIGTERM (or
378              in debug mode, a SIGQUIT).
379
380       1:     Commandline did not parse.
381
382       2:     There was a syntax error in the config file.
383
384       3:     Forking the daemon failed.
385
386       4:     Couldn't create PID file.
387
388       5:     Config  file  does  not exist (only returned in conjunction with
389              the '-c' option).
390
391       6:     Config file exists, but cannot be read.
392
393       8:     smartd ran out of memory during startup.
394
395       10:    An inconsistency was found in smartd's internal data structures.
396              This  should never happen.  It must be due to either a coding or
397              compiler bug.  Please report such failures to smartmontools  de‐
398              velopers, see REPORTING BUGS below.
399
400       16:    A  device  explicitly  listed  in /etc/smartmontools/smartd.conf
401              can't be monitored.
402
403       17:    smartd didn't find any devices to monitor.
404
405       254:   When in daemon mode, smartd received a SIGINT or SIGQUIT.  (Note
406              that  in  debug  mode, SIGINT has the same effect as SIGHUP, and
407              makes smartd reload its configuration  file.   SIGQUIT  has  the
408              same  effect as SIGTERM and causes smartd to exit with zero exit
409              status.
410
411       132 and above
412              smartd was killed by a signal  that  is  not  explicitly  listed
413              above.  The exit status is then 128 plus the signal number.  For
414              example if smartd is killed by SIGKILL (signal 9) then the  exit
415              status is 137.
416
417

FILES

419       /usr/sbin/smartd
420              full path of this executable.
421
422       /etc/smartmontools/smartd.conf
423              configuration file (see smartd.conf(5) man page).
424
425       /etc/smartmontools/smartd_warning.sh
426              script  run on warnings (see '-w' option above and '-M exec' di‐
427              rective on smartd.conf(5) man page).
428
429       /etc/smartmontools/smartd_warning.d/
430              plugin directory for smartd warning script (see  '-m'  directive
431              on smartd.conf(5) man page).
432
433       /usr/share/smartmontools/drivedb.h
434              drive database (see '-B' option).
435
436       /etc/smartmontools/smart_drivedb.h
437              optional local drive database (see '-B' option).
438
439

AUTHORS

441       Bruce Allen (project initiator),
442       Christian  Franke  (project  manager,  Windows  port  and  all  sort of
443       things),
444       Douglas Gilbert (SCSI subsystem),
445       Volker Kuhlmann (moderator of support and database mailing list),
446       Gabriele Pohl (wiki & development team support),
447       Alex Samorukov (FreeBSD port and more, new Trac wiki).
448
449       Many other individuals have made contributions and corrections, see AU‐
450       THORS, ChangeLog and repository files.
451
452       The  first  smartmontools code was derived from the smartsuite package,
453       written by Michael Cornwell and Andre Hedrick.
454
455

REPORTING BUGS

457       To submit a bug report, create a ticket in smartmontools wiki:
458       <https://www.smartmontools.org/>.
459       Alternatively send the info to the smartmontools support mailing list:
460       <https://listi.jpberlin.de/mailman/listinfo/smartmontools-support>.
461
462

SEE ALSO

464       smartd.conf(5), smartctl(8).
465       update-smart-drivedb(8).
466       systemd.exec(5).
467
468

REFERENCES

470       Please see the following web site for more info: <https://www.smartmon
471       tools.org/>
472
473       An  introductory  article  about smartmontools is Monitoring Hard Disks
474       with SMART, by Bruce Allen, Linux Journal, January 2004,  pages  74–77.
475       See <https://www.linuxjournal.com/article/6983>.
476
477       If  you  would  like  to understand better how SMART works, and what it
478       does, a good place to start is with Sections 4.8 and 6.54 of the  first
479       volume  of  the  'AT  Attachment with Packet Interface-7' (ATA/ATAPI-7)
480       specification Revision 4b.   This  documents  the  SMART  functionality
481       which the smartmontools utilities provide access to.
482
483       The  functioning of SMART was originally defined by the SFF-8035i revi‐
484       sion 2 and the SFF-8055i revision 1.4 specifications.  These are publi‐
485       cations of the Small Form Factors (SFF) Committee.
486
487       Links  to  these  and other documents may be found on the Links page of
488       the smartmontools Wiki at <https://www.smartmontools.org/wiki/Links>.
489
490

PACKAGE VERSION

492       smartmontools-7.2 2020-12-30 r5155
493       $Id: smartd.8.in 4861 2018-12-16 18:24:57Z chrfranke $
494
495
496
497smartmontools-7.2                 2020-12-30                         SMARTD(8)
Impressum