====== Smartmontools ====== Mit "smartmontools" können die S.M.A.R.T. (**S**elf-**M**onitoring, **A**nalysis and **R**eporting **T**echnology) Informationen auslesen und Festplatten getestet werden. Die ausführlichen Prüfungen mit "smartmontools" **funktionieren** auf externen USB-Platten **nicht**. ===== Installation ===== Unter Ubuntu installiert man die Tools wie folgt: apt-get install smartmontools Nun kann mit dem Befehl ''smartctl'' die Festplatte überprüft werden. Der Befehl ''smartd'', welcher mit installiert wird, ist ein Daemon. Dieser Daemon kann die Festplatte regelmäßig prüfen und ggf. den User benachrichtigen. ===== Voraussetzungen ===== Um eine Festplatte prüfen zu können, muss SMART auf dieser und im BIOS aktiviert sein. Dies kann man mit diesem Befehl beauskunften: smartctl -i /dev/sda Die Ausgabe sollte etwa so aussehen: === START OF INFORMATION SECTION === Model Family: Western Digital Scorpio Blue Serial ATA Device Model: WDC WD1600BEVT-00A23T0 Serial Number: XX-XXXXXXXXXXXXXXXX LU WWN Device Id: 5 0014ee 2592650b1 Firmware Version: 01.01A01 User Capacity: 160.041.885.696 bytes [160 GB] Sector Size: 512 bytes logical/physical 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: Tue Jan 29 07:30:43 2013 CET SMART support is: Available - device has SMART capability. SMART support is: Enabled Interessant sind hier die letzten beiden Zeilen. Diese besagen dass die Festplatte SMART-fähig ist und der SMART-Support auch eingeschaltet/verfügbar ist. Wenn hier der "SMART support" "Disabled" ist, dann kann dies wie folgt eingeschaltet werden (IM BIOS muss es aber aktiv sein): smartctl -s on /dev/sda ===== Prüfvorgänge ===== Verschiedene Prüfungen können mit SMART gemacht werden. Manche sind ausführlicher und dauern dadurch länger, manche wiederum sind kurze Prüfungen mit weniger Information. Oft sind aber auch die kurzen Prüfungen schon aussagekräftig, wenn die Festplatte Fehler hat. ==== Standardprüfung ==== smartctl -H /dev/sda Beispiel Festplatte OK. === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED Beispiel Festplatte hat Sector-Fehler. === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: FAILED! Drive failure expected in less than 24 hours. SAVE ALL DATA. Failed Attributes: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 5 Reallocated_Sector_Ct 0x0033 130 130 140 Pre-fail Always FAILING_NOW 554 ==== erweiterte Prüfung ==== smartctl -A /dev/sda Beispiel Festplatte OK. === 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 0x000b 100 100 016 Pre-fail Always - 0 2 Throughput_Performance 0x0005 132 132 054 Pre-fail Offline - 112 3 Spin_Up_Time 0x0007 131 131 024 Pre-fail Always - 348 (Average 299) 4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 49 5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0 7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0 8 Seek_Time_Performance 0x0005 123 123 020 Pre-fail Offline - 34 9 Power_On_Hours 0x0012 098 098 000 Old_age Always - 19756 10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 49 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 100 193 Load_Cycle_Count 0x0012 100 100 000 Old_age Always - 100 194 Temperature_Celsius 0x0002 157 157 000 Old_age Always - 38 (Min/Max 20/49) 196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0 197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0 Beispiel Festplatte hat Sector-Fehler. === 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 153 152 021 Pre-fail Always - 1341 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 25 5 Reallocated_Sector_Ct 0x0033 130 130 140 Pre-fail Always FAILING_NOW 554 7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 1 9 Power_On_Hours 0x0032 071 071 000 Old_age Always - 21814 10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0 11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 23 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 15 193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 4186209 194 Temperature_Celsius 0x0022 115 100 000 Old_age Always - 28 196 Reallocated_Event_Count 0x0032 183 183 000 Old_age Always - 17 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 0x0008 100 253 000 Old_age Offline - 0 ^ Spaltenname ^ Beschreibung ^ | **ATTRIBUTE_NAME** | beschreibt die untersuchte Eigenschaft | |**VALUE** | beschreibt den gemessenen Wert | |**WORST** | beschreibt den schlechtesten jemals gemessenen Wert | |**THRESH** | beschreibt den Wert, ab dem Besorgnis gelten sollte | ==== gründliche Prüfung ==== Bei diesem Test wird die Festplattengeometrie und auch die Mechanik geprüft. Die Prüfungen können als "kurz" und als "lang" angeworfen werden. smartctl -c /dev/sda Beispiel Ausgabe: === START OF READ SMART DATA SECTION === General SMART Values: Offline data collection status: (0x84) Offline data collection activity was suspended by an interrupting command from host. 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: ( 7061) 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. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 118) minutes. SCT capabilities: (0x003d) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported. Hier sieht man z.B. dass die "Short self-test routine" ca. 1 Minute und die "Extended self-test routine" ca. 118 Minuten dauern würde. So startet man die Prüfungen: smartctl -t short /dev/sda oder smartctl -t long /dev/sda Ausgabe könnte so aussehen: === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 1 minutes for test to complete. Test will complete after Tue Jan 29 08:00:18 2013 Use smartctl -X to abort test. Die Ergebnisse der Prüfungen werden dabei in eine Log-Datei geschrieben. So ruft man die Ergebnisse ab: smartctl -l selftest /dev/sda Beispiel Festplatte OK. === 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% 19756 - Hier noch ein Screenshot einer defekten Festplatte: {{::bildschirmfoto_vom_2013-12-26_14_26_16.png?200|defekte Festplatte}} Man sieht das recht viele prüfungen fehlgeschlagen sind. Die Festplatte wurde immer langsamer. Beim Booten hat es ewig gedauert bis alles geladen wurde.