1. Linux

1.1. Installation

Enter the following commands at a Command Line.

sudo apt-get install smartmontools

1.2. Configuration

Enter the following commands at a Command Line.

# Back up original file.
sudo cp -a /etc/default/smartmontools /etc/default/smartmontools.org
# Uncomment the "#start_smartd=yes" line.
sed -i 's/^#start_smartd=yes$/start_smartd=yes/' /etc/default/smartmontools
# Start smartmontools.
sudo /etc/init.d/smartmontools start

1.3. Hard Disk Diagnosis

Enter the following optional commands at a Command Line.

sudo smartctl -i /dev/sda
sudo smartctl -H /dev/sda
sudo smartctl -a /dev/sda | grep -i 'reallocated_sector'
sudo smartctl -a /dev/sda | grep -i 'current_pending_sector'
sudo smartctl -a /dev/sda | grep -i 'offline_uncorrectable'
sudo smartctl -t long /dev/sda

2. Build of static executables

The Endian Firewall is installed on two disks setup with RAID 1. However, it does not have SMART monitoring software like smartmontools installed. Also, it is not possible to install additional software packages.

But it is possible to build static smartmontools executables from the source code and copy these static executables with any configuration files manually to the Endian Firewall. This allows us to use the smartmontools commands like they were installed through the package manager.

Enter the following commands at a Command Line.

cd /tmp
wget https://sourceforge.net/projects/smartmontools/files/smartmontools/6.6/smartmontools-6.6.tar.gz
tar zxvf smartmontools-6.6.tar.gz
cd smartmontools-6.6
./configure LDFLAGS="-static"
make
ldd smartctl
scp -p smartctl root@10.10.1.170:
scp -p smartd   root@10.10.1.170:

3. Windows

3.1. Installation

  • Run the smartmontools-7.5.win32-setup.exe file with administrative privileges.

  • Click I Agree.

  • 32-bit Windows: Select Select the type of install | Full.

  • 64-bit Windows: Select Select the type of install | Full (x86_64).

    Select the type of install:     Full            # 32-bit Windows
    Select the type of install:     Full (x86_64)   # 64-bit Windows
  • 32-bit Windows: Make sure the 64-bit version checkbox is unchecked.

  • 64-bit Windows: Make sure the 64-bit version checkbox is checked.

    □ 64-bit version                # 32-bit Windows
    ■ 64-bit version                # 64-bit Windows
    ■ Program files
      ■ smartctl
      ■ smartd
      ■ smartctl-nc (GSmartControl)
      ■ drivedb.h (Drive Database)
    ■ Documentation
    ■ Uninstaller
    ■ Start Menu Shortcuts
    ■ Add install dir to PATH
    □ Add smartctl to drive menu
  • Click Next.

    C:\Program Files\smartmontools
  • Click Install.

  • Optional: Click No to skip replacing the existing configuration file.

  • Optional: Click Yes to restart the SmartD service.

  • Click Close.

3.2. Configuration

Because the configuration of Smartmontools is quite complicated and lengthy it is done automatically by Delta Windows Tools. However, it is possible to look at the configuration using the Windows Control Panel and the smartctl.exe command.

  • Open Control Panel > Administrative Tools > Services or type the services.msc command in a Command Line.

  • Right-click SmartD Service and select Properties.

  • Click OK.

  • Close Services.

Enter the following optional commands at a Command Prompt with administrative privileges.

net start | find /i "smart"
pushd "C:\Program Files\smartmontools\bin"
smartd.exe --help | more
smartctl.exe --help | more
rem smartd.exe remove
rem smartd.exe install -l local0
rem net start smartd
popd

Contents of the C:\Program Files\smartmontools\bin\smartd.conf file.

/dev/sda -n sleep,7,q -H -l error -l selftest \
-s (S/../../[123467]/12|L/../../[5]/12) \
-m <nomailer> -M exec "C:\Program Files\smartmontools\bin\smartd_error.cmd" \
-f -p -u -I 194 -C 197+ -U 198+

3.3. Hard Disk Diagnosis

Enter the following optional commands at a Command Prompt with administrative privileges.

pushd "C:\Program Files\smartmontools\bin"
smartctl.exe --scan
smartctl.exe -a --scan
smartctl.exe -a /dev/sda > nul & echo !ErrorLevel!
smartctl.exe -a /dev/sda
smartctl.exe -a /dev/sda | find "Always"
smartctl.exe -a /dev/sda | find "Pre-fail"
smartctl.exe -a /dev/sda | find "Reallocated_Sector"
popd
pushd "C:\Program Files\smartmontools\bin"
smartctl.exe -i /dev/sda
smartctl.exe -i -r ioctl,2 C:
smartctl.exe --identify C:
rem smartctl.exe -t long /dev/sdd
smartctl.exe -d ata -a /dev/sda
smartctl.exe -a /dev/sda
popd
pushd "C:\Program Files\smartmontools\bin"
smartctl.exe --scan
smartctl.exe --identify /dev/sda
smartctl.exe --identify /dev/csmi0,0
popd