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
18       Reporting  Technology  (SMART)  system  built  into  most  ATA/SATA and
19       SCSI/SAS hard drives and solid-state drives.  The purpose of  SMART  is
20       to  monitor  the  reliability of the hard drive and predict drive fail‐
21       ures, and to carry out different types of drive self-tests.  This  ver‐
22       sion  of  smartd is compatible with ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7
23       and earlier 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
28       Attributes  via  the  SYSLOG interface.  The default location for these
29       SYSLOG  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
54       already running, then is told with a HUP signal to re-read the configu‐
55       ration  file,  and then find a syntax error in this file, it will print
56       an error message and  then  continue,  ignoring  the  contents  of  the
57       (faulty)  configuration  file,  as  if  the  HUP  signal had never been
58       received.
59
60       When smartd is running in debug mode, the INT signal  (normally  gener‐
61       ated  from  a shell with CONTROL-C) is treated in the same way as a HUP
62       signal: it makes smartd reload its configuration file.  To exit  smartd
63       use CONTROL-\.
64
65       [Linux only] [NEW EXPERMIMENTAL SMARTD FEATURE] If smartd is started as
66       a systemd(1) service and 'Type=Notify'  is  specified  in  the  service
67       file,  the service manager is notified after successful startup.  Other
68       state changes are reported via systemd notify STATUS messages.  Notifi‐
69       cation  of  successful reloads (after HUP signal) is not supported.  To
70       detect this process start-up type, smartd checks whether  the  environ‐
71       ment  variable 'NOTIFY_SOCKET' is set.  Note that it is required to set
72       the '-n' ('--nofork') option in the  'ExecStart=/usr/sbin/smartd'  com‐
73       mand line if 'Type=Notify' is used.
74
75       On  startup,  in  the  absence of the configuration file /etc/smartmon‐
76       tools/smartd.conf, the smartd daemon first scans for all  devices  that
77       support SMART.  The scanning is done as follows:
78
79       LINUX:   Examine  all  entries  "/dev/hd[a-t]" for IDE/ATA devices, and
80                "/dev/sd[a-z]", "/dev/sd[a-c][a-z]" for ATA/SATA  or  SCSI/SAS
81                devices.  Disks behind RAID controllers are not included.
82
83                If  directive  '-d  nvme'  or  no '-d' directive is specified,
84                examine all entries "/dev/nvme[0-99]" for NVMe devices.
85
86       smartd then monitors for all possible SMART  errors  (corresponding  to
87       the  '-a'  Directive  in the configuration file; see the smartd.conf(5)
88       man page).
89
90

OPTIONS

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

EXAMPLES

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

CONFIGURATION

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

NOTES

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

LOG TIMESTAMP TIMEZONE

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

EXIT STATUS

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

FILES

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

AUTHORS

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

REPORTING BUGS

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

SEE ALSO

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

REFERENCES

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

PACKAGE VERSION

493       smartmontools-7.2 2021-01-17 r5171
494       $Id: smartd.8.in 4861 2018-12-16 18:24:57Z chrfranke $
495
496
497
498smartmontools-7.2                 2021-01-17                         SMARTD(8)
Impressum