]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - INSTALL
import smartmontools 7.0
[mirror_smartmontools-debian.git] / INSTALL
1 Smartmontools installation instructions
2 =======================================
3
4 $Id: INSTALL 4880 2018-12-29 20:27:01Z chrfranke $
5
6 Please also see the smartmontools home page:
7 https://www.smartmontools.org/
8
9 Table of contents:
10
11 [1] System requirements
12 [2] Installing from SVN
13 [3] Installing from source tarball
14 [4] Guidelines for different Linux distributions
15 [5] Guidelines for FreeBSD
16 [6] Guidelines for Darwin
17 [7] Guidelines for NetBSD
18 [8] Guidelines for Solaris
19 [9] Guidelines for Cygwin
20 [10] Guidelines for Windows
21 [11] Guidelines for OS/2, eComStation
22 [12] Guidelines for OpenBSD
23 [13] Comments
24 [14] Detailed description of ./configure options
25
26 [1] System requirements
27 =======================
28
29 Note: Some of this info is outdated as it refers to very old OS
30 versions.
31
32 A) Linux
33
34 Any Linux distribution will support smartmontools if it has a
35 kernel version greater than or equal to 2.2.14. So any recent
36 Linux distribution should support smartmontools.
37
38 B) FreeBSD
39
40 For FreeBSD support, a 5-current kernel that includes ATAng is
41 required in order to support ATA drives. Even current versions of
42 ATAng will not support 100% operation, as the SMART status can not
43 be reliably retrieved. There is patch pending approval of the
44 ATAng driver maintainer that will address this issue.
45
46 C) Solaris
47
48 The SCSI code has been tested on a variety of Solaris 8 or later
49 systems. ATA/IDE code only works on SPARC platform. All tested
50 kernels worked correctly.
51
52 D) NetBSD/OpenBSD
53
54 The code was tested on a 1.6ZG (i.e., 1.6-current) system. It should
55 also function under 1.6.1 and later releases.
56
57 E) Cygwin
58
59 The code was tested on Cygwin 2.11.* x86 and x86_64. It should also
60 work on other recent releases.
61
62 Both Cygwin and Windows versions of smartmontools share the same code
63 to access the raw devices. The information in the "Windows" section
64 below also applies to the Cygwin version.
65
66 F) Windows
67
68 The code was tested on Windows XP SP3, 2003, Vista, Windows 7, 8, 8.1
69 and Windows 10 up to 1809. Support von Windows 9x/ME and NT4 was
70 removed after smartmontools 5.43.
71
72 ATA or SATA devices are supported if the device driver implements
73 the SMART IOCTLs or IOCTL_IDE_PASS_THROUGH or IOCTL_ATA_PASS_THROUGH.
74 Only the latter provides full pass-through support which is needed
75 for all smartmontools features.
76
77 SATA devices behind a Intel RST driver are accessed through CSMI.
78
79 SCSI and USB devices are accessed through SPTI. Special driver support
80 is not required.
81
82 NVMe devices are supported with the Windows 10 NVMe driver or with
83 vendor specific drivers supporting NVME_PASS_THROUGH.
84
85 G) MacOS/Darwin
86
87 The code was tested on MacOS 10.3.4. It should work from 10.3
88 forwards. It doesn't support 10.2.
89
90 Only basic SMART commands are supported for ATA devices.
91
92 It's important to know that on 10.3.x, some things don't work
93 due to bugs in the libraries used, you cannot run
94 a short test or switch SMART support off on a drive; if you try,
95 you will just run an extended test or switch SMART support on. So
96 don't panic when your "short" test seems to be taking hours.
97
98 It's also not possible at present to control when the offline
99 routine runs. If your drive doesn't have it running automatically by
100 default, you can't run it at all.
101
102 SCSI devices are not currently supported.
103
104 The OS X SAT SMART Driver provides access to SMART data for SAT capable
105 USB and Firewire devices:
106 https://github.com/kasbert/OS-X-SAT-SMART-Driver
107 https://github.com/RJVB/OS-X-SAT-SMART-Driver
108 This does not require any smartctl -d TYPE option and should work also
109 with older smartmontools releases.
110
111 H) OS/2, eComStation
112
113 The code was tested on eComStation 1.1, but it should work on all versions
114 of OS/2.
115 Innotek LibC 0.5 runtime is required.
116 Only ATA disks are supported.
117
118 [2] Installing from SVN
119 =======================
120
121 Get the sources from the SVN repository:
122 svn co https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools smartmontools
123
124 Then type:
125 cd smartmontools
126 ./autogen.sh
127 and continue with step [3] below, skipping the "unpack the tarball" step.
128
129 The autogen.sh command is ONLY required when installing from
130 SVN. You need GNU Autoconf (version 2.60 or greater), GNU Automake
131 (version 1.10 or greater) and their dependencies installed in order
132 to run it.
133
134 [3] Installing from the source tarball
135 ======================================
136
137 If you are NOT installing from SVN, then unpack the tarball:
138 tar xvf smartmontools-VERSION.tar.gz
139
140 Then:
141 ./configure
142 make
143 make install (you may need to be root to do this)
144
145 As shown (with no options to ./configure) this defaults to the
146 following set of installation directories and other settings:
147
148 --prefix=/usr/local
149 --exec-prefix='${prefix}'
150 --sbindir='${exec_prefix}/sbin'
151 --sysconfdir='${prefix}/etc'
152 --localstatedir='${prefix}/var'
153 --datarootdir='${prefix}/share'
154 --datadir='${datarootdir}'
155 --mandir='${datarootdir}/man'
156 --docdir='${datarootdir}/doc/smartmontools'
157 --disable-sample
158 --disable-scsi-cdb-check
159 --enable-fast-lebe
160 --without-initscriptdir
161 --with-exampledir='${docdir}/examplescripts'
162 --with-drivedbdir='${datadir}/smartmontools'
163 --with-update-smart-drivedb
164 --with-gnupg
165 --with-smartdscriptdir='${sysconfdir}'
166 --with-smartdplugindir='${smartdscriptdir}/smartd_warning.d'
167 --with-scriptpath='/usr/local/bin:/bin:/usr/bin'
168 --without-savestates
169 --without-attributelog
170 --with-os-deps='os_linux.o dev_areca.o' (platform specific)
171 --without-selinux
172 --with-libcap-ng=auto
173 --with-libsystemd=auto
174 --with-systemdsystemunitdir=auto
175 --with-systemdenvfile=auto
176 --with-nvme-devicescan (Linux, Windows: yes; Others: no)
177 --without-solaris-sparc-ata (Solaris SPARC only)
178 --with-signal-func=sigaction
179 --with-working-snprintf
180 --with-mingw-aslr=auto (Windows only)
181 --with-cxx11-option=auto
182 --without-cxx11-regex
183
184 These will usually not overwrite existing "distribution" installations on
185 Linux Systems since the FHS reserves this area for use by the system
186 administrator.
187
188 For different installation locations or distributions, simply add
189 arguments to ./configure as shown in [4] below.
190
191 The first output line of smartctl and smartd provides information
192 about release number, last SVN checkin date and revision, platform,
193 and package. The latter defaults to "(local build)" and can be
194 changed by the variable BUILD_INFO, for example:
195 make BUILD_INFO='"(Debian 5.39-2)"'
196
197 [4] Guidelines for different Linux distributions
198 ================================================
199
200 Note: Please send corrections/additions to:
201 smartmontools-support@listi.jpberlin.de
202
203 Red Hat:
204 ./configure --sbindir=/usr/sbin \
205 --sysconfdir=/etc \
206 --mandir=/usr/share/man \
207 --docdir=/usr/share/doc/smartmontools \
208 --with-initscriptdir=/etc/rc.d/init.d
209
210 Slackware:
211 If you don't want to overwrite any "distribution" package, use:
212 ./configure
213
214 Otherwise use:
215 ./configure --sbindir=/usr/sbin \
216 --sysconfdir=/etc \
217 --mandir=/usr/share/man \
218 --docdir=/usr/share/doc/smartmontools \
219 --with-initscriptdir=/etc/rc.d
220
221 And
222 removepkg smartmontools smartsuite (only root can do this)
223 before make install
224
225 The init script works on Slackware. You just have to add an entry like
226 the following in /etc/rc.d/rc.M or /etc/rc.d/rc.local:
227
228 if [ -x /etc/rc.d/smartd ]; then
229 . /etc/rc.d/smartd start
230 fi
231
232 To disable it:
233 chmod 644 /etc/rc.d/smartd
234
235 For a list of options:
236 /etc/rc.d/smartd
237
238 SuSE:
239 ./configure --sbindir=/usr/sbin \
240 --sysconfdir=/etc \
241 --mandir=/usr/share/man \
242 --docdir=/usr/share/doc/packages/smartmontools-VERSION \
243 --with-initscriptdir=/etc/init.d \
244
245 [5] Guidelines for FreeBSD
246 ==========================
247 To match the way it will installed when it becomes available as a PORT, use
248 the following:
249
250 ./configure --prefix=/usr/local \
251 --docdir=/usr/local/share/doc/smartmontools-VERSION \
252 --with-initscriptdir=/usr/local/etc/rc.d/ \
253 --enable-sample
254
255 NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
256 be installed with the string '.sample' append to the name, so you will end
257 up with the following:
258 /usr/local/etc/smartd.conf.sample
259 /usr/local/etc/rc.d/smartd.sample
260
261
262 [6] Guidelines for Darwin
263 =========================
264
265 ./configure --with-initscriptdir=/Library/StartupItems
266
267 If you'd like to build the i386 version on a powerpc machine, you can
268 use
269
270 CXX='g++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386' \
271 ./configure --host=i386-apple-darwin \
272 --with-initscriptdir=/Library/StartupItems
273
274 [7] Guidelines for NetBSD
275 =========================
276
277 ./configure --prefix=/usr/pkg \
278 --docdir=/usr/pkg/share/doc/smartmontools
279
280 [8] Guidelines for Solaris
281 ==========================
282
283 smartmontools has been partially but not completely ported to
284 Solaris. It includes complete SCSI support but no ATA or NVMe
285 support. It can be compiled with either CC (Sun's C++ compiler)
286 or GNU g++.
287
288 To compile with g++:
289
290 ./configure [args]
291 make
292
293 To compile with Sun CC:
294
295 env CC=cc CXX=CC ./configure [args]
296 make
297
298 The correct arguments [args] to configure are:
299 --sbindir=/usr/sbin \
300 --sysconfdir=/etc \
301 --mandir=/usr/share/man \
302 --docdir=/usr/share/doc/smartmontools-VERSION \
303 --with-initscriptdir=/etc/init.d
304
305 [9] Guidelines for Cygwin
306 =========================
307
308 ./configure --prefix=/usr \
309 --sysconfdir=/etc \
310 --with-initscriptdir=/etc/rc.d/init.d
311
312 [10] Guidelines for Windows
313 ===========================
314
315 To compile statically linked Windows release with MinGW gcc on MSYS, use:
316
317 ./configure
318 make
319
320 Instead of using "make install", copy the .exe files into
321 some directory in the PATH.
322
323 Cross-compile statically linked 32-bit and 64-bit versions with MinGW-w64:
324
325 ./configure --build=$(./config.guess) \
326 --host=i686-w64-mingw32
327
328 ./configure --build=$(./config.guess) \
329 --host=x86_64-w64-mingw32
330
331 Tested on Cygwin, Debian, Fedora and Ubuntu.
332
333
334 To create the Windows installer, use:
335
336 make installer-win32
337
338 This builds the distribution directory and packs it into the
339 self-extracting install program
340
341 ./smartmontools-VERSION.win32-setup.exe
342
343 The installer is build using the command "makensis" from the NSIS
344 package (https://nsis.sourceforge.net/).
345
346 To create a combined 32-/64-bit installer, use this in 32-bit build
347 directory if 64-build directory is at ../build64:
348
349 make builddir_win64=../build64 installer_win32
350
351 To both create and run the (interactive) installer, use:
352
353 make install-win32
354
355 Additional make targets are distdir-win32 to build the directory
356 only and cleandist-win32 for cleanup.
357
358 The binary distribution includes all documentation files converted
359 to DOS text file format and *.html and *.pdf preformatted man pages.
360
361 To prepare os_win32/vc14 directory for MS Visual Studio C++ 2015 builds,
362 use the following on MSYS or Cygwin:
363
364 mkdir vctmp && cd vctmp
365 ../configure [... any MinGW option set from above ...]
366 make config-vc14
367
368 The MSVC project files (os_win32/vc14/*) are included in SVN (but not
369 in source tarball). The target config-vc14 from a Makefile configured
370 for MinGW creates os_win32/vc14/{config.h,smart*.rc,svnversion.h}.
371 The configure script must be run outside of the source directory to
372 avoid inclusion of the original config.h.
373 Additional MSVC related make targets are clean-vc14, distclean-vc14
374 and maintainer-clean-vc14.
375
376
377 [11] Guidelines for OS/2, eComStation
378 =====================================
379
380 To compile the OS/2 code, please run
381
382 ./configure
383 make
384 make install
385
386 [12] Guidelines for OpenBSD
387 ===========================
388
389 To match the way it will installed when it becomes available as a PORT, use
390 the following:
391
392 ./configure --prefix=/usr/local \
393 --sysconfdir=/etc \
394 --docdir=/usr/local/share/doc/smartmontools-VERSION \
395 --enable-sample
396
397 NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
398 be installed with the string '.sample' append to the name, so you will end
399 up with the following:
400 /etc/smartd.conf.sample
401
402 [13] Comments
403 ============
404
405 To compile from another directory, you can replace the step
406 ./configure [options]
407 by the following:
408 mkdir objdir
409 cd objdir
410 ../configure [options]
411
412 Man pages contents is platform-specific by default. Info specific to other
413 platforms may be not visible. To generate man pages with full contents use:
414
415 make os_man_filter=
416
417 To install to another destination (used mainly by package maintainers,
418 or to examine the package contents without risk of modifying any
419 system files) you can replace the step:
420 make install
421 with:
422 make DESTDIR=/home/myself/smartmontools-package install
423
424 Use a full path. Paths like ./smartmontools-package may not work.
425
426 After installing smartmontools, you can read the man pages, and try
427 out the commands:
428
429 man smartd.conf
430 man smartctl
431 man smartd
432
433 sudo /usr/sbin/smartctl -x /dev/sda
434
435 Source and binary packages for Windows are available at
436 https://sourceforge.net/projects/smartmontools/files/
437
438 Refer to https://www.smartmontools.org/wiki/Download for any additional
439 download and installation instructions.
440
441 The following files are installed if ./configure has no options:
442
443 /usr/local/sbin/smartctl [Executable command-line utility]
444 /usr/local/sbin/smartd [Executable daemon]
445 /usr/local/sbin/update-smart-drivedb [Drive database update script]
446 /usr/local/etc/smartd.conf [Configuration file for smartd daemon]
447 /usr/local/etc/smartd_warning.sh [Warning script for smartd daemon]
448 /usr/local/share/man/man5/smartd.conf.5 [Manual page]
449 /usr/local/share/man/man8/smartctl.8 [Manual page]
450 /usr/local/share/man/man8/smartd.8 [Manual page]
451 /usr/local/share/man/man8/update-smart-drivedb.8 [Manual page]
452 /usr/local/share/doc/smartmontools/AUTHORS [Information about the authors and developers]
453 /usr/local/share/doc/smartmontools/ChangeLog [A log of changes. Also see SVN]
454 /usr/local/share/doc/smartmontools/COPYING [GNU General Public License Version 2]
455 /usr/local/share/doc/smartmontools/INSTALL [Installation instructions: what you're reading!]
456 /usr/local/share/doc/smartmontools/NEWS [Significant enhancements and fixes]
457 /usr/local/share/doc/smartmontools/README [Overview]
458 /usr/local/share/doc/smartmontools/TODO [No longer maintained]
459 /usr/local/share/doc/smartmontools/smartd.conf [Example configuration file for smartd]
460 /usr/local/share/doc/smartmontools/examplescripts/ [Executable scripts for -M exec of smartd.conf (4 files)]
461 /usr/local/share/smartmontools/drivedb.h [Drive database]
462
463 Due to checks done by '--with-systemdsystemunitdir=auto', the following file may also be installed:
464
465 /usr/local/lib/systemd/system/smartd.service [Systemd service file for smartd]
466
467 If /usr/local/etc/smartd.conf exists and differs from the
468 default then the default configuration file is installed as
469 /usr/local/etc/smartd.conf.sample instead.
470
471 The commands:
472
473 make htmlman
474 make pdfman
475 make txtman
476
477 may be used to build .html, .pdf and .txt preformatted man pages.
478 These are used by the dist-win32 make target to build the Windows
479 distribution.
480 The commands also work on other operating system configurations
481 if suitable versions of man, man2html and groff are installed.
482 On systems without man2html, the following command should work
483 if groff is available:
484
485 make MAN2HTML='groff -man -Thtml' htmlman
486
487
488 [14] Detailed description of arguments to configure command
489 ===========================================================
490
491 When you type:
492 ./configure --help
493 a description of available configure options is printed
494 [with defaults in square brackets]. See also section [3] above.
495
496
497 The following old configure options are no longer supported:
498
499 Old option Replacement
500 --with-docdir=DIR --docdir=DIR (autoconf >= 2.60)
501 --enable-drivedb [no option needed]
502 --disable-drivedb --without-drivedbdir
503 --enable-savestates --with-savestates[=yes]
504 --disable-savestates [no option needed]
505 --enable-attrbutelog --with-attributelog[=yes]
506 --disable-savestates [no option needed]
507 --with-initscriptdir[=yes] --with-initscriptdir=DIR
508 --with-initscriptdir=auto --with-initscriptdir=DIR
509
510
511 Here's an example:
512 If you set --prefix=/home/joe and none of the other four
513 variables then the different directories that are used would be:
514 --sbindir /home/joe/sbin
515 --docdir /home/joe/share/doc/smartmontools
516 --mandir /home/joe/share/man
517 --sysconfdir /home/joe/etc
518 --with-exampledir /home/joe/share/doc/smartmontools/examplescripts
519 --with-drivedbdir /home/joe/share/smartmontools
520 --with-initscriptdir [disabled]
521 --with-systemdsystemunitdir [see below]
522
523 If systemd is present (and pkg-config reports /lib/systemd/system
524 as the systemdsystemunitdir):
525
526 --with-systemdsystemunitdir /home/joe/lib/systemd/system
527
528 else
529
530 --with-systemdsystemunitdir [disabled]
531
532
533 Additional information about using configure can be found here:
534 https://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts