Benutzer-Werkzeuge

Webseiten-Werkzeuge


festplatte-auf-fehler-pruefen

Vorbetrachtung

Immer wieder gibt es Situationen bei denen ein Check der Festplatte sehr sinnvoll erscheint, z.B. nach einen starken Schlag auf die Disk oder nach einen jahrelangen Einsatz. Man kann mit den smartmontools eine Disk sehr detaliert auf Herz und Nieren prüfen.

Installation

Wenn noch nicht installiert dann ggf. nachholen.

# apt-get install smartmontools

Konfigurieren

Damit das Festplattendiagnosetool auch beim Booten selbstständig startet muss man in der Datei /etc/default/samrtmontools bei folgende Zeilen das Kommentarzeichen (#) am Anfang der Zeile entfernen.

 # Defaults for smartmontools initscript (/etc/init.d/smartmontools)
 # This is a POSIX shell fragment
 
 # List of devices you want to explicitly enable S.M.A.R.T. for
 # Not needed (and not recommended) if the device is monitored by smartd
 enable_smart="/dev/sda"
 
 # uncomment to start smartd on system startup
 start_smartd=yes
 
 # uncomment to pass additional options to smartd on startup
 #smartd_opts="--interval=1800"

Bei der Variablen enable_smart tragen wir alle unsere zu überprüfende Festplatten ein, getrennt jeweils durch ein Leerzeichen. start_smartd=yes ermöglicht den Autostart beim Booten des Systems.

Details kann man noch der Konfigurationsdatei /etc/smartd.conf einstellen. Hier braucht allerdings nur eine Zeile angepasst bzw. eingefügt zu werden.

/dev/sda -a -o on -S on -I 194 -W 4,45,55 -R 5 -m michael@localhost -M daily -l error -l selftest

Wobei hier die Option -W interessant ist denn diese Werte geben die Schwellwerte für Disktemperaturen an -W 4,45,55 bedeutet ab einer Temperatur von 45 Grad informiert (an eMail Adresse) wird bzw. 55 Grad (kritischer Wert). Beim erreichen des kritischen Wertes wird dies an den rsyslog-Daemon mit dem Loglevel LOG_CRIT weitergegeben. Der erste Wert 4 bedeutet, das auch beim überschreiten einer Differenez von 4 Grad ebenfalls ein Report erzeugt wird. Um die Option -m zu nutzen muss ein lokaler Mailer (z.B. postfix oder exim) installiert sein. An den angebenen lokalen User (bitte anpassen an eigene Gegebenheiten) werden die Reports versendet.

Informationen zur Disk

Mit der Option -i werden Informationen zur Disk ausgegeben.

# smartctl -i /dev/sda
 smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
 Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
 
=== START OF INFORMATION SECTION ===
 Model Family:     Western Digital Scorpio Blue Serial ATA family
 Device Model:     WDC WD5000BEVT-22ZAT0
 Serial Number:    WD-WX90A89J1580
 Firmware Version: 01.01A01
 User Capacity:    500.107.862.016 bytes
 Device is:        In smartctl database [for details use: -P show]
 ATA Version is:   8
 ATA Standard is:  Exact ATA specification draft version not indicated
 Local Time is:    Sun Oct 10 19:41:43 2010 CEST
 SMART support is: Available - device has SMART capability.
 SMART support is: Enabled

Kurztest einer Disk

Ein kurzen, nur einige Minuten dauernden Test kann man bedenkenlos im laufenden Betrieb durchführen.

# smartctl -t short /dev/sda

Ausführlicher Disktest

Den sogenannten Offlinetest, einen längeren Plattentest, sollte man möglichst am unbelasteten System durchführen.

# smartctl -t offline /dev/sda

Gesundheitszustand der Disk abfragen

Hier wird der sogenannte Health-Status, also Gesundheitszustand, abgefragt. Dieser Status sollte bei einer intakten Platte immer auf PASSED stehen.

# smartctl -H /dev/sda
 smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
 Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

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

== Beispielausgabe von:  smartctl -l selftest /dev/sda ==
 smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
 Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
 
 === START OF READ SMART DATA SECTION ===
 SMART Self-test log structure revision number 1
 Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
 # 1  Short offline       Completed without error       00%      2711         -
 # 2  Short offline       Completed without error       00%      2705         -
 # 3  Short offline       Completed without error       00%      2690         -
 # 4  Short offline       Completed without error       00%      2676         -
 # 5  Short offline       Completed without error       00%      2670         -
 # 6  Short offline       Completed without error       00%      2664         -
 # 7  Short offline       Completed without error       00%      2658         -
 # 8  Short offline       Completed without error       00%      2645         -
 # 9  Short offline       Completed without error       00%      2638         -
 #10  Short offline       Completed without error       00%      2623         -
 #11  Short offline       Completed without error       00%      2611         -
 #12  Short offline       Completed without error       00%      2607         -
 #13  Short offline       Completed without error       00%      2605         -
 #14  Short offline       Completed without error       00%      2593         -
 #15  Short offline       Completed without error       00%      2582         -
 #16  Short offline       Completed without error       00%      2580         -
 #17  Short offline       Completed without error       00%      2544         -
 #18  Short offline       Completed without error       00%      2531         -
 #19  Short offline       Completed without error       00%      2518         -
 #20  Short offline       Completed without error       00%      2509         -
 #21  Short offline       Completed without error       00%      2498         -

Der interessantere nachfolgende Report wird mit der Option -A erzeugt. Diese Option liefert genaue Angaben, wann und wo sich etwas an der Festplatte verändert hat.

Beispielausgabe von: smartctl -A /dev/sda

 smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
 Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
 
 === START OF READ SMART DATA SECTION ===
 SMART Attributes Data Structure revision number: 16
 Vendor Specific SMART Attributes with Thresholds:
 ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
   1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
   3 Spin_Up_Time            0x0027   181   179   021    Pre-fail  Always       -       1925
   4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       404
   5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
   7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
   9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       2724
  10 Spin_Retry_Count        0x0033   100   100   051    Pre-fail  Always       -       0
  11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
  12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       403
 192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       23
 193 Load_Cycle_Count        0x0032   152   152   000    Old_age   Always       -       144213
 194 Temperature_Celsius     0x0022   106   095   000    Old_age   Always       -       41
 196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
 197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
 198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
 199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
 200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0

Weiterführende Informationen

Ubuntuusers: Festplattenstatus

Linux-User 2004: Vorbeugen statt Crash

LinuxJournal 2004: Monitoring Hard Disks with SMART

Wikipedia_en: smartmontools

Wikipedia: S.M.A.R.T

festplatte-auf-fehler-pruefen.txt · Zuletzt geändert: 2020/01/23 17:37 von 127.0.0.1