]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - INSTALL
fbb1471977e57cb2c0874163cc388eee74d72a59
[mirror_smartmontools-debian.git] / INSTALL
1 Smartmontools installation instructions
2 =======================================
3
4 <<<<<<< HEAD
5 $Id: INSTALL 4120 2015-08-27 16:12:21Z samm2 $
6 =======
7 $Id: INSTALL 4094 2015-05-27 21:41:17Z chrfranke $
8 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
9
10 Please also see the smartmontools home page:
11 http://www.smartmontools.org/
12
13 Table of contents:
14
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
27 [13] Comments
28 [14] Detailed description of ./configure options
29
30 [1] System requirements
31 =======================
32
33 A) Linux
34
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.
38
39 B) FreeBSD
40
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.
46
47 C) Solaris
48
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.
52
53 D) NetBSD/OpenBSD
54
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.
58
59 E) Cygwin
60
61 The code was tested on Cygwin 1.7.15-1. It should also work on other
62 recent releases.
63
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.
67
68 F) Windows
69
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.
73
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.
78
79 SCSI and USB devices are accessed through SPTI. Special driver support
80 is not required.
81
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.
88
89 G) MacOS/Darwin
90
91 The code was tested on MacOS 10.3.4. It should work from 10.3
92 forwards. It doesn't support 10.2.
93
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.
99
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.
103
104 SCSI devices are not currently supported. Detecting the power
105 status of a drive is also not currently supported.
106
107 To summarize this, from another point of view, the things that
108 are not supported fall into two categories:
109
110 * Can't be implemented easily without more kernel-level support,
111 so far as I know:
112 - running immediate offline, conveyance, or selective tests
113 - running any test in captive mode
114 - aborting tests
115 - switching automatic offline testing on or off
116 - support for SCSI
117 - checking the power mode [-n Directive of smartd] (this is not
118 completely impossible, but not by using a documented API)
119
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)
124
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
129 even that works.
130
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.
137
138 H) OS/2, eComStation
139
140 The code was tested on eComStation 1.1, but it should work on all versions
141 of OS/2.
142 Innotek LibC 0.5 runtime is required.
143 Only ATA disks are supported.
144
145 [2] Installing from SVN
146 =======================
147
148 Get the sources from the SVN repository:
149 svn co http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools smartmontools
150
151 Then type:
152 ./autogen.sh
153 and continue with step [3] below, skipping the "unpack the tarball" step.
154
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/
161
162 [3] Installing from the source tarball
163 ======================================
164
165 If you are NOT installing from SVN, then unpack the tarball:
166 tar zxvf smartmontools-5.VERSION.tar.gz
167
168 Then:
169 ./configure
170 make
171 make install (you may need to be root to do this)
172
173 As shown (with no options to ./configure) this defaults to the
174 following set of installation directories and other settings:
175
176 --prefix=/usr/local
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'
185 --disable-sample
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'
193 --without-savestates
194 --without-attributelog
195 --with-os-deps='os_linux.o dev_areca.o' (platform specific)
196 --without-selinux
197 --with-libcap-ng=auto
198 --with-working-snprintf
199
200 These will usually not overwrite existing "distribution" installations on
201 Linux Systems since the FHS reserves this area for use by the system
202 administrator.
203
204 For different installation locations or distributions, simply add
205 arguments to ./configure as shown in [4] below.
206
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'
211
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)"'
217
218 [4] Guidelines for different Linux distributions
219 ================================================
220
221 Note: Please send corrections/additions to:
222 smartmontools-support@lists.sourceforge.net
223
224 Debian:
225 If you don't want to overwrite any distribution package, use:
226 ./configure
227
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
234
235 Red Hat:
236 ./configure --sbindir=/usr/sbin \
237 --sysconfdir=/etc \
238 --mandir=/usr/share/man \
239 --docdir=/usr/share/doc/smartmontools \
240 --with-initscriptdir=/etc/rc.d/init.d
241
242 Slackware:
243 If you don't want to overwrite any "distribution" package, use:
244 ./configure
245
246 Otherwise use:
247 ./configure --sbindir=/usr/sbin \
248 --sysconfdir=/etc \
249 --mandir=/usr/share/man \
250 --docdir=/usr/share/doc/smartmontools \
251 --with-initscriptdir=/etc/rc.d
252
253 And
254 removepkg smartmontools smartsuite (only root can do this)
255 before make install
256
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:
259
260 if [ -x /etc/rc.d/smartd ]; then
261 . /etc/rc.d/smartd start
262 fi
263
264 To disable it:
265 chmod 644 /etc/rc.d/smartd
266
267 For a list of options:
268 /etc/rc.d/smartd
269
270 SuSE:
271 ./configure --sbindir=/usr/sbin \
272 --sysconfdir=/etc \
273 --mandir=/usr/share/man \
274 --docdir=/usr/share/doc/packages/smartmontools-VERSION \
275 --with-initscriptdir=/etc/init.d \
276
277 [5] Guidelines for FreeBSD
278 ==========================
279 To match the way it will installed when it becomes available as a PORT, use
280 the following:
281
282 ./configure --prefix=/usr/local \
283 --docdir=/usr/local/share/doc/smartmontools-VERSION \
284 --with-initscriptdir=/usr/local/etc/rc.d/ \
285 --enable-sample
286
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
292
293
294 [6] Guidelines for Darwin
295 =========================
296 ./configure --with-initscriptdir=/Library/StartupItems
297
298 If you'd like to build the i386 version on a powerpc machine, you can
299 use
300
301 CXX='g++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386' \
302 ./configure --host=i386-apple-darwin \
303 --with-initscriptdir=/Library/StartupItems
304
305 [7] Guidelines for NetBSD
306 =========================
307 ./configure --prefix=/usr/pkg \
308 --docdir=/usr/pkg/share/doc/smartmontools
309
310 [8] Guidelines for Solaris
311 ==========================
312
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)
316 or GNU g++.
317
318 To compile with g++:
319
320 ./configure [args]
321 make
322
323 To compile with Sun CC:
324
325 env CC=cc CXX=CC ./configure [args]
326 make
327
328 The correct arguments [args] to configure are:
329 --sbindir=/usr/sbin \
330 --sysconfdir=/etc \
331 --mandir=/usr/share/man \
332 --docdir=/usr/share/doc/smartmontools-VERSION \
333 --with-initscriptdir=/etc/init.d
334
335 To start the script automatically on bootup, create hardlinks that
336 indicate when to start/stop in:
337 /etc/rc[S0123].d/
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
342 lower knum must be.
343
344 On usual configuration, '95' would be suitable for <snum> and '05'
345 for <knum> respectively. If you choose these value, you can
346 create hardlinks by:
347
348 cd /etc
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'
351
352 [9] Guidelines for Cygwin
353 =========================
354
355 Same as Red Hat:
356 ./configure --prefix=/usr \
357 --sysconfdir=/etc \
358 --mandir='${prefix}/share/man'
359
360 OR EQUIVALENTLY
361 ./configure --sbindir=/usr/sbin \
362 --sysconfdir=/etc \
363 --mandir=/usr/share/man \
364 --docdir=/usr/share/doc/smartmontools \
365 --with-initscriptdir=/etc/rc.d/init.d
366
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.
372
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.
376
377 [10] Guidelines for Windows
378 ===========================
379
380 To compile the Windows release with MinGW gcc on MSYS, use:
381
382 ./configure
383 make
384
385 Instead of using "make install", copy the .exe files into
386 some directory in the PATH.
387
388 Cross-compile statically linked 32-bit and 64-bit versions with MinGW-w64:
389
390 ./configure --build=$(./config.guess) \
391 --host=i686-w64-mingw32 \
392 LDFLAGS=-static
393
394 ./configure --build=$(./config.guess) \
395 --host=x86_64-w64-mingw32 \
396 LDFLAGS=-static
397
398 Tested on Cygwin, Debian and Fedora.
399
400
401 To build the Windows binary distribution, use:
402
403 make dist-win32
404
405 This builds the distribution in directory
406
407 ./smartmontools-VERSION.win32/
408
409 and packs it into
410
411 ./smartmontools-VERSION.win32.zip
412
413 To create a Windows installer, use:
414
415 make installer-win32
416
417 This builds the distribution directory and packs it into the
418 self-extracting install program
419
420 ./smartmontools-VERSION.win32-setup.exe
421
422 The installer is build using the command "makensis" from the NSIS
423 package. See http://nsis.sourceforge.net/ for documentation and
424 download location.
425
426 It is also possible to (cross-)build the installer on Linux.
427 This was successfully tested on Debian and Fedora with package
428 "nsis".
429
430 To create a combined 32-/64-bit installer, use this in 32-bit build
431 directory if 64-build directory is at ../build64:
432
433 make builddir_win64=../build64 installer_win32
434
435 To both create and run the (interactive) installer, use:
436
437 make install-win32
438
439 Additional make targets are distdir-win32 to build the directory
440 only and cleandist-win32 for cleanup.
441
442 The binary distribution includes all documentation files converted
443 to DOS text file format and *.html and *.txt preformatted man pages.
444
445 To prepare os_win32 directory for MS Visual Studio C++ 2010 [Express],
446 use the following on MSYS or Cygwin:
447
448 mkdir vctmp && cd vctmp
449 ../configure [... any MinGW option set from above ...]
450 make config-vc10
451
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.
457
458
459 [11] Guidelines for OS/2, eComStation
460 =====================================
461
462 To compile the OS/2 code, please run
463
464 ./os_os2/configure.os2
465 make
466 make install
467
468 [12] Guidelines for OpenBSD
469 ===========================
470 To match the way it will installed when it becomes available as a PORT, use
471 the following:
472
473 ./configure --prefix=/usr/local \
474 --sysconfdir=/etc \
475 --docdir=/usr/local/share/doc/smartmontools-VERSION \
476 --without-initscriptdir \
477 --enable-sample
478
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
483
484 [13] Comments
485 ============
486
487 To compile from another directory, you can replace the step
488 ./configure [options]
489 by the following:
490 mkdir objdir
491 cd objdir
492 ../configure [options]
493
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:
496
497 make os_man_filter=
498
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:
502 make install
503 with:
504 make DESTDIR=/home/myself/smartmontools-package install
505
506 Use a full path. Paths like ./smartmontools-package may not work.
507
508 After installing smartmontools, you can read the man pages, and try
509 out the commands:
510
511 man smartd.conf
512 man smartctl
513 man smartd
514
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)
517
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
521 variable.
522
523 Source and binary packages for Windows are available at
524 http://sourceforge.net/projects/smartmontools/files/
525
526 Refer to http://www.smartmontools.org/wiki/Download for any additional
527 download and installation instructions.
528
529 The following files are installed if ./configure has no options:
530
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]
550
551 Due to checks done by '--with-systemdsystemunitdir=auto' and '--with-initscriptdir=auto',
552 one of the following files may also be installed:
553
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]
558
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.
562
563 The commands:
564
565 make htmlman
566 make txtman
567
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
570 distribution.
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:
575
576 make MAN2HTML='groff -man -Thtml' htmlman
577
578
579 Some of the source files are prepared for the documentation
580 generator Doxygen (http://www.doxygen.org/). If Doxygen is installed,
581 the command:
582
583 doxygen
584
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:
588
589 ( cd doc/latex && make pdf )
590
591
592 [14] Detailed description of arguments to configure command
593 ===========================================================
594
595 When you type:
596 ./configure --help
597 a description of available configure options is printed
598 [with defaults in square brackets]. See also section [3] above.
599
600
601 The following old configure options are deprecated and will be removed
602 in a future release of smartmontools:
603
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]
612
613
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}.
620
621 Here's an example:
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]
632
633 If systemd is present (and pkg-config reports /lib/systemd/system
634 as the systemdsystemunitdir):
635
636 --with-initscriptdir [disabled]
637 --with-systemdsystemunitdir /home/joe/lib/systemd/system
638
639 else if /etc/rc.d/init.d exists:
640
641 --with-initscriptdir /home/joe/etc/rc.d/init.d
642 --with-systemdsystemunitdir [disabled]
643
644 else if /etc/init.d exists:
645
646 --with-initscriptdir /home/joe/etc/init.d
647 --with-systemdsystemunitdir [disabled]
648
649 else if /etc/rc.d exists:
650
651 --with-initscriptdir /home/joe/etc/rc.d
652 --with-systemdsystemunitdir [disabled]
653
654 else
655
656 --with-initscriptdir [disabled]
657 --with-systemdsystemunitdir [disabled]
658
659
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)
663
664 Case 1:
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
669
670 Case 2:
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
675
676 Additional information about using configure can be found here:
677 http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts