1SMARTD(8)                         2016-09-28                         SMARTD(8)
2
3
4

NAME

6       smartd - SMART Disk Monitoring Daemon
7
8

SYNOPSIS

10       smartd [options]
11
12

FULL PATH

14       /usr/sbin/smartd
15
16

PACKAGE VERSION

18       smartmontools-5.43 2016-09-28 r4347
19
20

DESCRIPTION

22       [This man page is generated for the Linux version of smartmontools.  It
23       does not contain info specific to other platforms.]
24
25       smartd is a daemon that  monitors  the  Self-Monitoring,  Analysis  and
26       Reporting  Technology  (SMART)  system  built into many ATA-3 and later
27       ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the
28       reliability  of the hard drive and predict drive failures, and to carry
29       out different types of drive self-tests.  This  version  of  smartd  is
30       compatible  with  ATA/ATAPI-7  and  earlier  standards  (see REFERENCES
31       below).
32
33       smartd will attempt to enable SMART monitoring on ATA devices  (equiva‐
34       lent  to smartctl -s on) and polls these and SCSI devices every 30 min‐
35       utes  (configurable),  logging  SMART  errors  and  changes  of   SMART
36       Attributes  via  the  SYSLOG interface.  The default location for these
37       SYSLOG  notifications  and  warnings  is  system-dependent   (typically
38       /var/log/messages  or  /var/log/syslog).   To change this default loca‐
39       tion, please see the ´-l´ command-line option described below.
40
41       In addition to logging to a file, smartd can also be configured to send
42       email  warnings  if  problems are detected.  Depending upon the type of
43       problem, you may want to run self-tests on the disk, back up the  disk,
44       replace the disk, or use a manufacturer´s utility to force reallocation
45       of bad or unreadable disk sectors.   If  disk  problems  are  detected,
46       please  see the smartctl manual page and the smartmontools web page/FAQ
47       for further guidance.
48
49       If you send a USR1 signal to smartd it will immediately check the  sta‐
50       tus  of  the  disks, and then return to polling the disks every 30 min‐
51       utes. See the ´-i´ option below for additional details.
52
53       smartd can be configured  at  start-up  using  the  configuration  file
54       /etc/smartd.conf  (Windows:  EXEDIR/smartd.conf).  If the configuration
55       file is subsequently modified, smartd can be told to re-read  the  con‐
56       figuration  file  by sending it a HUP signal, for example with the com‐
57       mand:
58       killall -HUP smartd.
59
60       On startup, if smartd finds a syntax error in the  configuration  file,
61       it  will  print  an  error  message and then exit. However if smartd is
62       already running, then is told with a HUP signal to re-read the configu‐
63       ration  file,  and then find a syntax error in this file, it will print
64       an error message and  then  continue,  ignoring  the  contents  of  the
65       (faulty)  configuration  file,  as  if  the  HUP  signal had never been
66       received.
67
68       When smartd is running in debug mode, the INT signal  (normally  gener‐
69       ated  from  a shell with CONTROL-C) is treated in the same way as a HUP
70       signal: it makes smartd reload its configuration file. To  exit  smartd
71       use CONTROL-\
72
73       On  startup, in the absence of the configuration file /etc/smartd.conf,
74       the smartd daemon first scans for all devices that support SMART.   The
75       scanning is done as follows:
76
77       LINUX:   Examine  all  entries  "/dev/hd[a-t]" for IDE/ATA devices, and
78                "/dev/sd[a-z]", "/dev/sd[a-c][a-z]" for SCSI or SATA devices.
79
80       smartd then monitors for all possible SMART  errors  (corresponding  to
81       the  ´-a´  Directive  in the configuration file; see CONFIGURATION FILE
82       below).
83
84

OPTIONS

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

EXAMPLES

310       smartd
311       Runs  the  daemon in forked mode. This is the normal way to run smartd.
312       Entries are logged to SYSLOG.
313
314       smartd -d -i 30
315       Run in foreground (debug) mode, checking the disk status every 30  sec‐
316       onds.
317
318       smartd -q onecheck
319       Registers  devices,  and checks the status of the devices exactly once.
320       The exit status (the bash $?  variable) will be zero if all went  well,
321       and  nonzero  if  no  devices  were  detected or some other problem was
322       encountered.
323
324       Note   that   smartmontools   provides    a    start-up    script    in
325       /etc/rc.d/init.d/smartd  which is responsible for starting and stopping
326       the daemon via the normal init interface.  Using this script,  you  can
327       start smartd by giving the command:
328       /etc/rc.d/init.d/smartd start
329       and stop it by using the command:
330       /etc/rc.d/init.d/smartd stop
331

CONFIGURATION

333       The syntax of the smartd.conf(5) file is discussed separately.
334

NOTES

336       smartd  will  make  log  entries at loglevel LOG_INFO if the Normalized
337       SMART Attribute values have changed, as reported using the ´-t´,  ´-p´,
338       or ´-u´ Directives. For example:
339       ´Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93´
340       Note  that in this message, the value given is the ´Normalized´ not the
341       ´Raw´ Attribute value (the disk temperature in this case  is  about  22
342       Celsius).   The  ´-R´ and ´-r´ Directives modify this behavior, so that
343       the information is printed with the Raw values as well, for example:
344       ´Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed 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/hdc, 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
375

RETURN VALUES

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

AUTHOR

426       Bruce Allen smartmontools-support@lists.sourceforge.net
427       University of Wisconsin - Milwaukee Physics Department
428
429

CONTRIBUTORS

431       The following have made large contributions to smartmontools:
432       Casper Dik (Solaris SCSI interface)
433       Christian Franke (Windows interface, C++ redesign, USB support, ...)
434       Douglas Gilbert (SCSI subsystem)
435       Guido Guenther (Autoconf/Automake packaging)
436       Geoffrey Keating (Darwin ATA interface)
437       Eduard Martinescu (FreeBSD interface)
438       Frédéric L. W. Meunier (Web site and Mailing list)
439       Gabriele Pohl (Web site and Wiki, conversion from CVS to SVN)
440       Keiji Sawada (Solaris ATA interface)
441       Manfred Schwarb (Drive database)
442       Sergey Svishchev (NetBSD interface)
443       David Snyder and Sergey Svishchev (OpenBSD interface)
444       Phil Williams (User interface and drive database)
445       Shengfeng Zhou (Linux/FreeBSD HighPoint RocketRAID interface)
446       Many other individuals have made smaller contributions and corrections.
447
448

CREDITS

450       This  code  was derived from the smartsuite package, written by Michael
451       Cornwell, and from the previous UCSC smartsuite  package.   It  extends
452       these  to  cover  ATA-5 disks.  This code was originally developed as a
453       Senior Thesis by Michael Cornwell at the Concurrent Systems  Laboratory
454       (now  part  of the Storage Systems Research Center), Jack Baskin School
455       of    Engineering,    University    of    California,    Santa    Cruz.
456       http://ssrc.soe.ucsc.edu/ .
457

HOME PAGE FOR SMARTMONTOOLS:

459       Please  see  the following web site for updates, further documentation,
460       bug reports and patches: http://smartmontools.sourceforge.net/
461
462

SEE ALSO:

464       smartd.conf(5), smartctl(8), syslogd(8), syslog.conf(5),  badblocks(8),
465       ide-smart(8), regex(7).
466
467

REFERENCES FOR SMART

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

SVN ID OF THIS PAGE:

489       $Id: smartd.8.in 3561 2012-06-05 19:49:31Z chrfranke $
490
491
492
493smartmontools-5.43                2016-09-28                         SMARTD(8)
Impressum