]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartd.8.in
import smartmontools 7.0
[mirror_smartmontools-debian.git] / smartd.8.in
CommitLineData
832b75ed 1.ig
a86ec89e 2Copyright (C) 2002-10 Bruce Allen
ff28b140 3Copyright (C) 2004-18 Christian Franke
ee38a438 4
ff28b140 5SPDX-License-Identifier: GPL-2.0-or-later
832b75ed 6
ff28b140 7$Id: smartd.8.in 4861 2018-12-16 18:24:57Z chrfranke $
ee38a438 8
832b75ed 9..
f9e10201
JD
10.\" Macros borrowed from pages generated with Pod::Man
11.de Sp \" Vertical space (when we can't use .PP)
12.if t .sp 0.4v
13.if n .sp
14..
15.de Vb \" Begin verbatim text
16.ft CW
17.nf
18.ne \\$1
19..
20.de Ve \" End verbatim text
21.ft R
22.fi
23..
24.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
25.ie \n(.g .ds Aq \(aq
26.el .ds Aq '
a86ec89e 27.TH SMARTD 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
832b75ed
GG
28.SH NAME
29\fBsmartd\fP \- SMART Disk Monitoring Daemon
ff28b140 30.Sp
832b75ed
GG
31.SH SYNOPSIS
32.B smartd [options]
ff28b140 33.Sp
832b75ed 34.SH DESCRIPTION
d008864d
GI
35.\" %IF NOT OS ALL
36.\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
37.\"! It does not contain info specific to other platforms.]
38.\"! .PP
39.\" %ENDIF NOT OS ALL
ee38a438
GI
40\fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis and
41Reporting Technology (SMART) system built into most ATA/SATA and SCSI/SAS
42hard drives and solid-state drives.
43The purpose of SMART is to monitor the reliability of the hard drive
44and predict drive failures, and to carry out different types of drive
45self-tests.
46This version of \fBsmartd\fP is compatible with
d2e702cf 47ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards
ee38a438 48(see \fBREFERENCES\fP below).
f9e10201 49.PP
832b75ed 50\fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
f9e10201 51(equivalent to \fBsmartctl \-s on\fP) and polls these and SCSI devices
832b75ed
GG
52every 30 minutes (configurable), logging SMART errors and changes of
53SMART Attributes via the SYSLOG interface. The default location for
e9583e0c
GI
54these SYSLOG notifications and warnings is system-dependent
55(typically \fB/var/log/messages\fP or \fB/var/log/syslog\fP).
f9e10201 56To change this default location, please see the \*(Aq\-l\*(Aq
832b75ed 57command-line option described below.
f9e10201 58.PP
832b75ed
GG
59In addition to logging to a file, \fBsmartd\fP can also be configured
60to send email warnings if problems are detected. Depending upon the
ee38a438 61type of problem, you may want to run self-tests on the disk, back up
f9e10201 62the disk, replace the disk, or use a manufacturer's utility to force
832b75ed
GG
63reallocation of bad or unreadable disk sectors. If disk problems are
64detected, please see the \fBsmartctl\fP manual page and the
65\fBsmartmontools\fP web page/FAQ for further guidance.
f9e10201 66.PP
832b75ed
GG
67If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
68check the status of the disks, and then return to polling the disks
f9e10201
JD
69every 30 minutes.
70See the \*(Aq\-i\*(Aq option below for additional details.
71.PP
832b75ed 72\fBsmartd\fP can be configured at start-up using the configuration
e9583e0c 73file \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed
GG
74If the configuration file is subsequently modified, \fBsmartd\fP
75can be told to re-read the configuration file by sending it a
76\fBHUP\fP signal, for example with the command:
d2e702cf 77.br
f9e10201 78\fBkillall \-HUP smartd\fP.
d2e702cf 79.br
d008864d 80.\" %IF OS Windows
832b75ed 81(Windows: See NOTES below.)
d008864d 82.\" %ENDIF OS Windows
f9e10201 83.PP
832b75ed 84On startup, if \fBsmartd\fP finds a syntax error in the configuration
f9e10201 85file, it will print an error message and then exit. However if
832b75ed
GG
86\fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
87to re-read the configuration file, and then find a syntax error in
88this file, it will print an error message and then continue, ignoring
89the contents of the (faulty) configuration file, as if the \fBHUP\fP
90signal had never been received.
f9e10201 91.PP
832b75ed 92When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
ee38a438 93(normally generated from a shell with CONTROL-C) is treated in the
832b75ed 94same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
f9e10201
JD
95configuration file.
96To exit \fBsmartd\fP use CONTROL-\e.
d008864d 97.\" %IF OS Windows
ee38a438 98(Windows: CONTROL-Break).
d008864d 99.\" %ENDIF OS Windows
ff28b140
TL
100.\" %IF ENABLE_SYSTEMD_NOTIFY
101.PP
102[Linux only]
103[NEW EXPERMIMENTAL SMARTD FEATURE]
104If \fBsmartd\fP is started as a \fBsystemd\fP(1) service and
105\*(AqType=Notify\*(Aq is specified in the service file, the service manager
106is notified after successful startup.
107Other state changes are reported via systemd notify STATUS messages.
108Notification of successful reloads (after \fBHUP\fP signal) is not supported.
109To detect this process start-up type, \fBsmartd\fP checks whether the
110environment variable \*(AqNOTIFY_SOCKET\*(Aq is set.
111Note that it is required to set the \*(Aq\-n\*(Aq (\*(Aq\-\-nofork\*(Aq)
112option in the \*(AqExecStart=/usr/local/sbin/smartd\*(Aq command line
113if \*(AqType=Notify\*(Aq is used.
114.\" %ENDIF ENABLE_SYSTEMD_NOTIFY
f9e10201 115.PP
832b75ed
GG
116On startup, in the absence of the configuration file
117\fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
118devices that support SMART. The scanning is done as follows:
d008864d 119.\" %IF OS Linux
832b75ed 120.IP \fBLINUX:\fP 9
f9e10201
JD
121Examine all entries \fB"/dev/hd[a\-t]"\fP for IDE/ATA
122devices, and \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP
a86ec89e 123for ATA/SATA or SCSI/SAS devices.
ee38a438 124Disks behind RAID controllers are not included.
f9e10201 125.Sp
f9e10201 126If directive \*(Aq\-d nvme\*(Aq
a86ec89e 127.\" %IF ENABLE_NVME_DEVICESCAN
f9e10201 128or no \*(Aq\-d\*(Aq directive
a86ec89e 129.\" %ENDIF ENABLE_NVME_DEVICESCAN
f9e10201 130is specified, examine all entries \fB"/dev/nvme[0\-99]"\fP for NVMe devices.
d008864d
GI
131.\" %ENDIF OS Linux
132.\" %IF OS FreeBSD
832b75ed 133.IP \fBFREEBSD:\fP 9
f9e10201
JD
134Authoritative list of disk devices is obtained from SCSI (CAM) and ATA
135subsystems.
ee38a438 136Disks behind RAID controllers are not included.
d008864d
GI
137.\" %ENDIF OS FreeBSD
138.\" %IF OS NetBSD OpenBSD
832b75ed 139.IP \fBNETBSD/OPENBSD:\fP 9
f9e10201
JD
140Authoritative list of disk devices is obtained from sysctl
141\*(Aqhw.disknames\*(Aq.
d008864d
GI
142.\" %ENDIF OS NetBSD OpenBSD
143.\" %IF OS Solaris
832b75ed 144.IP \fBSOLARIS:\fP 9
f4e463df 145Examine all entries \fB"/dev/rdsk/*s0"\fP for IDE/ATA and SCSI disk
832b75ed 146devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
d008864d
GI
147.\" %ENDIF OS Solaris
148.\" %IF OS Darwin
832b75ed
GG
149.IP \fBDARWIN:\fP 9
150The IOService plane is scanned for ATA block storage devices.
d008864d 151.\" %ENDIF OS Darwin
d008864d 152.\" %IF OS Windows Cygwin
ee38a438
GI
153.IP \fBWINDOWS\fP: 9
154Examine all entries \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP
155and \fB"/dev/sdd[a\-x]"\fP ("\\\\.\\PhysicalDrive[0\-127]") for
156IDE/(S)ATA and SCSI disk devices.
f9e10201 157.Sp
4d59bff9 158If a 3ware 9000 controller is installed, examine all entries
f9e10201
JD
159\fB"/dev/sdX,N"\fP for the first logical drive (\*(Aqunit\*(Aq
160\fB"/dev/sdX"\fP) and all physical disks (\*(Aqports\*(Aq \fB",N"\fP)
161detected behind this controller.
162Same for a second controller if present.
163.Sp
164If directive \*(Aq\-d csmi\*(Aq or no \*(Aq\-d\*(Aq directive is specified,
f4e463df
GI
165examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind an Intel
166ICHxR controller with RST driver.
f9e10201 167.Sp
ee38a438 168Disks behind Areca RAID controllers are not included.
f9e10201 169.Sp
f9e10201 170If directive \*(Aq\-d nvme\*(Aq
a86ec89e 171.\" %IF ENABLE_NVME_DEVICESCAN
f9e10201 172or no \*(Aq\-d\*(Aq directive
a86ec89e 173.\" %ENDIF ENABLE_NVME_DEVICESCAN
f9e10201
JD
174is specified, examine all entries \fB"/dev/sd[...]"\fP (see above)
175and all entries \fB"/dev/nvme[0\-9]"\fP for NVMe devices.
d008864d 176.\" %ENDIF OS Windows Cygwin
832b75ed
GG
177.PP
178\fBsmartd\fP then monitors
f9e10201 179for \fIall\fP possible SMART errors (corresponding to the \*(Aq\-a\*(Aq
ee38a438 180Directive in the configuration file; see the \fBsmartd.conf\fP(5) man page).
f9e10201 181.Sp
d2e702cf 182.SH OPTIONS
832b75ed 183.TP
2127e193 184.B \-A PREFIX, \-\-attributelog=PREFIX
ee38a438 185Writes \fBsmartd\fP attribute information (normalized and raw
f9e10201
JD
186attribute values) to files \*(AqPREFIX\*(Aq\*(AqMODEL\-SERIAL.ata.csv\*(Aq
187or \*(AqPREFIX\*(Aq\*(AqVENDOR\-MODEL\-SERIAL.scsi.csv\*(Aq.
188At each check cycle attributes are logged as a line of semicolon separated
189triplets of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
190For SCSI devices error counters and temperature recorded in the form
191"counter-name;counter-value;".
cfbba5b9 192Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC).
f9e10201 193.Sp
d008864d 194.\" %IF ENABLE_ATTRIBUTELOG
2127e193 195If this option is not specified, attribute information is written to files
f9e10201 196\*(Aq/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\*(Aq.
2127e193 197To disable attribute log files, specify this option with an empty string
f9e10201 198argument: \*(Aq\-A ""\*(Aq.
d008864d 199.\" %ENDIF ENABLE_ATTRIBUTELOG
2127e193
GI
200MODEL and SERIAL are build from drive identify information, invalid
201characters are replaced by underline.
f9e10201
JD
202.Sp
203If the PREFIX has the form \*(Aq/path/dir/\*(Aq (e.g.\&
204\*(Aq/var/lib/smartd/\*(Aq), then files \*(AqMODEL\-SERIAL.ata.csv\*(Aq are
205created in directory \*(Aq/path/dir\*(Aq.
206If the PREFIX has the form \*(Aq/path/name\*(Aq (e.g.\&
207\*(Aq/var/lib/misc/attrlog\-\*(Aq),
208then files \*(AqnameMODEL\-SERIAL.ata.csv\*(Aq are created in directory
209\*(Aq/path/\*(Aq.
2127e193 210The path must be absolute, except if debug mode is enabled.
2127e193
GI
211.TP
212.B \-B [+]FILE, \-\-drivedb=[+]FILE
cfbba5b9 213[ATA only] Read the drive database from FILE. The new database replaces
f9e10201
JD
214the built in database by default. If \*(Aq+\*(Aq is specified, then the new
215entries prepend the built in entries.
bed94269 216Please see the \fBsmartctl\fP(8) man page for further details.
2127e193
GI
217.TP
218.B \-c FILE, \-\-configfile=FILE
832b75ed 219Read \fBsmartd\fP configuration Directives from FILE, instead of from
f9e10201
JD
220the default location \fB/usr/local/etc/smartd.conf\fP
221(Windows: \fBEXEDIR/smartd.conf\fP).
832b75ed 222If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error
f9e10201
JD
223message and exit with nonzero status.
224Thus, \*(Aq\-c /usr/local/etc/smartd.conf\*(Aq can be used to verify the
225existence of the default configuration file.
226.Sp
227By using \*(Aq\-\*(Aq for FILE, the configuration is read from standard input.
228This is useful for commands like:
229.br
a86ec89e 230.B echo /dev/sdb \-m user@home \-M test | smartd \-c \- \-q onecheck
f9e10201 231.br
832b75ed 232to perform quick and simple checks without a configuration file.
d008864d 233.\" %IF ENABLE_CAPABILITIES
a23d5117
GI
234.TP
235.B \-C, \-\-capabilities
a86ec89e
GI
236[Linux only] Use libcap-ng to drop unneeded Linux process \fBcapabilities\fP(7).
237The following capabilities are kept: CAP_SYS_ADMIN, CAP_SYS_RAWIO, CAP_MKNOD.
f9e10201 238.Sp
a23d5117 239Warning: Mail notification does not work when used.
d008864d 240.\" %ENDIF ENABLE_CAPABILITIES
832b75ed
GG
241.TP
242.B \-d, \-\-debug
f9e10201 243Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
832b75ed 244information to STDOUT rather than logging it to SYSLOG and does not
d2e702cf 245\fBfork\fP(2) into the background and detach from the controlling
832b75ed
GG
246terminal. In this mode, \fBsmartd\fP also prints more verbose
247information about what it is doing than when operating in "daemon"
f9e10201 248mode. In this mode, the \fBINT\fP signal (normally generated from a
ee38a438 249terminal with CONTROL-C) makes \fBsmartd\fP reload its configuration
832b75ed 250file. Please use CONTROL-\e to exit
d008864d 251.\" %IF OS Windows
ee38a438 252(Windows: CONTROL-Break).
f9e10201 253.Sp
f4e463df 254[Windows only] The "debug" mode can be toggled by the command
f9e10201
JD
255\fBsmartd sigusr2\fP.
256A new console for debug output is opened when debug mode is enabled.
d008864d 257.\" %ENDIF OS Windows
832b75ed
GG
258.TP
259.B \-D, \-\-showdirectives
260Prints a list (to STDOUT) of all the possible Directives which may
261appear in the configuration file /usr/local/etc/smartd.conf, and then exits.
d2e702cf
GI
262These Directives are described in the \fBsmartd.conf\fP(5) man page.
263They may appear in the configuration file following the device name.
832b75ed
GG
264.TP
265.B \-h, \-\-help, \-\-usage
266Prints usage message to STDOUT and exits.
267.TP
268.B \-i N, \-\-interval=N
269Sets the interval between disk checks to \fIN\fP seconds, where
270\fIN\fP is a decimal integer. The minimum allowed value is ten and
271the maximum is the largest positive integer that can be represented on
f9e10201
JD
272your system (often 2^31\-1). The default is 1800 seconds.
273.Sp
832b75ed
GG
274Note that the superuser can make \fBsmartd\fP check the status of the
275disks at any time by sending it the \fBSIGUSR1\fP signal, for example
276with the command:
f9e10201
JD
277.br
278.B kill \-SIGUSR1 <pid>
279.br
832b75ed
GG
280where \fB<pid>\fP is the process id number of \fBsmartd\fP. One may
281also use:
f9e10201
JD
282.br
283.B killall \-USR1 smartd
284.br
832b75ed 285for the same purpose.
d2e702cf 286.br
d008864d 287.\" %IF OS Windows
832b75ed 288(Windows: See NOTES below.)
d008864d 289.\" %ENDIF OS Windows
832b75ed
GG
290.TP
291.B \-l FACILITY, \-\-logfacility=FACILITY
292Uses syslog facility FACILITY to log the messages from \fBsmartd\fP.
293Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
294or \fIdaemon\fP [default]. If this command-line option is not used,
295then by default messages from \fBsmartd\fP are logged to the facility
296\fIdaemon\fP.
f9e10201 297.Sp
832b75ed 298If you would like to have \fBsmartd\fP messages logged somewhere other
f9e10201 299than the default location, include (for example) \*(Aq\-l local3\*(Aq in its
d2e702cf
GI
300start up argument list.
301Tell the syslog daemon to log all messages from facility \fBlocal3\fP
f9e10201
JD
302to (for example) \*(Aq/var/log/smartd.log\*(Aq.
303.Sp
832b75ed 304For more detailed information, please refer to the man pages for
d2e702cf
GI
305the local syslog daemon, typically \fBsyslogd\fP(8), \fBsyslog-ng\fP(8)
306or \fBrsyslogd\fP(8).
d008864d 307.\" %IF OS Cygwin
f9e10201
JD
308.Sp
309Cygwin: If no \fBsyslogd\fP is running, the \*(Aq\-l\*(Aq option has no effect.
d008864d
GI
310In this case, all \fBsyslog\fP messages are written to Windows event log.
311.\" %ENDIF OS Cygwin
312.\" %IF OS Windows
f9e10201 313.Sp
832b75ed 314Windows: Some \fBsyslog\fP functionality is implemented
f9e10201
JD
315internally in \fBsmartd\fP as follows: If no \*(Aq\-l\*(Aq option
316(or \*(Aq\-l daemon\*(Aq) is specified, messages are written to Windows
832b75ed 317event log or to file \fB./smartd.log\fP if event log is not available
f9e10201
JD
318(access denied).
319By specifying other values of FACILITY, log output is redirected as follows:
320\*(Aq\-l local0\*(Aq to file \fB./smartd.log\fP,
321\*(Aq\-l local1\*(Aq to standard output (redirect with \*(Aq>\*(Aq to any file),
322\*(Aq\-l local2\*(Aq to standard error,
323\*(Aq\-l local[3\-7]\*(Aq: to file \fB./smartd[1\-5].log\fP.
d008864d 324.\" %ENDIF OS Windows
a37e7145
GG
325.TP
326.B \-n, \-\-no\-fork
327Do not fork into background; this is useful when executed from modern
a86ec89e 328init methods like initng, minit, supervise or systemd.
d008864d 329.\" %IF OS Cygwin
f9e10201 330.Sp
a37e7145
GG
331On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv,
332see NOTES below.
d008864d
GI
333.\" %ENDIF OS Cygwin
334.\" %IF OS Windows
f9e10201
JD
335.Sp
336On Windows, this option is not available, use \*(Aq\-\-service\*(Aq instead.
d008864d 337.\" %ENDIF OS Windows
832b75ed
GG
338.TP
339.B \-p NAME, \-\-pidfile=NAME
340Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID
341number (PID). To avoid symlink attacks make sure the directory to
342which pidfile is written is only writable for root. Without this
343option, or if the \-\-debug option is given, no PID file is written on
344startup. If \fBsmartd\fP is killed with a maskable signal then the
345pidfile is removed.
346.TP
347.B \-q WHEN, \-\-quit=WHEN
348Specifies when, if ever, \fBsmartd\fP should exit. The valid
349arguments are to this option are:
f9e10201 350.Sp
832b75ed
GG
351.I nodev
352\- Exit if there are no devices to monitor, or if any errors are found
353at startup in the configuration file. This is the default.
f9e10201 354.Sp
832b75ed
GG
355.I errors
356\- Exit if there are no devices to monitor, or if any errors are found
357in the configuration file /usr/local/etc/smartd.conf at startup or whenever it
358is reloaded.
f9e10201 359.Sp
832b75ed
GG
360.I nodevstartup
361\- Exit if there are no devices to monitor at startup. But continue
362to run if no devices are found whenever the configuration file is
363reloaded.
f9e10201 364.Sp
832b75ed
GG
365.I never
366\- Only exit if a fatal error occurs (no remaining system memory,
f9e10201 367invalid command line arguments). In this mode, even if there are no
832b75ed
GG
368devices to monitor, or if the configuration file
369\fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
370waiting to load a configuration file listing valid devices.
f9e10201 371.Sp
832b75ed
GG
372.I onecheck
373\- Start \fBsmartd\fP in debug mode, then register devices, then check
f9e10201 374device's SMART status once, and then exit with zero exit status if all
832b75ed 375of these steps worked correctly.
f9e10201
JD
376.Sp
377This last option is intended for \*(Aqdistribution-writers\*(Aq who want to
832b75ed
GG
378create automated scripts to determine whether or not to automatically
379start up \fBsmartd\fP after installing smartmontools. After starting
f9e10201 380\fBsmartd\fP with this command-line option, the distribution's install
832b75ed
GG
381scripts should wait a reasonable length of time (say ten seconds). If
382\fBsmartd\fP has not exited with zero status by that time, the script
383should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
384\fBsmartd\fP will not operate correctly on the host. Conversely, if
385\fBsmartd\fP exits with zero status, then it is safe to run
f9e10201 386\fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
832b75ed
GG
387monitor any devices or encounters other problems then it will return
388with non-zero exit status.
f9e10201 389.Sp
832b75ed
GG
390.I showtests
391\- Start \fBsmartd\fP in debug mode, then register devices, then write
392a list of future scheduled self tests to stdout, and then exit with zero
393exit status if all of these steps worked correctly.
394Device's SMART status is not checked.
f9e10201
JD
395.Sp
396This option is intended to test whether the \*(Aq\-s REGEX\*(Aq directives in
397smartd.conf will have the desired effect. The output lists the next test
398schedules, limited to 5 tests per type and device. This is followed by a
832b75ed
GG
399summary of all tests of each device within the next 90 days.
400.TP
401.B \-r TYPE, \-\-report=TYPE
402Intended primarily to help
403.B smartmontools
404developers understand the behavior of
405.B smartmontools
406on non-conforming or poorly-conforming hardware. This option reports
407details of
408\fBsmartd\fP
409transactions with the device. The option can be used multiple times.
410When used just once, it shows a record of the ioctl() transactions
411with the device. When used more than once, the detail of these ioctl()
412transactions are reported in greater detail. The valid arguments to
413this option are:
f9e10201 414.Sp
832b75ed
GG
415.I ioctl
416\- report all ioctl() transactions.
f9e10201 417.Sp
832b75ed
GG
418.I ataioctl
419\- report only ioctl() transactions with ATA devices.
f9e10201 420.Sp
832b75ed
GG
421.I scsiioctl
422\- report only ioctl() transactions with SCSI devices.
f9e10201
JD
423.Sp
424.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
a86ec89e 425.I nvmeioctl
ff28b140 426\- report only ioctl() transactions with NVMe devices.
f9e10201
JD
427.Sp
428.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
832b75ed
GG
429Any argument may include a positive integer to specify the level of
430detail that should be reported. The argument should be followed by a
431comma then the integer with no spaces. For example, \fIataioctl,2\fP
f9e10201
JD
432The default level is 1, so \*(Aq\-r ataioctl,1\*(Aq and
433\*(Aq\-r ataioctl\*(Aq are equivalent.
2127e193
GI
434.TP
435.B \-s PREFIX, \-\-savestates=PREFIX
ee38a438 436Reads/writes \fBsmartd\fP state information from/to files
f9e10201
JD
437\*(AqPREFIX\*(Aq\*(AqMODEL\-SERIAL.ata.state\*(Aq or
438\*(AqPREFIX\*(Aq\*(AqVENDOR\-MODEL\-SERIAL.scsi.state\*(Aq.
ee38a438
GI
439This preserves SMART attributes, drive min and max temperatures (\-W directive),
440info about last sent warning email
2127e193
GI
441(\-m directive), and the time of next check of the self-test REGEXP
442(\-s directive) across boot cycles.
f9e10201 443.Sp
d008864d 444.\" %IF ENABLE_SAVESTATES
2127e193 445If this option is not specified, state information is maintained in files
f9e10201
JD
446\*(Aq/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\*(Aq
447for ATA devices and
448\*(Aq/usr/local/var/lib/smartmontools/smartd.VENDOR\-MODEL\-SERIAL.scsi.state\*(Aq
449for SCSI devices.
2127e193 450To disable state files, specify this option with an empty string
f9e10201 451argument: \*(Aq\-s ""\*(Aq.
d008864d 452.\" %ENDIF ENABLE_SAVESTATES
2127e193
GI
453MODEL and SERIAL are build from drive identify information, invalid
454characters are replaced by underline.
f9e10201
JD
455.Sp
456If the PREFIX has the form \*(Aq/path/dir/\*(Aq (e.g.\&
457\*(Aq/var/lib/smartd/\*(Aq), then files \*(AqMODEL\-SERIAL.ata.state\*(Aq are
458created in directory \*(Aq/path/dir\*(Aq.
459If the PREFIX has the form \*(Aq/path/name\*(Aq (e.g.\&
460\*(Aq/var/lib/misc/smartd\-\*(Aq),
461then files \*(AqnameMODEL\-SERIAL.ata.state\*(Aq are created in directory
462\*(Aq/path/\*(Aq.
2127e193 463The path must be absolute, except if debug mode is enabled.
f9e10201
JD
464.Sp
465The state information files are read on smartd startup. The files are
2127e193
GI
466always (re)written after reading the configuration file, before rereading
467the configuration file (SIGHUP), before smartd shutdown, and after a check
f9e10201 468forced by SIGUSR1. After a normal check cycle, a file is only rewritten if
2127e193 469an important change (which usually results in a SYSLOG output) occurred.
ee38a438
GI
470.TP
471.B \-w PATH, \-\-warnexec=PATH
ee38a438
GI
472Run the executable PATH instead of the default script when smartd
473needs to send warning messages. PATH must point to an executable binary
474file or script.
475The default script is
476.\" %IF NOT OS Windows
477\fB/usr/local/etc/smartd_warning.sh\fP.
478.\" %ENDIF NOT OS Windows
479.\" %IF OS ALL
480(Windows: EXEDIR/smartd_warning.cmd)
481.\" %ENDIF OS ALL
482.\" %IF OS Windows
483.\"! \fBEXEDIR/smartd_warning.cmd\fP.
484.\" %ENDIF OS Windows
d008864d 485.\" %IF OS Windows
832b75ed
GG
486.TP
487.B \-\-service
f4e463df 488[Windows only] Enables \fBsmartd\fP to run as a Windows service.
832b75ed 489The option must be specified in the service command line as the first
f9e10201
JD
490argument.
491It should not be used from console.
832b75ed 492See NOTES below for details.
d008864d 493.\" %ENDIF OS Windows
832b75ed
GG
494.TP
495.B \-V, \-\-version, \-\-license, \-\-copyright
2127e193
GI
496Prints version, copyright, license, home page and SVN revision
497information for your copy of \fBsmartd\fP to STDOUT and then exits.
f9e10201 498.Sp
832b75ed 499.SH EXAMPLES
d2e702cf
GI
500.B smartd
501.br
f9e10201 502Runs the daemon in forked mode. This is the normal way to run
832b75ed 503\fBsmartd\fP.
e9583e0c 504Entries are logged to SYSLOG.
f9e10201
JD
505.Sp
506.B smartd \-d \-i 30
d2e702cf 507.br
832b75ed
GG
508Run in foreground (debug) mode, checking the disk status
509every 30 seconds.
f9e10201
JD
510.Sp
511.B smartd \-q onecheck
d2e702cf 512.br
832b75ed 513Registers devices, and checks the status of the devices exactly
f9e10201
JD
514once.
515The exit status (the shell
832b75ed
GG
516.B $?
517variable) will be zero if all went well, and nonzero if no devices
518were detected or some other problem was encountered.
a86ec89e 519.\" %IF ENABLE_INITSCRIPT
f9e10201 520.Sp
832b75ed
GG
521Note that \fBsmartmontools\fP provides a start-up script in
522\fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
523stopping the daemon via the normal init interface. Using this script,
524you can start \fBsmartd\fP by giving the command:
f9e10201 525.br
832b75ed 526.B /usr/local/etc/rc.d/init.d/smartd start
f9e10201 527.br
832b75ed 528and stop it by using the command:
f9e10201 529.br
832b75ed 530.B /usr/local/etc/rc.d/init.d/smartd stop
a86ec89e 531.\" %ENDIF ENABLE_INITSCRIPT
f9e10201 532.Sp
d008864d 533.SH CONFIGURATION
d2e702cf 534The syntax of the \fBsmartd.conf\fP(5) file is discussed separately.
f9e10201 535.Sp
832b75ed
GG
536.SH NOTES
537\fBsmartd\fP
f9e10201 538will make log entries at loglevel
832b75ed
GG
539.B LOG_INFO
540if the Normalized SMART Attribute values have changed, as reported using the
f9e10201 541.B \*(Aq\-t\*(Aq, \*(Aq\-p\*(Aq,
832b75ed 542or
f9e10201
JD
543.B \*(Aq\-u\*(Aq
544Directives.
545For example:
546.br
547.B \*(AqDevice: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\*(Aq
548.br
549Note that in this message, the value given is the \*(AqNormalized\*(Aq not the
550\*(AqRaw\*(Aq Attribute value (the disk temperature in this case is about 22
551Celsius). The
552.B \*(Aq\-R\*(Aq
553and
554.B \*(Aq\-r\*(Aq
832b75ed
GG
555Directives modify this behavior, so that the information is printed
556with the Raw values as well, for example:
f9e10201
JD
557.br
558.B \*(AqDevice: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\*(Aq
559.br
832b75ed
GG
560Here the Raw values are the actual disk temperatures in Celsius. The
561way in which the Raw values are printed, and the names under which the
562Attributes are reported, is governed by the various
f9e10201 563.B \*(Aq\-v Num,Description\*(Aq
832b75ed 564Directives described previously.
f9e10201 565.PP
832b75ed
GG
566Please see the
567.B smartctl
568manual page for further explanation of the differences between
569Normalized and Raw Attribute values.
f9e10201 570.PP
832b75ed
GG
571\fBsmartd\fP
572will make log entries at loglevel
573.B LOG_CRIT
574if a SMART Attribute has failed, for example:
f9e10201
JD
575.br
576.B \*(AqDevice: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\*(Aq
577.br
832b75ed 578 This loglevel is used for reporting enabled by the
f9e10201 579.B \*(Aq\-H\*(Aq, \-f\*(Aq, \*(Aq\-l\ selftest\*(Aq,
832b75ed 580and
f9e10201
JD
581.B \*(Aq\-l\ error\*(Aq
582Directives. Entries reporting failure of SMART Prefailure Attributes
832b75ed
GG
583should not be ignored: they mean that the disk is failing. Use the
584.B smartctl
f9e10201 585utility to investigate.
d008864d 586.\" %IF OS Solaris
f9e10201 587.PP
832b75ed
GG
588Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
589messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
590Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
591lost. If you want to use the existing daemon facility to log all
592messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
593from:
f9e10201 594.Vb 1
832b75ed 595 ...;daemon.notice;... /var/adm/messages
f9e10201 596.Ve
832b75ed 597to read:
f9e10201 598.Vb 1
832b75ed 599 ...;daemon.info;... /var/adm/messages
f9e10201 600.Ve
832b75ed 601Alternatively, you can use a local facility to log messages: please
f9e10201 602see the \fBsmartd\fP \*(Aq\-l\*(Aq command-line option described above.
d008864d
GI
603.\" %ENDIF OS Solaris
604.\" %IF OS Cygwin
f9e10201 605.PP
d008864d 606The Cygwin Version of \fBsmartd\fP can be run as a service via the
a86ec89e
GI
607cygrunsrv tool.
608.\" %IF ENABLE_INITSCRIPT
609The start-up script provides Cygwin-specific commands to install and
610remove the service:
f9e10201 611.br
d008864d 612.B /usr/local/etc/rc.d/init.d/smartd install [options]
f9e10201 613.br
d008864d 614.B /usr/local/etc/rc.d/init.d/smartd remove
f9e10201 615.br
d008864d
GI
616The service can be started and stopped by the start-up script as usual
617(see \fBEXAMPLES\fP above).
a86ec89e 618.\" %ENDIF ENABLE_INITSCRIPT
d008864d
GI
619.\" %ENDIF OS Cygwin
620.\" %IF OS Windows
f9e10201 621.PP
d008864d 622On Windows, the log messages are written to the event log or to a file.
f9e10201
JD
623See documentation of the \*(Aq\-l FACILITY\*(Aq option above for details.
624.PP
832b75ed
GG
625On Windows, the following built-in commands can be used to control
626\fBsmartd\fP, if running as a daemon:
f9e10201
JD
627.PP
628\*(Aq\fBsmartd status\fP\*(Aq \- check status
629.br
630\*(Aq\fBsmartd stop\fP\*(Aq \- stop smartd
631.br
632\*(Aq\fBsmartd reload\fP\*(Aq \- reread config file
633.br
634\*(Aq\fBsmartd restart\fP\*(Aq \- restart smartd
635.br
636\*(Aq\fBsmartd sigusr1\fP\*(Aq \- check disks now
637.br
638\*(Aq\fBsmartd sigusr2\fP\*(Aq \- toggle debug mode
639.PP
832b75ed 640The Windows Version of \fBsmartd\fP has buildin support for services:
f9e10201
JD
641.PP
642\*(Aq\fBsmartd install [options]\fP\*(Aq installs a service
832b75ed 643named "smartd" (display name "SmartD Service") using the command line
f9e10201 644\*(Aq/INSTALLPATH/smartd.exe \-\-service [options]\*(Aq.
ee38a438
GI
645This also installs smartd.exe as a event message file for the Windows
646event viewer.
f9e10201
JD
647.PP
648\*(Aq\fBsmartd remove\fP\*(Aq can later be used to remove the service and
ee38a438 649event message entries from the registry.
f9e10201 650.PP
832b75ed 651Upon startup, the smartd service changes the working directory
f9e10201
JD
652to its own installation path. If smartd.conf and blat.exe are stored
653in this directory, no \*(Aq\-c\*(Aq option and \*(Aq\-M exec\*(Aq directive
654is needed.
655.PP
656The debug mode (\*(Aq\-d\*(Aq, \*(Aq\-q onecheck\*(Aq) does not work if
657smartd is running as service.
658.PP
659The service can be controlled as usual with Windows commands \*(Aqnet\*(Aq
660or \*(Aqsc\*(Aq (\*(Aq\fBnet start smartd\fP\*(Aq,
661\*(Aq\fBnet stop smartd\fP\*(Aq).
662.PP
663Pausing the service (\*(Aq\fBnet pause smartd\fP\*(Aq) sets the interval
664between disk checks (\*(Aq\-i N\*(Aq) to infinite.
665.PP
666Continuing the paused service (\*(Aq\fBnet continue smartd\fP\*(Aq) resets the
667interval and rereads the configuration file immediately (like \fBSIGHUP\fP).
668The \*(AqPARAMCHANGE\*(Aq service control command (\*(Aq\fBsc control smartd
669paramchange\fP\*(Aq) has the same effect regardless of paused state.
670.PP
671Continuing a still running service (\*(Aq\fBnet continue smartd\fP\*(Aq without
672preceding \*(Aq\fBnet pause smartd\fP\*(Aq) does not reread configuration but
832b75ed 673checks disks immediately (like \fBSIGUSR1\fP).
d008864d 674.\" %ENDIF OS Windows
f9e10201 675.Sp
832b75ed 676.SH LOG TIMESTAMP TIMEZONE
832b75ed
GG
677When \fBsmartd\fP makes log entries, these are time-stamped. The time
678stamps are in the computer's local time zone, which is generally set
f9e10201 679using either the environment variable \*(Aq\fBTZ\fP\*(Aq or using a
832b75ed
GG
680time-zone file such as \fB/etc/localtime\fP. You may wish to change
681the timezone while \fBsmartd\fP is running (for example, if you carry
682a laptop to a new time-zone and don't reboot it). Due to a bug in the
d2e702cf 683\fBtzset\fP(3) function of many unix standard C libraries, the
832b75ed
GG
684time-zone stamps of \fBsmartd\fP might not change. For some systems,
685\fBsmartd\fP will work around this problem \fIif\fP the time-zone is
f9e10201
JD
686set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
687time-zone is set using the \*(Aq\fBTZ\fP\*(Aq variable (or a file that it
832b75ed 688points to).
f9e10201 689.Sp
a86ec89e
GI
690.SH EXIT STATUS
691The exit status (return value) of \fBsmartd\fP can have the following values:
832b75ed
GG
692.TP
693.B 0:
f9e10201
JD
694Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM
695(or in debug mode, a SIGQUIT).
832b75ed
GG
696.TP
697.B 1:
698Commandline did not parse.
699.TP
700.B 2:
701There was a syntax error in the config file.
702.TP
703.B 3:
704Forking the daemon failed.
705.TP
706.B 4:
f9e10201 707Couldn't create PID file.
832b75ed
GG
708.TP
709.B 5:
f9e10201
JD
710Config file does not exist (only returned in conjunction with the \*(Aq\-c\*(Aq
711option).
832b75ed
GG
712.TP
713.B 6:
714Config file exists, but cannot be read.
715.TP
716.B 8:
717\fBsmartd\fP
718ran out of memory during startup.
719.TP
f4e463df 720.B 10:
f9e10201
JD
721An inconsistency was found in \fBsmartd\fP's internal data
722structures. This should never happen. It must be due to either a
832b75ed 723coding or compiler bug. \fIPlease\fP report such failures to
a86ec89e 724smartmontools developers, see REPORTING BUGS below.
832b75ed
GG
725.TP
726.B 16:
727A device explicitly listed in
728.B /usr/local/etc/smartd.conf
f9e10201 729can't be monitored.
832b75ed
GG
730.TP
731.B 17:
732\fBsmartd\fP
f9e10201 733didn't find any devices to monitor.
832b75ed
GG
734.TP
735.B 254:
736When in daemon mode,
737\fBsmartd\fP
738received a SIGINT or SIGQUIT. (Note that in debug mode, SIGINT has
739the same effect as SIGHUP, and makes \fBsmartd\fP reload its
f9e10201 740configuration file. SIGQUIT has the same effect as SIGTERM and causes
832b75ed
GG
741\fBsmartd\fP to exit with zero exit status.
742.TP
743.B 132 and above
744\fBsmartd\fP
745was killed by a signal that is not explicitly listed above. The exit
746status is then 128 plus the signal number. For example if
747\fBsmartd\fP
748is killed by SIGKILL (signal 9) then the exit status is 137.
f9e10201 749.Sp
d2e702cf
GI
750.\" %IF NOT OS Windows
751.SH FILES
752.TP
753.B /usr/local/sbin/smartd
754full path of this executable.
755.TP
756.B /usr/local/etc/smartd.conf
757configuration file (see \fBsmartd.conf\fP(5) man page).
758.TP
759.B /usr/local/etc/smartd_warning.sh
f9e10201
JD
760script run on warnings (see \*(Aq\-w\*(Aq option above and \*(Aq\-M exec\*(Aq
761directive on \fBsmartd.conf\fP(5) man page).
d2e702cf
GI
762.\" %IF ENABLE_SMARTDPLUGINDIR
763.TP
764.B /usr/local/etc/smartd_warning.d/
f9e10201 765plugin directory for smartd warning script (see \*(Aq\-m\*(Aq directive on
d2e702cf
GI
766\fBsmartd.conf\fP(5) man page).
767.\" %ENDIF ENABLE_SMARTDPLUGINDIR
768.\" %IF ENABLE_DRIVEDB
769.TP
770.B /usr/local/share/smartmontools/drivedb.h
f9e10201 771drive database (see \*(Aq\-B\*(Aq option).
d2e702cf
GI
772.\" %ENDIF ENABLE_DRIVEDB
773.TP
774.B /usr/local/etc/smart_drivedb.h
f9e10201
JD
775optional local drive database (see \*(Aq\-B\*(Aq option).
776.Sp
d2e702cf 777.\" %ENDIF NOT OS Windows
ee38a438 778.SH AUTHORS
a86ec89e 779\fBBruce Allen\fP (project initiator),
d2e702cf 780.br
a86ec89e 781\fBChristian Franke\fP (project manager, Windows port and all sort of things),
d2e702cf 782.br
a86ec89e 783\fBDouglas Gilbert\fP (SCSI subsystem),
d2e702cf 784.br
a86ec89e 785\fBVolker Kuhlmann\fP (moderator of support and database mailing list),
d2e702cf 786.br
a86ec89e 787\fBGabriele Pohl\fP (wiki & development team support),
d2e702cf 788.br
a86ec89e 789\fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
f9e10201 790.PP
a86ec89e
GI
791Many other individuals have made contributions and corrections,
792see AUTHORS, ChangeLog and repository files.
f9e10201 793.PP
a86ec89e
GI
794The first smartmontools code was derived from the smartsuite package,
795written by Michael Cornwell and Andre Hedrick.
f9e10201 796.Sp
a86ec89e
GI
797.SH REPORTING BUGS
798To submit a bug report, create a ticket in smartmontools wiki:
d2e702cf 799.br
f9e10201 800<\fBhttps://www.smartmontools.org/\fP>.
d2e702cf 801.br
a86ec89e 802Alternatively send the info to the smartmontools support mailing list:
d2e702cf 803.br
f9e10201
JD
804<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>.
805.Sp
d2e702cf 806.SH SEE ALSO
a86ec89e
GI
807\fBsmartd.conf\fP(5), \fBsmartctl\fP(8).
808.\" %IF ENABLE_UPDATE_SMART_DRIVEDB
809.br
810\fBupdate-smart-drivedb\fP(8).
811.\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
ff28b140
TL
812.\" %IF ENABLE_SYSTEMD_NOTIFY
813.br
814\fBsystemd.exec\fP(5).
815.\" %ENDIF ENABLE_SYSTEMD_NOTIFY
f9e10201 816.Sp
d2e702cf
GI
817.SH REFERENCES
818Please see the following web site for more info:
f9e10201
JD
819<\fBhttps://www.smartmontools.org/\fP>
820.PP
832b75ed
GG
821An introductory article about smartmontools is \fIMonitoring Hard
822Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
f9e10201
JD
823pages 74\(en77.
824See <\fBhttps://www.linuxjournal.com/article/6983\fP>.
825.PP
832b75ed
GG
826If you would like to understand better how SMART works, and what it
827does, a good place to start is with Sections 4.8 and 6.54 of the first
f9e10201 828volume of the \*(AqAT Attachment with Packet Interface-7\*(Aq (ATA/ATAPI-7)
e9583e0c
GI
829specification Revision 4b. This documents the SMART functionality which the
830\fBsmartmontools\fP utilities provide access to.
f9e10201 831.PP
ee38a438
GI
832The functioning of SMART was originally defined by the SFF-8035i
833revision 2 and the SFF-8055i revision 1.4 specifications. These are
e9583e0c 834publications of the Small Form Factors (SFF) Committee.
f9e10201 835.PP
e9583e0c 836Links to these and other documents may be found on the Links page of the
f9e10201
JD
837\fBsmartmontools\fP Wiki at <\fBhttps://www.smartmontools.org/wiki/Links\fP>.
838.Sp
a86ec89e
GI
839.SH PACKAGE VERSION
840CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
841.br
ff28b140 842$Id: smartd.8.in 4861 2018-12-16 18:24:57Z chrfranke $