]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - INSTALL
import upstream version 5.36
[mirror_smartmontools-debian.git] / INSTALL
CommitLineData
832b75ed
GG
1Smartmontools installation instructions
2=======================================
3
4$Id: INSTALL,v 1.62 2005/10/22 17:11:39 chrfranke Exp $
5
6Please also see the smartmontools home page:
7http://smartmontools.sourceforge.net/
8
9Table of contents:
10
11[1] System requirements
12[2] Installing from CVS
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 A) Linux
30
31 Any Linux distribution will support smartmontools if it has a
32 kernel version greater than or equal to 2.2.14. So any recent
33 Linux distribution should support smartmontools.
34
35 There are two parts of smartmontools that may require a patched or
36 nonstandard kernel:
37
38 (1) To get the ATA RETURN SMART STATUS command, the kernel needs
39 to support the HDIO_DRIVE_TASK ioctl().
40
41 (2) To run Selective Self-tests, the kernel needs to support the
42 HDIO_DRIVE_TASKFILE ioctl().
43
44 If your kernel does not support one or both of these ioctls, then
45 smartmontools will "mostly" work. The things that don't work will
46 give you harmless warning messages.
47
48 Although "not officially supported" by the developers, smartmontools
49 has also been successfully build and run on a legacy Linux system
50 with kernel 2.0.33 and libc.so.5. On such systems, the restrictions
51 above apply.
52
53 For item (1) above, any 2.4 or 2.6 series kernel will provide
54 HDIO_DRIVE_TASK support. Some 2.2.20 and later kernels also
55 provide this support IF they're properly patched and
56 configured. [Andre Hedrick's IDE patches may be found at
57 http://www.funet.fi/pub/linux/kernel/people/hedrick/ide-2.2.20/ or
58 are available from your local kernel.org mirror. They are not
59 updated for 2.2.21 or later, and may contain a few bugs.].
60 If the configuration option CONFIG_IDE_TASK_IOCTL
61 exists in your 2.2.X kernel source code tree, then your 2.2.X
62 kernel will probably support this ioctl. [Note that this kernel
63 configuration option does NOT need to be enabled. Its presence
64 merely indicates that the required HDIO_DRIVE_TASK ioctl() is
65 supported.]
66
67 For item (2) above, your kernel must be configured with the kernel
68 configuration option CONFIG_IDE_TASKFILE_IO enabled. This
69 configuration option is present in all 2.4 and 2.6 series
70 kernels. Some 2.2.20 and later kernels also provide this support
71 IF they're properly patched and configured as described above.
72
73 Please see FAQ section of the URL above for additional details.
74
75 If you are using 3ware controllers, for full functionality you
76 must either use version 1.02.00.037 or greater of the 3w-xxxx
77 driver, or patch earlier 3ware 3w-xxxx drivers. See
78 http://smartmontools.sourceforge.net/3w-xxxx.txt
79 for the patch. The version 1.02.00.037 3w-xxxx.c driver was
80 incorporated into kernel 2.4.23-bk2 on 3 December 2003 and into
81 kernel 2.6.0-test5-bk11 on 23 September 2003.
82
83 B) FreeBSD
84
85 For FreeBSD support, a 5-current kernel that includes ATAng is
86 required in order to support ATA drives. Even current versions of
87 ATAng will not support 100% operation, as the SMART status can not
88 be reliably retrieved. There is patch pending approval of the
89 ATAng driver maintainer that will address this issue.
90
91 C) Solaris
92
93 The SCSI code has been tested on a variety of Solaris 8 and 9
94 systems. ATA/IDE code only works on SPARC platform. All tested
95 kernels worked correctly.
96
97 D) NetBSD/OpenBSD
98
99 The code was tested on a 1.6ZG (i.e., 1.6-current) system. It should
100 also function under 1.6.1 and later releases (unverified). Currently
101 it doesn't support ATA devices on 3ware RAID controllers.
102
103 E) Cygwin
104
105 The code was tested on Cygwin 1.5.7, 1.5.11 and 1.5.18. It should also
106 work on other recent releases.
107
108 Release 1.5.15 or later is recommended for Cygwin smartd. Older versions
109 do not provide syslogd support.
110
111 Both Cygwin and Windows versions of smartmontools share the same code
112 to access the IDE/ATA or SCSI devices. The information in the "Windows"
113 section below also applies to the Cygwin version.
114
115 F) Windows
116
117 The code was tested on Windows 98SE, NT4(SP5,SP6), 2000(SP4) and
118 XP(no SP,SP1a,SP2). It should also work on Windows 95(OSR2), 98,
119 ME and 2003.
120
121 On 9x/ME, only standard (legacy) IDE/ATA devices 0-3 are supported.
122 The driver SMARTVSD.VXD must be present in WINDOWS\SYSTEM\IOSUBSYS
123 to get loaded at Windows startup. The default location in a new
124 installation of some versions of Windows is the WINDOWS\SYSTEM folder.
125 In this case, move SMARTVSD.VXD to WINDOWS\SYSTEM\IOSUBSYS and reboot
126 (http://support.microsoft.com/default.aspx?scid=kb;en-us;265854).
127
128 SMARTVSD.VXD relies on the standard IDE port driver ESDI_506.PDR.
129 If the system uses a vendor specific driver, access of SMART data
130 is not possible on 9x/ME. This is the case if e.g. the optional
131 "IDE miniport driver" is installed on a system with VIA chipset.
132
133 On NT4/2000/XP, also other ATA or SATA devices are supported if
134 the device driver implements the SMART IOCTL.
135
136 The IDE/ATA read log command (smartctl -l, --log, -a, --all) is
137 not supported by the SMART IOCTL of NT4/2000/XP. Undocumented
138 and possibly buggy system calls are used for this purpose,
139 see WARNINGS file for details.
140
141 SCSI devices are supported on all versions of Windows. An installed
142 ASPI interface (WNASPI32.DLL) is required to access SCSI devices.
143 The code was tested with Adaptec Windows ASPI drivers 4.71.2.
144 (http://www.adaptec.com/worldwide/support/drivers_by_product.jsp?cat=/Product/ASPI-4.70)
145
146 G) MacOS/Darwin
147
148 The code was tested on MacOS 10.3.4. It should work from 10.3
149 forwards. It doesn't support 10.2.
150
151 There's an important limitation (see WARNINGS); due to bugs in
152 the libraries used, you cannot run a short test or switch SMART
153 support off on a drive; if you try, you will just run an extended
154 test or switch SMART support on. So don't panic when your "short"
155 test seems to be taking hours.
156
157 It's also not possible at present to control when the offline
158 routine runs. If your drive doesn't have it running automatically by
159 default, you can't run it at all.
160
161 SCSI devices are not currently supported. Detecting the power
162 status of a drive is also not currently supported.
163
164 To summarize this, from another point of view, the things that
165 are not supported fall into two categories:
166
167 * Can't be implemented easily without more kernel-level support,
168 so far as I know:
169 - running immediate offline, conveyance, or selective tests
170 - running any test in captive mode
171 - aborting tests
172 - switching automatic offline testing on or off
173 - support for SCSI
174 - checking the power mode [-n Directive of smartd] (this is not
175 completely impossible, but not by using a documented API)
176
177 * Are implemented, but don't work due to OS bugs:
178 - switching off SMART (switching *on* works fine)
179 - switching off auto-save (but why would you want to?)
180 - running the short test (that leaves you with only the extended test)
181
182 The last set have been filed in Apple's bug tracking system and
183 hopefully will be fixed in the next major version of Mac OS.
184
185 However, some things do work well. For ATA devices, all the
186 informational output is available, unless you want something that only
187 an offline test updates.
188
189 H) OS/2, eComStation
190
191 The code was tested on eComStation 1.1, but it should work on all versions
192 of OS/2.
193 Innotek LibC 0.5 runtime is required.
194 Currently only ATA disks are supported, SCSI support will be added.
195
196
197[2] Installing from CVS
198=======================
199 Get the sources from the CVS repository:
200 cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/smartmontools login
201 cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/smartmontools co sm5
202 (when prompted for a password, just press Enter)
203
204 Then type:
205 ./autogen.sh
206 and continue with step [3] below, skipping the "unpack the tarball" step.
207
208 Further details of using CVS can be found at the URL above.
209
210 The autogen.sh command is ONLY required when installing from
211 CVS. You need GNU Autoconf (version 2.50 or greater), GNU Automake
212 (version 1.6 or greater) and their dependencies installed in order
213 to run it. You can get these here:
214 http://www.gnu.org/directory/GNU/autoconf.html
215 http://www.gnu.org/directory/GNU/automake.html
216
217[3] Installing from the source tarball
218======================================
219
220 If you are NOT installing from CVS, then unpack the tarball:
221 tar zxvf smartmontools-5.VERSION.tar.gz
222
223 Then:
224 ./configure
225 make
226 make install (you may need to be root to do this)
227
228 As shown (with no options to ./configure) this defaults to the
229 following set of installation directories:
230 --prefix=/usr/local
231 --sbindir=/usr/local/sbin
232 --sysconfdir=/usr/local/etc
233 --mandir=/usr/local/share/man
234 --with-docdir=/usr/local/share/doc/smartmontools-VERSION
235 --with-initscriptdir=/usr/local/etc/rc.d/init.d
236 --disable-sample
237
238 These will usually not overwrite existing "distribution" installations on
239 Linux Systems since the FHS reserves this area for use by the system
240 administrator.
241
242 For different installation locations or distributions, simply add
243 arguments to ./configure as shown in [4] below.
244
245 If you wish to alter the default C compiler flags, set an
246 environment variable CFLAGS='your options' before doing
247 ./configure, or else do:
248 make CFLAGS='your options'
249
250[4] Guidelines for different Linux distributions
251================================================
252
253Note: Please send corrections/additions to:
254smartmontools-support@lists.sourceforge.net
255
256Debian:
257 If you don't want to overwrite any distribution package, use:
258 ./configure
259
260Filesystem Hierarchy Standard (FHS, http://www.pathname.com/fhs/):
261 ./configure --sbindir=/usr/local/sbin \
262 --sysconfdir=/usr/local/etc \
263 --mandir=/usr/local/man \
264 --with-initscriptdir=/usr/local/etc/rc.d/init.d \
265 --with-docdir=/usr/local/share/doc/smartmontools-VERSION
266
267Red Hat:
268 ./configure --sbindir=/usr/sbin \
269 --sysconfdir=/etc \
270 --mandir=/usr/share/man \
271 --with-initscriptdir=/etc/rc.d/init.d \
272 --with-docdir=/usr/share/doc/smartmontools-VERSION
273
274Slackware:
275 If you don't want to overwrite any "distribution" package, use:
276 ./configure
277
278 Otherwise use:
279 ./configure --sbindir=/usr/sbin \
280 --sysconfdir=/etc \
281 --mandir=/usr/share/man \
282 --with-initscriptdir=/etc/rc.d \
283 --with-docdir=/usr/share/doc/smartmontools-VERSION
284
285 And
286 removepkg smartmontools smartsuite (only root can do this)
287 before make install
288
289 The init script works on Slackware. You just have to add an entry like
290 the following in /etc/rc.d/rc.M or /etc/rc.d/rc.local:
291
292 if [ -x /etc/rc.d/smartd ]; then
293 . /etc/rc.d/smartd start
294 fi
295
296 To disable it:
297 chmod 644 /etc/rc.d/smartd
298
299 For a list of options:
300 /etc/rc.d/smartd
301
302SuSE:
303 ./configure --sbindir=/usr/sbin \
304 --sysconfdir=/etc \
305 --mandir=/usr/share/man \
306 --with-initscriptdir=/etc/init.d \
307 --with-docdir=/usr/share/doc/packages/smartmontools-VERSION
308
309[5] Guidelines for FreeBSD
310==========================
311 To match the way it will installed when it becomes available as a PORT, use
312 the following:
313
314 ./configure --prefix=/usr/local \
315 --with-initscriptdir=/usr/local/etc/rc.d/ \
316 --with-docdir=/usr/local/share/doc/smartmontools-VERSION \
317 --enable-sample
318
319 Also, it is important that you use GNU make (gmake from /usr/ports/devel/gmake)
320 to build smartmontools, as the default FreeBSD make doesn't know how to build
321 the man pages.
322
323 NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
324 be installed with the string '.sample' append to the name, so you will end
325 up with the following:
326 /usr/local/etc/smartd.conf.sample
327 /usr/local/etc/rc.d/smartd.sample
328
329
330[6] Guidelines for Darwin
331=========================
332 ./configure --with-initscriptdir=/Library/StartupItems
333
334
335[7] Guidelines for NetBSD/OpenBSD
336=================================
337 ./configure --prefix=/usr/pkg \
338 --with-docdir=/usr/pkg/share/doc/smartmontools
339
340 On OpenBSD, it is important that you use GNU make (gmake from
341 /usr/ports/devel/gmake) to build smartmontools, as the BSD make doesn't
342 know how to make the manpages.
343
344[8] Guidelines for Solaris
345==========================
346
347 smartmontools has been partially but not completely ported to
348 Solaris. It includes complete SCSI support but no ATA or 3ware
349 support. It can be compiled with either cc or gcc. To compile
350 with gcc:
351
352 ./configure [args]
353 make
354
355 To compile with Sun cc:
356
357 setenv CC cc [csh syntax], or
358 CC=cc [sh syntax]
359 ./configure [args]
360 make
361
362 The correct arguments [args] to configure are:
363 --sbindir=/usr/sbin \
364 --sysconfdir=/etc \
365 --mandir=/usr/share/man \
366 --with-docdir=/usr/share/doc/smartmontools-VERSION \
367 --with-initscriptdir=/etc/init.d
368
369 To start the script automatically on bootup, create hardlinks that
370 indicate when to start/stop in:
371 /etc/rc[S0123].d/
372 pointing to /etc/init.d/smartd. Create:
373 K<knum>smartd in rcS.d, rc0.d, rc1.d, rc2.d
374 S<snum>smartd in rc3.d
375 where <knum> is related to <snum> such that the higher snum is the
376 lower knum must be.
377
378 On usual configuration, '95' would be suitable for <snum> and '05'
379 for <knum> respectively. If you choose these value, you can
380 create hardlinks by:
381
382 cd /etc
383 sh -c 'for n in S 0 1 2; do ln init.d/smartd rc$n.d/K05smartd; done'
384 sh -c 'for n in 3 ; do ln init.d/smartd rc$n.d/S95smartd; done'
385
386[9] Guidelines for Cygwin
387=========================
388
389Same as Red Hat:
390 ./configure --prefix=/usr \
391 --sysconfdir=/etc \
392 --mandir='${prefix}/share/man'
393
394 OR EQUIVALENTLY
395 ./configure --sbindir=/usr/sbin \
396 --sysconfdir=/etc \
397 --mandir=/usr/share/man \
398 --with-initscriptdir=/etc/rc.d/init.d \
399 --with-docdir=/usr/share/doc/smartmontools-VERSION
400
401 Using DOS text file type as default for the working directories ("textmode"
402 mount option) is not recommended. Building the binaries and man pages using
403 "make" is possible, but "make dist" and related targets work only with UNIX
404 file type ("binmode" mount option) set. The "autogen.sh" script prints a
405 warning if DOS type is selected.
406
407[10] Guidelines for Windows
408==========================
409
410To compile the Windows release with MinGW, use the following on Cygwin:
411
412 ./configure --build=mingw32
413 make
414
415 Instead of using "make install", copy the .exe files into
416 some directory in the PATH.
417
418To build the Windows binary distribution, use:
419
420 make dist-win32
421
422 This builds the distribution in directory
423
424 ./smartmontools-VERSION.win32/
425
426 and packs it into
427
428 ./smartmontools-VERSION.win32.zip
429
430 Additional make targets are distdir-win32 to build the directory
431 only and cleandist-win32 for cleanup.
432
433 The binary distribution includes all documentation files converted
434 to DOS text file format and *.html and *.txt preformatted man pages.
435 The tools unix2dos.exe (package cygutils) and zip.exe (package zip
436 or a native Win32 release of Info-ZIP, http://www.info-zip.org) are
437 necessary but may be not installed by Cygwin's default settings.
438
439 It is also possible to compile smartmontools with MSVC 6.0.
440 The project files (smartmontools_vc6.dsw, smart{ctl,d}_vc6.dsp) are
441 included in CVS (but not in source tarball). The config_vc6.h is no
442 longer maintained in CVS. The command:
443
444 make config-vc6
445
446 builds config_vc6.h from MinGW's config.h. Unlike MinGW, MSVC 6.0
447 can also be used to build the syslog message file tool syslogevt.exe.
448 See smartd man page for usage information about this tool.
449
450
451[11] Guidelines for OS/2, eComStation
452=====================================
453
454To compile the OS/2 code, please run
455
456 ./os_os2/configure.os2
457 make
458 make install
459
460[12] Guidelines for OpenBSD
461==========================
462 To match the way it will installed when it becomes available as a PORT, use
463 the following:
464
465 ./configure --prefix=/usr/local \
466 --sysconfdir=/etc
467 --with-initscriptdir=/usr/local/share/doc/smartmontools-VERSION \
468 --with-docdir=/usr/local/share/doc/smartmontools-VERSION \
469 --enable-sample
470
471 It is important that you use GNU make (gmake from /usr/ports/devel/gmake)
472 to build smartmontools, as the default OpenBSD make doesn't know how to build
473 the man pages.
474
475 NOTE1: --with-initscriptdir installs a SystemV startup script. It really
476 should be --without-initscriptdir, but the Makefile code is incorrect and
477 trys to install the initscript (smartd) to /no. So, an interim fix it to
478 set the initscript dir to the doc dir.
479
480 NOTE2: --enable-sample will cause the smartd.conf and smartd RC files to
481 be installed with the string '.sample' append to the name, so you will end
482 up with the following:
483 /usr/local/etc/smartd.conf.sample
484 /usr/local/etc/rc.d/smartd.sample
485
486[13] Comments
487============
488
489To compile from another directory, you can replace the step
490 ./configure [options]
491by the following:
492 mkdir objdir
493 cd objdir
494 ../configure [options]
495
496To install to another destination (used mainly by package maintainers,
497or to examine the package contents without risk of modifying any
498system files) you can replace the step:
499 make install
500with:
501 make DESTDIR=/home/myself/smartmontools-package install
502
503Use a full path. Paths like ~/smartmontools-package may not work.
504
505After installing smartmontools, you can read the man pages, and try
506out the commands:
507
508man smartd.conf
509man smartctl
510man smartd
511
512/usr/sbin/smartctl -s on -o on -S on /dev/hda (only root can do this)
513/usr/sbin/smartctl -a /dev/hda (only root can do this)
514
515Note that the default location for the manual pages are
516/usr/share/man/man5 and /usr/share/man/man8. If "man" doesn't find
517them, you may need to add /usr/share/man to your MANPATH environment
518variable.
519
520Source and binary RPM packages are available at
521http://sourceforge.net/project/showfiles.php?group_id=64297
522
523Refer to http://smartmontools.sourceforge.net/index.html#howtodownload
524for any additional download and installation instructions.
525
526The following files are installed if ./configure has no options:
527
528/usr/local/sbin/smartd [Executable daemon]
529/usr/local/sbin/smartctl [Executable command-line utility]
530/usr/local/etc/smartd.conf [Configuration file for smartd daemon]
531/usr/local/etc/rc.d/init.d/smartd [Init/Startup script for smartd]
532/usr/local/share/man/man5/smartd.conf.5 [Manual page]
533/usr/local/share/man/man8/smartctl.8 [Manual page]
534/usr/local/share/man/man8/smartd.8 [Manual page]
535/usr/local/share/doc/smartmontools-5.X/AUTHORS [Information about the authors and developers]
536/usr/local/share/doc/smartmontools-5.X/CHANGELOG [A log of changes. Also see CVS]
537/usr/local/share/doc/smartmontools-5.X/COPYING [GNU General Public License Version 2]
538/usr/local/share/doc/smartmontools-5.X/INSTALL [Installation instructions: what you're reading!]
539/usr/local/share/doc/smartmontools-5.X/NEWS [Significant bugs discovered in old versions]
540/usr/local/share/doc/smartmontools-5.X/README [Overview]
541/usr/local/share/doc/smartmontools-5.X/TODO [Things that need to be done/fixed]
542/usr/local/share/doc/smartmontools-5.X/WARNINGS [Systems where lockups or other serious problems were reported]
543/usr/local/share/doc/smartmontools-5.X/smartd.conf [Example configuration file for smartd]
544/usr/local/share/doc/smartmontools-5.X/examplescripts [Executable scripts for -M exec of smartd.conf (4 files)]
545
546The commands:
547
548make htmlman
549make txtman
550
551may be used to build .html and .txt preformatted man pages.
552These are used by the dist-win32 make target to build the Windows
553distribution.
554The commands also work on other operating system configurations
555if suitable versions of man2html, groff and grotty are installed.
556On systems without man2html, the following command should work
557if groff is available:
558
559make MAN2HTML='groff -man -Thtml' htmlman
560
561
562[14] Detailed description of arguments to configure command
563===========================================================
564
565When you type:
566./configure [options]
567there are six particularly important variables that affect where the
568smartmontools software is installed. The variables are listed here,
569with their default values in square brackets, and the quantities that
570they affect described following that. This is a very wide table: please read
571it in a wide window.
572
573OPTIONS DEFAULT AFFECTS
574------- ------- -------
575--prefix /usr/local Please see below
576--sbindir ${prefix}/sbin Directory for smartd/smartctl executables;
577 Contents of smartd/smartctl man pages
578--mandir ${prefix}/share/man Directory for smartctl/smartd/smartd.conf man pages
579--sysconfdir ${prefix}/etc Directory for smartd.conf;
580 Contents of smartd executable;
581 Contents of smartd/smartd.conf man pages;
582 Directory for rc.d/init.d/smartd init script
583--with-initscriptdir ${sysconfdir}/init.d/rc.d Location of init scripts
584--with-docdir ${prefix}/share/doc/smartmontools-5.X Location of the documentation
585--enable-sample --disable-sample Adds the string '.sample' to the names of the smartd.conf file and the smartd RC file
586
587Here's an example:
588If you set --prefix=/home/joe and none of the other four
589variables then the different directories that are used would be:
590--sbindir /home/joe/sbin
591--mandir /home/joe/share/man
592--sysconfdir /home/joe/etc
593--with-initscriptdir /home/joe/etc/init.d/rc.d
594--with-docdir /home/joe/doc/smartmontools-5.X
595
596This is useful for test installs in a harmless subdirectory somewhere.
597
598Here are the four possible cases for the four variables above:
599
600Case 1:
601--prefix not set
602--variable not set
603===> VARIABLE gets default value above
604
605Case 2:
606--prefix set
607--variable not set
608===> VARIABLE gets PREFIX/ prepended to default value above
609
610Case 3:
611--prefix not set
612--variable set
613===> VARIABLE gets value that is set
614
615Case 4:
616--prefix is set
617--variable is set
618===> PREFIX is IGNORED, VARIABLE gets value that is set
619
620
621Here are the differences with and without --enable-sample, assuming
622no other options specified (see above for details)
623
624Case 1:
625--enable-sample provided
626==> Files installed are:
627 /usr/local/etc/smartd.conf.sample
628 /usr/local/etc/rc.d/init.d/smartd.sample
629
630Case 2:
631--disable-sample provided or parameter left out
632==> Files installed are:
633 /usr/local/etc/smartd.conf
634 /usr/local/etc/rc.d/init.d/smartd
635
636Additional information about using configure can be found here:
637http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/autoconf.html#SEC139