1 Smartmontools installation instructions
2 =======================================
5 $Id: INSTALL 4120 2015-08-27 16:12:21Z samm2 $
7 $Id: INSTALL 4094 2015-05-27 21:41:17Z chrfranke $
8 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
10 Please also see the smartmontools home page:
11 http://www.smartmontools.org/
15 [1] System requirements
16 [2] Installing from SVN
17 [3] Installing from source tarball
18 [4] Guidelines for different Linux distributions
19 [5] Guidelines for FreeBSD
20 [6] Guidelines for Darwin
21 [7] Guidelines for NetBSD
22 [8] Guidelines for Solaris
23 [9] Guidelines for Cygwin
24 [10] Guidelines for Windows
25 [11] Guidelines for OS/2, eComStation
26 [12] Guidelines for OpenBSD
28 [14] Detailed description of ./configure options
30 [1] System requirements
31 =======================
35 Any Linux distribution will support smartmontools if it has a
36 kernel version greater than or equal to 2.2.14. So any recent
37 Linux distribution should support smartmontools.
41 For FreeBSD support, a 5-current kernel that includes ATAng is
42 required in order to support ATA drives. Even current versions of
43 ATAng will not support 100% operation, as the SMART status can not
44 be reliably retrieved. There is patch pending approval of the
45 ATAng driver maintainer that will address this issue.
49 The SCSI code has been tested on a variety of Solaris 8 and 9
50 systems. ATA/IDE code only works on SPARC platform. All tested
51 kernels worked correctly.
55 The code was tested on a 1.6ZG (i.e., 1.6-current) system. It should
56 also function under 1.6.1 and later releases (unverified). Currently
57 it doesn't support ATA devices on 3ware RAID controllers.
61 The code was tested on Cygwin 1.7.15-1. It should also work on other
64 Both Cygwin and Windows versions of smartmontools share the same code
65 to access the IDE/ATA or SCSI devices. The information in the "Windows"
66 section below also applies to the Cygwin version.
70 The code was tested on Windows XP SP3, 2003, Vista, Windows 7, 8, 8.1
71 and Windows 10 Release Preview. Support von Windows 9x/ME and NT4 was
72 removed after smartmontools 5.43.
74 ATA or SATA devices are supported if the device driver implements
75 the SMART IOCTLs or IOCTL_IDE_PASS_THROUGH or IOCTL_ATA_PASS_THROUGH.
76 Only the latter provides full pass-through support which is needed
77 for all smartmontools features.
79 SCSI and USB devices are accessed through SPTI. Special driver support
82 3ware 9000 RAID controllers are supported using features available
83 in the Windows driver release 9.4.0 (3wareDrv.sys 3.0.2.70) or later.
84 Older drivers provide SMART access to the first physical drive (port)
85 of each logical drive (unit). If driver support is not available
86 (7000/8000 series, 9000 on XP 64), smartctl can be used to parse SMART
87 data output from CLI or 3DM.
91 The code was tested on MacOS 10.3.4. It should work from 10.3
92 forwards. It doesn't support 10.2.
94 It's important to know that on 10.3.x, some things don't work
95 (see WARNINGS): due to bugs in the libraries used, you cannot run
96 a short test or switch SMART support off on a drive; if you try,
97 you will just run an extended test or switch SMART support on. So
98 don't panic when your "short" test seems to be taking hours.
100 It's also not possible at present to control when the offline
101 routine runs. If your drive doesn't have it running automatically by
102 default, you can't run it at all.
104 SCSI devices are not currently supported. Detecting the power
105 status of a drive is also not currently supported.
107 To summarize this, from another point of view, the things that
108 are not supported fall into two categories:
110 * Can't be implemented easily without more kernel-level support,
112 - running immediate offline, conveyance, or selective tests
113 - running any test in captive mode
115 - switching automatic offline testing on or off
117 - checking the power mode [-n Directive of smartd] (this is not
118 completely impossible, but not by using a documented API)
120 * Work on 10.4 and later, but not on 10.3:
121 - switching off SMART (switching *on* works fine)
122 - switching off auto-save (but why would you want to?)
123 - running the short test (that leaves you with only the extended test)
125 However, some things do work well. For ATA devices, all the
126 informational output is available, unless you want something that only
127 an offline test updates. On many newer Mac OS systems, the
128 hard drive comes with the offline test switched on by default, so
131 The OS X SAT SMART Driver provides access to SMART data for SAT capable
132 USB and Firewire devices:
133 https://github.com/kasbert/OS-X-SAT-SMART-Driver
134 https://github.com/RJVB/OS-X-SAT-SMART-Driver
135 This does not require any smartctl -d TYPE option and should work also
136 with older smartmontools releases.
140 The code was tested on eComStation 1.1, but it should work on all versions
142 Innotek LibC 0.5 runtime is required.
143 Only ATA disks are supported.
145 [2] Installing from SVN
146 =======================
148 Get the sources from the SVN repository:
149 svn co http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools smartmontools
153 and continue with step [3] below, skipping the "unpack the tarball" step.
155 The autogen.sh command is ONLY required when installing from
156 SVN. You need GNU Autoconf (version 2.50 or greater), GNU Automake
157 (version 1.7 or greater) and their dependencies installed in order
158 to run it. You can get these here:
159 http://directory.fsf.org/project/autoconf/
160 http://directory.fsf.org/project/automake/
162 [3] Installing from the source tarball
163 ======================================
165 If you are NOT installing from SVN, then unpack the tarball:
166 tar zxvf smartmontools-5.VERSION.tar.gz
171 make install (you may need to be root to do this)
173 As shown (with no options to ./configure) this defaults to the
174 following set of installation directories and other settings:
177 --exec-prefix='${prefix}'
178 --sbindir='${exec_prefix}/sbin'
179 --sysconfdir='${prefix}/etc'
180 --localstatedir='${prefix}/var'
181 --datarootdir='${prefix}/share'
182 --datadir='${datarootdir}'
183 --mandir='${datarootdir}/man'
184 --docdir='${datarootdir}/doc/smartmontools'
186 --with-systemdsystemunitdir=auto
187 --with-systemdenvfile=auto
188 --with-initscriptdir=auto
189 --with-exampledir='${docdir}/examplescripts'
190 --with-drivedbdir='${datadir}/smartmontools'
191 --with-smartdscriptdir='${sysconfdir}'
192 --with-smartdplugindir='${smartdscriptdir}/smartd_warning.d'
194 --without-attributelog
195 --with-os-deps='os_linux.o dev_areca.o' (platform specific)
197 --with-libcap-ng=auto
198 --with-working-snprintf
200 These will usually not overwrite existing "distribution" installations on
201 Linux Systems since the FHS reserves this area for use by the system
204 For different installation locations or distributions, simply add
205 arguments to ./configure as shown in [4] below.
207 If you wish to alter the default C++ compiler flags, set an
208 environment variable CXXFLAGS='your options' before doing
209 ./configure, or else do:
210 make CXXFLAGS='your options'
212 The first output line of smartctl and smartd provides information
213 about release number, last SVN checkin date and revison, platform,
214 and package. The latter defaults to "(local build)" and can be
215 changed by the variable BUILD_INFO, for example:
216 make BUILD_INFO='"(Debian 5.39-2)"'
218 [4] Guidelines for different Linux distributions
219 ================================================
221 Note: Please send corrections/additions to:
222 smartmontools-support@lists.sourceforge.net
225 If you don't want to overwrite any distribution package, use:
228 Filesystem Hierarchy Standard (FHS, http://www.pathname.com/fhs/):
229 ./configure --sbindir=/usr/local/sbin \
230 --sysconfdir=/usr/local/etc \
231 --mandir=/usr/local/man \
232 --docdir=/usr/local/share/doc/smartmontools \
233 --with-initscriptdir=/usr/local/etc/init.d
236 ./configure --sbindir=/usr/sbin \
238 --mandir=/usr/share/man \
239 --docdir=/usr/share/doc/smartmontools \
240 --with-initscriptdir=/etc/rc.d/init.d
243 If you don't want to overwrite any "distribution" package, use:
247 ./configure --sbindir=/usr/sbin \
249 --mandir=/usr/share/man \
250 --docdir=/usr/share/doc/smartmontools \
251 --with-initscriptdir=/etc/rc.d
254 removepkg smartmontools smartsuite (only root can do this)
257 The init script works on Slackware. You just have to add an entry like
258 the following in /etc/rc.d/rc.M or /etc/rc.d/rc.local:
260 if [ -x /etc/rc.d/smartd ]; then
261 . /etc/rc.d/smartd start
265 chmod 644 /etc/rc.d/smartd
267 For a list of options:
271 ./configure --sbindir=/usr/sbin \
273 --mandir=/usr/share/man \
274 --docdir=/usr/share/doc/packages/smartmontools-VERSION \
275 --with-initscriptdir=/etc/init.d \
277 [5] Guidelines for FreeBSD
278 ==========================
279 To match the way it will installed when it becomes available as a PORT, use
282 ./configure --prefix=/usr/local \
283 --docdir=/usr/local/share/doc/smartmontools-VERSION \
284 --with-initscriptdir=/usr/local/etc/rc.d/ \
287 NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
288 be installed with the string '.sample' append to the name, so you will end
289 up with the following:
290 /usr/local/etc/smartd.conf.sample
291 /usr/local/etc/rc.d/smartd.sample
294 [6] Guidelines for Darwin
295 =========================
296 ./configure --with-initscriptdir=/Library/StartupItems
298 If you'd like to build the i386 version on a powerpc machine, you can
301 CXX='g++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386' \
302 ./configure --host=i386-apple-darwin \
303 --with-initscriptdir=/Library/StartupItems
305 [7] Guidelines for NetBSD
306 =========================
307 ./configure --prefix=/usr/pkg \
308 --docdir=/usr/pkg/share/doc/smartmontools
310 [8] Guidelines for Solaris
311 ==========================
313 smartmontools has been partially but not completely ported to
314 Solaris. It includes complete SCSI support but no ATA or 3ware
315 support. It can be compiled with either CC (Sun's C++ compiler)
323 To compile with Sun CC:
325 env CC=cc CXX=CC ./configure [args]
328 The correct arguments [args] to configure are:
329 --sbindir=/usr/sbin \
331 --mandir=/usr/share/man \
332 --docdir=/usr/share/doc/smartmontools-VERSION \
333 --with-initscriptdir=/etc/init.d
335 To start the script automatically on bootup, create hardlinks that
336 indicate when to start/stop in:
338 pointing to /etc/init.d/smartd. Create:
339 K<knum>smartd in rcS.d, rc0.d, rc1.d, rc2.d
340 S<snum>smartd in rc3.d
341 where <knum> is related to <snum> such that the higher snum is the
344 On usual configuration, '95' would be suitable for <snum> and '05'
345 for <knum> respectively. If you choose these value, you can
349 sh -c 'for n in S 0 1 2; do ln init.d/smartd rc$n.d/K05smartd; done'
350 sh -c 'for n in 3 ; do ln init.d/smartd rc$n.d/S95smartd; done'
352 [9] Guidelines for Cygwin
353 =========================
356 ./configure --prefix=/usr \
358 --mandir='${prefix}/share/man'
361 ./configure --sbindir=/usr/sbin \
363 --mandir=/usr/share/man \
364 --docdir=/usr/share/doc/smartmontools \
365 --with-initscriptdir=/etc/rc.d/init.d
367 Using DOS text file type as default for the working directories ("textmode"
368 mount option) is not recommended. Building the binaries and man pages using
369 "make" is possible, but "make dist" and related targets work only with UNIX
370 file type ("binmode" mount option) set. The "autogen.sh" script prints a
371 warning if DOS type is selected.
373 Files may also be checked out with a non-Cygwin SVN client which uses CR/LF
374 for svn:eol-style=native. The "autogen.sh" script has svn:eol-style=LF.
375 Bash option "-o igncr" is not required.
377 [10] Guidelines for Windows
378 ===========================
380 To compile the Windows release with MinGW gcc on MSYS, use:
385 Instead of using "make install", copy the .exe files into
386 some directory in the PATH.
388 Cross-compile statically linked 32-bit and 64-bit versions with MinGW-w64:
390 ./configure --build=$(./config.guess) \
391 --host=i686-w64-mingw32 \
394 ./configure --build=$(./config.guess) \
395 --host=x86_64-w64-mingw32 \
398 Tested on Cygwin, Debian and Fedora.
401 To build the Windows binary distribution, use:
405 This builds the distribution in directory
407 ./smartmontools-VERSION.win32/
411 ./smartmontools-VERSION.win32.zip
413 To create a Windows installer, use:
417 This builds the distribution directory and packs it into the
418 self-extracting install program
420 ./smartmontools-VERSION.win32-setup.exe
422 The installer is build using the command "makensis" from the NSIS
423 package. See http://nsis.sourceforge.net/ for documentation and
426 It is also possible to (cross-)build the installer on Linux.
427 This was successfully tested on Debian and Fedora with package
430 To create a combined 32-/64-bit installer, use this in 32-bit build
431 directory if 64-build directory is at ../build64:
433 make builddir_win64=../build64 installer_win32
435 To both create and run the (interactive) installer, use:
439 Additional make targets are distdir-win32 to build the directory
440 only and cleandist-win32 for cleanup.
442 The binary distribution includes all documentation files converted
443 to DOS text file format and *.html and *.txt preformatted man pages.
445 To prepare os_win32 directory for MS Visual Studio C++ 2010 [Express],
446 use the following on MSYS or Cygwin:
448 mkdir vctmp && cd vctmp
449 ../configure [... any MinGW option set from above ...]
452 The MSVC project files (os_win32/vc10/*) are included in SVN (but not
453 in source tarball). The target config-vc10 from a Makefile configured
454 for MinGW creates os_win32/vc10/{config.h,smart*.rc,svnversion.h}.
455 The configure skript must be run outside of the source directory to
456 avoid inclusion of the original config.h.
459 [11] Guidelines for OS/2, eComStation
460 =====================================
462 To compile the OS/2 code, please run
464 ./os_os2/configure.os2
468 [12] Guidelines for OpenBSD
469 ===========================
470 To match the way it will installed when it becomes available as a PORT, use
473 ./configure --prefix=/usr/local \
475 --docdir=/usr/local/share/doc/smartmontools-VERSION \
476 --without-initscriptdir \
479 NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
480 be installed with the string '.sample' append to the name, so you will end
481 up with the following:
482 /etc/smartd.conf.sample
487 To compile from another directory, you can replace the step
488 ./configure [options]
492 ../configure [options]
494 Man pages contents is platform-specific by default. Info specific to other
495 platforms may be not visible. To generate man pages with full contents use:
499 To install to another destination (used mainly by package maintainers,
500 or to examine the package contents without risk of modifying any
501 system files) you can replace the step:
504 make DESTDIR=/home/myself/smartmontools-package install
506 Use a full path. Paths like ./smartmontools-package may not work.
508 After installing smartmontools, you can read the man pages, and try
515 /usr/sbin/smartctl -s on -o on -S on /dev/sda (only root can do this)
516 /usr/sbin/smartctl -a /dev/sda (only root can do this)
518 Note that the default location for the manual pages are
519 /usr/share/man/man5 and /usr/share/man/man8. If "man" doesn't find
520 them, you may need to add /usr/share/man to your MANPATH environment
523 Source and binary packages for Windows are available at
524 http://sourceforge.net/projects/smartmontools/files/
526 Refer to http://www.smartmontools.org/wiki/Download for any additional
527 download and installation instructions.
529 The following files are installed if ./configure has no options:
531 /usr/local/sbin/smartctl [Executable command-line utility]
532 /usr/local/sbin/smartd [Executable daemon]
533 /usr/local/sbin/update-smart-drivedb [Drive database update script]
534 /usr/local/etc/smartd.conf [Configuration file for smartd daemon]
535 /usr/local/etc/smartd_warning.sh [Warning skript for smartd daemon]
536 /usr/local/share/man/man5/smartd.conf.5 [Manual page]
537 /usr/local/share/man/man8/smartctl.8 [Manual page]
538 /usr/local/share/man/man8/smartd.8 [Manual page]
539 /usr/local/share/man/man8/update-smart-drivedb.8 [Manual page]
540 /usr/local/share/doc/smartmontools/AUTHORS [Information about the authors and developers]
541 /usr/local/share/doc/smartmontools/ChangeLog [A log of changes. Also see SVN]
542 /usr/local/share/doc/smartmontools/COPYING [GNU General Public License Version 2]
543 /usr/local/share/doc/smartmontools/INSTALL [Installation instructions: what you're reading!]
544 /usr/local/share/doc/smartmontools/NEWS [Significant enhancements and fixes]
545 /usr/local/share/doc/smartmontools/README [Overview]
546 /usr/local/share/doc/smartmontools/TODO [Things that need to be done/fixed]
547 /usr/local/share/doc/smartmontools/smartd.conf [Example configuration file for smartd]
548 /usr/local/share/doc/smartmontools/examplescripts/ [Executable scripts for -M exec of smartd.conf (4 files)]
549 /usr/local/share/smartmontools/drivedb.h [Drive database]
551 Due to checks done by '--with-systemdsystemunitdir=auto' and '--with-initscriptdir=auto',
552 one of the following files may also be installed:
554 /usr/local/lib/systemd/system/smartd.service [Systemd service file for smartd]
555 /usr/local/etc/rc.d/init.d/smartd [Init/Startup script for smartd]
556 /usr/local/etc/init.d/smartd [Init/Startup script for smartd]
557 /usr/local/etc/rc.d/smartd [Init/Startup script for smartd]
559 If /usr/local/etc/smartd.conf exists and differs from the
560 default then the default configuration file is installed as
561 /usr/local/etc/smartd.conf.sample instead.
568 may be used to build .html and .txt preformatted man pages.
569 These are used by the dist-win32 make target to build the Windows
571 The commands also work on other operating system configurations
572 if suitable versions of man2html, groff and grotty are installed.
573 On systems without man2html, the following command should work
574 if groff is available:
576 make MAN2HTML='groff -man -Thtml' htmlman
579 Some of the source files are prepared for the documentation
580 generator Doxygen (http://www.doxygen.org/). If Doxygen is installed,
585 creates HTML documentation in doc/html and LaTeX documentation
586 in doc/latex. If TeX is installed, the following command creates
587 a documentation file doc/latex/refman.pdf:
589 ( cd doc/latex && make pdf )
592 [14] Detailed description of arguments to configure command
593 ===========================================================
597 a description of available configure options is printed
598 [with defaults in square brackets]. See also section [3] above.
601 The following old configure options are deprecated and will be removed
602 in a future release of smartmontools:
604 Old option Replacement
605 --with-docdir=DIR --docdir=DIR (autoconf >= 2.60)
606 --enable-drivedb [no option needed]
607 --disable-drivedb --without-drivedbdir
608 --enable-savestates --with-savestates[=yes]
609 --disable-savestates [no option needed]
610 --enable-attrbutelog --with-attributelog[=yes]
611 --disable-savestates [no option needed]
614 The defaults for --with-initscriptdir and --with-systemdsystemunitdir are
615 guessed such that the following rules apply:
616 - If --prefix=/usr --sysconfdir=/etc is specified, the guessed directories
617 should be the defaults used by the current OS or distribution.
618 - If --sysconfdir=/etc is NOT specified, the guessed directories should
619 always be below ${prefix} or below ${sysconfdir}.
622 If you set --prefix=/home/joe and none of the other four
623 variables then the different directories that are used would be:
624 --sbindir /home/joe/sbin
625 --docdir /home/joe/share/doc/smartmontools
626 --mandir /home/joe/share/man
627 --sysconfdir /home/joe/etc
628 --with-exampledir /home/joe/share/doc/smartmontools/examplescripts
629 --with-drivedbdir /home/joe/share/smartmontools
630 --with-initscriptdir [see below]
631 --with-systemdsystemunitdir [see below]
633 If systemd is present (and pkg-config reports /lib/systemd/system
634 as the systemdsystemunitdir):
636 --with-initscriptdir [disabled]
637 --with-systemdsystemunitdir /home/joe/lib/systemd/system
639 else if /etc/rc.d/init.d exists:
641 --with-initscriptdir /home/joe/etc/rc.d/init.d
642 --with-systemdsystemunitdir [disabled]
644 else if /etc/init.d exists:
646 --with-initscriptdir /home/joe/etc/init.d
647 --with-systemdsystemunitdir [disabled]
649 else if /etc/rc.d exists:
651 --with-initscriptdir /home/joe/etc/rc.d
652 --with-systemdsystemunitdir [disabled]
656 --with-initscriptdir [disabled]
657 --with-systemdsystemunitdir [disabled]
660 Here are the differences with and without --enable-sample, assuming
661 that initscript location is set and no other options specified
662 (see above for details)
665 --enable-sample provided
666 ==> Files installed are:
667 /usr/local/etc/smartd.conf.sample
668 /usr/local/etc/rc.d/init.d/smartd.sample
671 --disable-sample provided or parameter left out
672 ==> Files installed are:
673 /usr/local/etc/smartd.conf
674 /usr/local/etc/rc.d/init.d/smartd
676 Additional information about using configure can be found here:
677 http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts