Smartmontools installation instructions
=======================================
-$Id: INSTALL 2925 2009-10-02 20:45:54Z chrfranke $
+$Id: INSTALL 3356 2011-06-06 18:37:53Z chrfranke $
Please also see the smartmontools home page:
http://smartmontools.sourceforge.net/
smartmontools will "mostly" work. The things that don't work will
give you harmless warning messages.
- Although "not officially supported" by the developers, smartmontools
- has also been successfully build and run on a legacy Linux system
- with kernel 2.0.33 and libc.so.5. On such systems, the restrictions
- above apply.
-
For item (1) above, any 2.4 or 2.6 series kernel will provide
HDIO_DRIVE_TASK support. Some 2.2.20 and later kernels also
provide this support IF they're properly patched and
configured. [Andre Hedrick's IDE patches may be found at
- http://www.funet.fi/pub/linux/kernel/people/hedrick/ide-2.2.20/ or
- are available from your local kernel.org mirror. They are not
+ http://www.nic.funet.fi/pub/linux/kernel/people/hedrick/ide-2.2.20/
+ or are available from your local kernel.org mirror. They are not
updated for 2.2.21 or later, and may contain a few bugs.].
If the configuration option CONFIG_IDE_TASK_IOCTL
exists in your 2.2.X kernel source code tree, then your 2.2.X
E) Cygwin
- The code was tested on Cygwin 1.5.7, 1.5.11 and 1.5.18-22. It should
- also work on other recent releases.
-
- Release 1.5.15 or later is recommended for Cygwin smartd. Older versions
- do not provide syslogd support.
+ The code was tested on Cygwin 1.7.7-1. It should also work on other
+ recent releases.
Both Cygwin and Windows versions of smartmontools share the same code
to access the IDE/ATA or SCSI devices. The information in the "Windows"
F) Windows
- The code was tested on Windows 98SE, NT4(SP5,SP6), 2000(SP4),
- XP(no SP,SP1a,SP2) and Vista RC 1. It should also work on Windows
- 95(OSR2), 98, ME and 2003.
+ The code was tested on Windows 98SE, ME, NT4(SP5,SP6), 2000(SP4),
+ XP(up to SP3), 2003, Vista and Windows 7.
+
+ -- Windows 9x/ME
On 9x/ME, only standard (legacy) IDE/ATA devices 0-3 are supported.
The driver SMARTVSD.VXD must be present in WINDOWS\SYSTEM\IOSUBSYS
installation of some versions of Windows is the WINDOWS\SYSTEM folder.
In this case, move SMARTVSD.VXD to WINDOWS\SYSTEM\IOSUBSYS and reboot
(http://support.microsoft.com/kb/265854/en-us).
- SMARTVSD.VXD may also be missing in a new installation
- (http://support.microsoft.com/kb/199886/en-us).
SMARTVSD.VXD relies on the standard IDE port driver ESDI_506.PDR.
If the system uses a vendor specific driver, access of SMART data
- is not possible on 9x/ME. This is the case if e.g. the optional
- "IDE miniport driver" is installed on a system with VIA chipset.
+ is not possible.
Some ATA controllers (e.g. Promise) provided a custom SMARTVSD.VXD
for their Win9x/ME driver. To access SMART data from both the legacy
all occurrences of the string "SMARTVSD" with "SMARTVSE". Then reinstall
the original Windows SMARTVSD.VXD.
- On NT4/2000/XP/2003, ATA or SATA devices are supported if the device
- driver implements the SMART IOCTL.
+ To access SCSI and USB devices, an installed ASPI interface (WNASPI32.DLL)
+ is required. The code was tested with Adaptec Windows ASPI drivers 4.71.2.
+ (http://www.adaptec.com/en-US/support/_eol/scsi_sw/ASPI-4.70/)
+ Links to other ASPI drivers can be found at http://www.nu2.nu/aspi/.
+
+ -- Windows NT4/2000/XP/2003/Vista/Win7
- The IDE/ATA read log command (smartctl -l, --log, -a, --all) is
- not supported by the SMART IOCTL of NT4/2000/XP. Undocumented
- and possibly buggy system calls are used for this purpose,
- see WARNINGS file for details.
+ ATA or SATA devices are supported if the device driver implements
+ the SMART IOCTLs or IOCTL_IDE_PASS_THROUGH or IOCTL_ATA_PASS_THROUGH.
+ The ATA SMART READ LOG command (smartctl -l, --log, -a, --all) is not
+ supported if only the SMART IOCTLs are implemented.
- SCSI devices are supported on all versions of Windows. An installed
- ASPI interface (WNASPI32.DLL) is required to access SCSI devices.
- The code was tested with Adaptec Windows ASPI drivers 4.71.2.
- (http://www.adaptec.com/en-US/support/scsi_soft/ASPI/ASPI-4.70/)
- Links to other ASPI drivers can be found at http://www.nu2.nu/aspi/.
+ SCSI and USB devices are accessed through SPTI. Special driver support
+ is not required.
- 3ware 9000 RAID controllers are supported using new features available
+ 3ware 9000 RAID controllers are supported using features available
in the Windows driver release 9.4.0 (3wareDrv.sys 3.0.2.70) or later.
Older drivers provide SMART access to the first physical drive (port)
of each logical drive (unit). If driver support is not available
SVN. You need GNU Autoconf (version 2.50 or greater), GNU Automake
(version 1.7 or greater) and their dependencies installed in order
to run it. You can get these here:
- http://www.gnu.org/directory/GNU/autoconf.html
- http://www.gnu.org/directory/GNU/automake.html
+ http://directory.fsf.org/project/autoconf/
+ http://directory.fsf.org/project/automake/
[3] Installing from the source tarball
======================================
make install (you may need to be root to do this)
As shown (with no options to ./configure) this defaults to the
- following set of installation directories:
+ following set of installation directories:
--prefix=/usr/local
--sbindir=/usr/local/sbin
--sysconfdir=/usr/local/etc
--mandir=/usr/local/share/man
- --with-docdir=/usr/local/share/doc/smartmontools-VERSION
+ --[with-]docdir=/usr/local/share/doc/smartmontools
+ --with-drivedbdir=/usr/local/share/smartmontools
--with-initscriptdir=/usr/local/etc/rc.d/init.d
+ --enable-drivedb
+ --disable-attributelog
--disable-sample
+ --disable-savestates
+ --with-libcap-ng=auto
+ --without-selinux
These will usually not overwrite existing "distribution" installations on
Linux Systems since the FHS reserves this area for use by the system
For different installation locations or distributions, simply add
arguments to ./configure as shown in [4] below.
- If you wish to alter the default C compiler flags, set an
- environment variable CFLAGS='your options' before doing
+ If you wish to alter the default C++ compiler flags, set an
+ environment variable CXXFLAGS='your options' before doing
./configure, or else do:
- make CFLAGS='your options'
+ make CXXFLAGS='your options'
The first output line of smartctl and smartd provides information
about release number, last SVN checkin date and revison, platform,
Red Hat:
./configure --sbindir=/usr/sbin \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --with-initscriptdir=/etc/rc.d/init.d \
- --with-docdir=/usr/share/doc/smartmontools-VERSION
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --with-initscriptdir=/etc/rc.d/init.d \
+ --with-docdir=/usr/share/doc/smartmontools-VERSION
Slackware:
If you don't want to overwrite any "distribution" package, use:
./configure --prefix=/usr/local \
--with-initscriptdir=/usr/local/etc/rc.d/ \
--with-docdir=/usr/local/share/doc/smartmontools-VERSION \
- --enable-sample
+ --enable-sample
NOTE: --enable-sample will cause the smartd.conf and smartd RC files to
be installed with the string '.sample' append to the name, so you will end
up with the following:
- /usr/local/etc/smartd.conf.sample
- /usr/local/etc/rc.d/smartd.sample
+ /usr/local/etc/smartd.conf.sample
+ /usr/local/etc/rc.d/smartd.sample
[6] Guidelines for Darwin
CXX='g++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386' \
./configure --host=i386-apple-darwin \
- --with-initscriptdir=/Library/StartupItems
+ --with-initscriptdir=/Library/StartupItems
[7] Guidelines for NetBSD/OpenBSD
=================================
./configure --prefix=/usr/pkg \
- --with-docdir=/usr/pkg/share/doc/smartmontools
+ --with-docdir=/usr/pkg/share/doc/smartmontools
On OpenBSD, it is important that you use GNU make (gmake from
/usr/ports/devel/gmake) to build smartmontools, as the BSD make doesn't
To start the script automatically on bootup, create hardlinks that
indicate when to start/stop in:
- /etc/rc[S0123].d/
+ /etc/rc[S0123].d/
pointing to /etc/init.d/smartd. Create:
- K<knum>smartd in rcS.d, rc0.d, rc1.d, rc2.d
- S<snum>smartd in rc3.d
+ K<knum>smartd in rcS.d, rc0.d, rc1.d, rc2.d
+ S<snum>smartd in rc3.d
where <knum> is related to <snum> such that the higher snum is the
lower knum must be.
--sysconfdir=/etc \
--mandir=/usr/share/man \
--with-initscriptdir=/etc/rc.d/init.d \
- --with-docdir=/usr/share/doc/smartmontools-VERSION
+ --with-docdir=/usr/share/doc/smartmontools
Using DOS text file type as default for the working directories ("textmode"
mount option) is not recommended. Building the binaries and man pages using
Instead of using "make install", copy the .exe files into
some directory in the PATH.
-To compile with MinGW gcc 3.x on Cygwin, use:
+Cross-compile statically linked 32-bit version with MinGW-w64:
+
+ ./configure --build=$(./config.guess) \
+ --host=i686-w64-mingw32 \
+ LDFLAGS=-static
+
+ Tested on Cygwin and Debian Linux.
+
+Cross-compile statically linked 64-bit version with MinGW-w64:
+
+ ./configure --build=$(./config.guess) \
+ --host=x86_64-w64-mingw32 \
+ LDFLAGS=-static
+
+ Tested on Cygwin and Debian Linux with MinGW-w64 from
+ http://mingw-w64.sourceforge.net/.
- ./configure --build=i686-pc-mingw32
+WARNING: The smartmontools version for 64-bit Windows is still EXPERIMENTAL.
- The above does not work if gcc 4.x is installed and selected as
- default by /usr/sbin/alternatives. If the configure command aborts
- with error message '... does not support -mno-cygwin', select
- gcc 3.x by:
+Cross-compile on Cygwin with old gcc-mingw 3.x:
- CC=gcc-3 CXX=g++-3 ./configure --build=i686-pc-mingw32
+ ./configure --build=$(./config.guess) \
+ --host=i686-pc-mingw32 \
+ CC='gcc-3 -mno-cygwin' \
+ CXX='g++-3 -mno-cygwin' \
+ CXXFLAGS='-g -O2 -Wall -W -Wno-format'
- Alternatively, a MinGW-targeted cross-compiler can be used if available:
+Cross-compile on Debian Linux with gcc-mingw32:
- ./configure --build=i686-pc-cygwin --host=i686-pc-mingw32
+ ./configure --build=$(./config.guess) \
+ --host=i586-mingw32msvc
To build the Windows binary distribution, use:
package. See http://nsis.sourceforge.net/ for documentation and
download location.
+ It is also possible to (cross-)build the installer on Linux.
+ This was successfully tested on Debian with package "nsis".
+
To both create and run the (interactive) installer, use:
make install-win32
or a native Win32 release of Info-ZIP, http://www.info-zip.org) are
necessary but may be not installed by Cygwin's default settings.
-To prepare os_win32 directory for MSVC8, use the following on Cygwin:
+ The event message file tool syslogevt.exe (see smartd man page) is
+ included in the binary distribution if message compiler (windmc)
+ and resource compiler (windres) are available. This may be disabled
+ by passing 'WINDMC=no' to configure.
+
+To prepare os_win32 directory for MSVC8, use the following on MSYS
+or Cygwin:
mkdir vctmp && cd vctmp
- ../configure --build=mingw32
+ ../configure [... any MinGW option set from above ...]
make config-vc8
The MSVC8 project files (os_win32/smartmontools_vc8.sln,
./{config,svnversion}.h. The configure skript must be run outside
of the source directory to avoid inclusion of the original config.h.
- Unlike MinGW, MSVC can also be used to build the syslog message file
- tool syslogevt.exe. See smartd man page for usage information about
- this tool.
-
[11] Guidelines for OS/2, eComStation
=====================================
the following:
./configure --prefix=/usr/local \
- --sysconfdir=/etc
+ --sysconfdir=/etc
--with-initscriptdir=/usr/local/share/doc/smartmontools-VERSION \
--with-docdir=/usr/local/share/doc/smartmontools-VERSION \
- --enable-sample
+ --enable-sample
It is important that you use GNU make (gmake from /usr/ports/devel/gmake)
to build smartmontools, as the default OpenBSD make doesn't know how to build
NOTE2: --enable-sample will cause the smartd.conf and smartd RC files to
be installed with the string '.sample' append to the name, so you will end
up with the following:
- /usr/local/etc/smartd.conf.sample
- /usr/local/etc/rc.d/smartd.sample
+ /usr/local/etc/smartd.conf.sample
+ /usr/local/etc/rc.d/smartd.sample
[13] Comments
============
them, you may need to add /usr/share/man to your MANPATH environment
variable.
-Source and binary RPM packages are available at
-http://sourceforge.net/project/showfiles.php?group_id=64297
+Source and binary packages for Windows are available at
+http://sourceforge.net/projects/smartmontools/files/
-Refer to http://smartmontools.sourceforge.net/index.html#howtodownload
+Refer to http://sourceforge.net/apps/trac/smartmontools/wiki/Download
for any additional download and installation instructions.
The following files are installed if ./configure has no options:
-/usr/local/sbin/smartd [Executable daemon]
/usr/local/sbin/smartctl [Executable command-line utility]
+/usr/local/sbin/smartd [Executable daemon]
+/usr/local/sbin/update-smart-drivedb [Drive database update script]
/usr/local/etc/smartd.conf [Configuration file for smartd daemon]
/usr/local/etc/rc.d/init.d/smartd [Init/Startup script for smartd]
/usr/local/share/man/man5/smartd.conf.5 [Manual page]
/usr/local/share/man/man8/smartctl.8 [Manual page]
/usr/local/share/man/man8/smartd.8 [Manual page]
-/usr/local/share/doc/smartmontools-5.X/AUTHORS [Information about the authors and developers]
-/usr/local/share/doc/smartmontools-5.X/CHANGELOG [A log of changes. Also see SVN]
-/usr/local/share/doc/smartmontools-5.X/COPYING [GNU General Public License Version 2]
-/usr/local/share/doc/smartmontools-5.X/INSTALL [Installation instructions: what you're reading!]
-/usr/local/share/doc/smartmontools-5.X/NEWS [Significant bugs discovered in old versions]
-/usr/local/share/doc/smartmontools-5.X/README [Overview]
-/usr/local/share/doc/smartmontools-5.X/TODO [Things that need to be done/fixed]
-/usr/local/share/doc/smartmontools-5.X/WARNINGS [Systems where lockups or other serious problems were reported]
-/usr/local/share/doc/smartmontools-5.X/smartd.conf [Example configuration file for smartd]
-/usr/local/share/doc/smartmontools-5.X/examplescripts [Executable scripts for -M exec of smartd.conf (4 files)]
+/usr/local/share/doc/smartmontools/AUTHORS [Information about the authors and developers]
+/usr/local/share/doc/smartmontools/CHANGELOG [A log of changes. Also see SVN]
+/usr/local/share/doc/smartmontools/COPYING [GNU General Public License Version 2]
+/usr/local/share/doc/smartmontools/INSTALL [Installation instructions: what you're reading!]
+/usr/local/share/doc/smartmontools/NEWS [Significant bugs discovered in old versions]
+/usr/local/share/doc/smartmontools/README [Overview]
+/usr/local/share/doc/smartmontools/TODO [Things that need to be done/fixed]
+/usr/local/share/doc/smartmontools/WARNINGS [Systems where lockups or other serious problems were reported]
+/usr/local/share/doc/smartmontools/smartd.conf [Example configuration file for smartd]
+/usr/local/share/doc/smartmontools/examplescripts/ [Executable scripts for -M exec of smartd.conf (4 files)]
+/usr/local/share/smartmontools/drivedb.h [Drive database]
+
+If /usr/local/etc/smartd.conf exists and differs from the
+default then the default configuration file is installed as
+/usr/local/etc/smartd.conf.sample instead.
The commands:
--prefix /usr/local Please see below
--sbindir ${prefix}/sbin Directory for smartd/smartctl executables;
Contents of smartd/smartctl man pages
+--docdir ${prefix}/share/doc/smartmontools Location of the documentation
+ (autoconf >= 2.60 only, see also --with-docdir below)
--mandir ${prefix}/share/man Directory for smartctl/smartd/smartd.conf man pages
--sysconfdir ${prefix}/etc Directory for smartd.conf;
Contents of smartd executable;
Contents of smartd/smartd.conf man pages;
Directory for rc.d/init.d/smartd init script
---with-initscriptdir ${sysconfdir}/init.d/rc.d Location of init scripts
---with-docdir ${prefix}/share/doc/smartmontools-5.X Location of the documentation
+--with-initscriptdir auto Location of init scripts
+--with-systemdsystemunitdir auto Location of systemd service files
+--with-docdir ${prefix}/share/doc/smartmontools Location of the documentation
+--with-exampledir ${docdir}/examplescripts Location of example scripts
--enable-sample --disable-sample Adds the string '.sample' to the names of the smartd.conf file and the smartd RC file
--with-os-deps os_<guessed>.o OS dependent module(s)
---with-selinux <not set> Enables SELinux support. If smartmontools has to create the /dev/tw[ae] device
+--with-selinux --without-selinux Enables SELinux support. If smartmontools has to create the /dev/tw[ae] device
nodes for 3ware/AMCC controllers, this option ensures that the nodes are created
with correct SELinux file contexts.
---enable-drivedb --disable-drivedb Enables default drive database file '${drivedbdir}/drivedb.h'
---with-drivedbdir ${prefix}/share/smartmontools/drivedb.h Directory for 'drivedb.h' (specifying this option implies --enable-drivedb)
+--with-libcap-ng --with-libcap-ng=auto Enables/disables libcap-ng support. If enabled and libcap-ng is
+ available, option --capabilities is added to smartd.
+--disable-drivedb --enable-drivedb Disables default drive database file '${drivedbdir}/drivedb.h'
+--with-drivedbdir ${prefix}/share/smartmontools Directory for 'drivedb.h' (implies --enable-drivedb)
--enable-savestates --disable-savestates Enables default smartd state files '${savestates}MODEL-SERIAL.ata.state'
---with-savestates ${prefix}/var/lib/smartmontools/smartd. Prefix for smartd state files (specifying this option implies --enable-savestates)
+--with-savestates ${prefix}/var/lib/smartmontools/smartd. Prefix for smartd state files (implies --enable-savestates)
+--enable-attributelog --disable-attributelog Enables default smartd attribute log files
+--with-attributelog ${prefix}/var/lib/smartmontools/attrlog. Prefix for smartd attribute log files (implies --enable-attributelog)
+
+Please note that in previous versions of smartmontools (<= 5.39) the
+default for --with-docdir was
+ ${prefix}/share/doc/smartmontools-VERSION
+This was changed to make it consistent with the default of the
+new --docdir option added in autoconf 2.60.
+
+The defaults for --with-initscriptdir and --with-systemdsystemunitdir are
+guessed such that the following rules apply:
+- If --prefix=/usr --sysconfdir=/etc is specified, the guessed directories
+ should be the defaults used by the current OS or distribution.
+- If --sysconfdir=/etc is NOT specified, the guessed directories should
+ always be below ${prefix} or below ${sysconfdir}.
Here's an example:
If you set --prefix=/home/joe and none of the other four
variables then the different directories that are used would be:
--sbindir /home/joe/sbin
+--docdir /home/joe/share/doc/smartmontools
--mandir /home/joe/share/man
--sysconfdir /home/joe/etc
---with-initscriptdir /home/joe/etc/init.d/rc.d
---with-docdir /home/joe/doc/smartmontools-5.X
+--with-exampledir /home/joe/share/doc/smartmontools/examplescripts
+--with-drivedbdir /home/joe/share/smartmontools
+--with-initscriptdir [see below]
+--with-systemdsystemunitdir [see below]
+
+If systemd is present (and pkg-config reports /lib/systemd/system
+as the systemdsystemunitdir):
+
+--with-initscriptdir [disabled]
+--with-systemdsystemunitdir /home/joe/lib/systemd/system
+
+else if /etc/rc.d/init.d exists:
+
+--with-initscriptdir /home/joe/etc/rc.d/init.d
+--with-systemdsystemunitdir [disabled]
+
+else if /etc/init.d exists:
+
+--with-initscriptdir /home/joe/etc/init.d
+--with-systemdsystemunitdir [disabled]
+
+else if /etc/rc.d exists:
+
+--with-initscriptdir /home/joe/etc/rc.d
+--with-systemdsystemunitdir [disabled]
+
+else
+
+--with-initscriptdir [disabled]
+--with-systemdsystemunitdir [disabled]
This is useful for test installs in a harmless subdirectory somewhere.
Here are the differences with and without --enable-sample, assuming
-no other options specified (see above for details)
+that initscript location is set and no other options specified
+(see above for details)
Case 1:
--enable-sample provided
==> Files installed are:
- /usr/local/etc/smartd.conf.sample
- /usr/local/etc/rc.d/init.d/smartd.sample
+ /usr/local/etc/smartd.conf.sample
+ /usr/local/etc/rc.d/init.d/smartd.sample
Case 2:
--disable-sample provided or parameter left out
==> Files installed are:
- /usr/local/etc/smartd.conf
- /usr/local/etc/rc.d/init.d/smartd
+ /usr/local/etc/smartd.conf
+ /usr/local/etc/rc.d/init.d/smartd
Additional information about using configure can be found here:
-http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/autoconf.html#SEC139
+http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts