Overvågning er vigtig hvis man vil sikre sine data, specielt kritisk er det at vide hvordan ens diske har det.
Til dette formål findes SmortMonTools

Installering af SmartMonTools er nem og hurtig.

apt-get install smartmontools

Herefter skal man sikre at ens diske understøtter S.M.A.R.T og dette er enabled.
Denne LinuxServer har 2 Sata diske, derfor køre jeg

smartctl -a /dev/sda

smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Momentus 5400.3
Device Model:     ST9120822AS
Serial Number:    5RM0P9MJ
Firmware Version: 3.ALC
User Capacity:    120.034.123.776 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon May 10 18:36:16 2010 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                 ( 426) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        No General Purpose Logging support.
Short self-test routine
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 111) minutes.
SCT capabilities:              (0x0001) SCT Status supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   105   100   006    Pre-fail  Always       -       8715641
  3 Spin_Up_Time            0x0003   099   099   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       697
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   073   060   030    Pre-fail  Always       -       22244561
  9 Power_On_Hours          0x0032   096   096   000    Old_age   Always       -       3935
 10 Spin_Retry_Count        0x0013   100   100   034    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       225
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   071   057   045    Old_age   Always       -       29 (Lifetime Min/Max 24/29)
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       220
193 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       537324
194 Temperature_Celsius     0x0022   029   043   000    Old_age   Always       -       29 (0 20 0 0)
195 Hardware_ECC_Recovered  0x001a   067   062   000    Old_age   Always       -       56797568
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0
202 TA_Increase_Count       0x0032   100   253   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%      3575         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

 det samme gøres naturligvis også for sdb, hvilket forhåbentlig giver det samme output.

smartctl -a /dev/sdb

For at få servicen til at køre skal der tilpasset lidt i /etc/default/smartmontools

 vi /etc/default/smartmontools

# uncomment to start smartd on system startup
start_smartd=yes

# uncomment to pass additional options to smartd on startup
smartd_opts="--interval=1800"

Herefter bør man kigge forbi /etc/smartd.conf og sikre at smartmontools sender emails til en konto som overvåget, gør man ikke noget er det Root som vil modtage emails.

 vi /etc/smartd.conf

# The word DEVICESCAN will cause any remaining lines in this
# configuration file to be ignored: it tells smartd to scan for all
# ATA and SCSI devices.  DEVICESCAN may be followed by any of the
# Directives listed below, which will be applied to all devices that
# are found.  Most users should comment out DEVICESCAN and explicitly
# list the devices that they wish to monitor.
DEVICESCAN -m This email address is being protected from spambots. You need JavaScript enabled to view it. -M exec /usr/share/smartmontools/smartd-runner

Tilsidst start smartmontools

/etc/init.d/smartmontools start

Herefter skulle man gerne se noget a'la dette i syslog

tail -n45 /var/log/syslog


May 10 18:35:48 LinuxServer smartd[2909]: smartd version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
May 10 18:35:48 LinuxServer smartd[2909]: Home page is http://smartmontools.sourceforge.net/#012
May 10 18:35:48 LinuxServer smartd[2909]: Opened configuration file /etc/smartd.conf
May 10 18:35:48 LinuxServer smartd[2909]: Drive: DEVICESCAN, implied '-a' Directive on line 22 of file /etc/smartd.conf
May 10 18:35:48 LinuxServer smartd[2909]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
May 10 18:35:48 LinuxServer smartd[2909]: Problem creating device name scan list
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sda, opened
May 10 18:35:48 LinuxServer smartd[2909]: Device /dev/sda: using '-d sat' for ATA disk behind SAT layer.
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sda, opened
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sda, found in smartd database.
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sda, is SMART capable. Adding to "monitor" list.
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sdb, opened
May 10 18:35:48 LinuxServer smartd[2909]: Device /dev/sdb: using '-d sat' for ATA disk behind SAT layer.
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sdb, opened
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sdb, found in smartd database.
May 10 18:35:48 LinuxServer smartd[2909]: Device: /dev/sdb, is SMART capable. Adding to "monitor" list.
May 10 18:35:48 LinuxServer smartd[2909]: Monitoring 0 ATA and 2 SCSI devices
May 10 18:35:48 LinuxServer smartd[2912]: smartd has fork()ed into background mode. New PID=2912.
May 10 18:35:48 LinuxServer smartd[2912]: file /var/run/smartd.pid written containing PID 2912
May 10 18:41:00 LinuxServer smartd[2912]: smartd received signal 15: Terminated
May 10 18:41:00 LinuxServer smartd[2912]: smartd is exiting (exit status 0)
May 10 18:41:00 LinuxServer smartd[2941]: smartd version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
May 10 18:41:00 LinuxServer smartd[2941]: Home page is http://smartmontools.sourceforge.net/#012
May 10 18:41:00 LinuxServer smartd[2941]: Opened configuration file /etc/smartd.conf
May 10 18:41:00 LinuxServer smartd[2941]: Drive: DEVICESCAN, implied '-a' Directive on line 22 of file /etc/smartd.conf
May 10 18:41:00 LinuxServer smartd[2941]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
May 10 18:41:00 LinuxServer smartd[2941]: Problem creating device name scan list
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sda, opened
May 10 18:41:00 LinuxServer smartd[2941]: Device /dev/sda: using '-d sat' for ATA disk behind SAT layer.
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sda, opened
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sda, found in smartd database.
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sda, is SMART capable. Adding to "monitor" list.
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sdb, opened
May 10 18:41:00 LinuxServer smartd[2941]: Device /dev/sdb: using '-d sat' for ATA disk behind SAT layer.
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sdb, opened
May 10 18:41:00 LinuxServer smartd[2941]: Device: /dev/sdb, found in smartd database.
May 10 18:41:01 LinuxServer smartd[2941]: Device: /dev/sdb, is SMART capable. Adding to "monitor" list.
May 10 18:41:01 LinuxServer smartd[2941]: Monitoring 0 ATA and 2 SCSI devices
May 10 18:41:02 LinuxServer smartd[2943]: smartd has fork()ed into background mode. New PID=2943.
May 10 18:41:02 LinuxServer smartd[2943]: file /var/run/smartd.pid written containing PID 2943