Home / Linux / Debian / QuickTipp: S.M.A.R.T Status einer Festplatte abfragen – SMART Log erstellen
S.M.A.R.T Status

QuickTipp: S.M.A.R.T Status einer Festplatte abfragen – SMART Log erstellen

So wird der S.M.A.R.T Status unter Linux mit Hilfe der smartmontools abgefragt und ein SMART Log erstellt.

SMART (Self-Monitoring, Alanysis and Reporting Technology) wird in Festplatten verwendet um die wichtigsten Parameter zu überwachen, sodass im Vorfeld Probleme erkannt werden können. Der S.M.A.R.T Wert liefert somit wichtige Informationen über den Gesundheitszustand der Festplatten. Auf Wikipedia.org gibt es eine detaillierte Auflistung der SMART Parameter.

Smartmontools installieren

Die Smartmontools sind so ziemlich in jeder Linux Distribution verankert und können bequem über die Paketverwaltung installiert werden. Mit dem Programm smartctl kann man den S.M.A.R.T Status seiner Festplatten abfragen. Falls das smartctl Tool (im Meta-Paket smartmontools enthalten) noch nicht installiert ist, sollte das nun nachgeholt werden:

Debian:

[bash]apt-get install smartmontools[/bash]

CentOS:

[bash]yum install smartmontools[/bash]

Mit folgendem Befehl wird der S.M.A.R.T Status der Festplatten abgefragt:

Der Quick Check wird folgendermaßend durchgeführt (Das Ergebnis ist Passed oder Failed):

[bash]smartctl -H /dev/sda[/bash]

SMART Check Test: „PASSED“ Ausgabe:

[bash highlight=“5″]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[/bash]

Wenn der SMART Check bei beiden Festplatten mit „PASSED“ abgeschlossen wird kann man davon ausgehen, dass die Festplatten in Ordnung sind. Die Festplatte kann somit noch einmal für den Sync verwendet werden und muss nicht getauscht werden.

SMART Check Test: „failed“ Ausgabe:

[bash highlight=“4″]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

Log Sense failed, IE page [scsi response fails sanity test][/bash]

Schlägt der Smart Check fehl, dann sollte die Festplatte als defekt angesehen werden und es ist dringend empfohlen diese durch eine neue Platte auszutauschen.

Günstige Festplatten gibt es bei Amazon.de*

Festplatten Informationen anzeigen lassen

Mit folgendem Befehl kann man sich detaillierte Informationen über die verwendete Festplatte anzeigen lassen:

[bash]smartctl -i /dev/sda1[/bash]

Ausgabe:

[bash]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 ===
Device Model: ST3000DM001-9YN166
Serial Number: Z1F1B624
Firmware Version: CC4B
User Capacity: 3,000,592,982,016 bytes
Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Thu Jul 25 13:15:21 2013 CEST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled[/bash]

Detaillierten SMART Log erstellen

[bash]smartctl -A /dev/sda -x[/bash]

SMART Test durchführen

Das Tool smartctl kann dazu genutzt werden einen Selbsttest der Festplatte auszuführen. Hierfür gibt es zwei Optionen. „–test=short“ und „–test=long“. Der kurze Test dauert eine Minute und der längere Test je nach Festplattengröße bis zu mehreren Stunden und sollte nur unter wenig Last durchgeführt werden.

Short Test für Festplatte sda1 starten

[bash]smartctl –test=short /dev/sda1[/bash]

Ausgabe:

[bash]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 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 Thu Jul 25 11:30:43 2013

Use smartctl -X to abort test.[/bash]

Wenn die Minute vorüber ist, kann das Testergebnis abgefragt werden:

[bash]smartctl -a /dev/sda1[/bash]

Ausgabe:

[bash]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 ===
Device Model: ST3000DM001-9YN166
Serial Number: Z1F1B624
Firmware Version: CC4B
User Capacity: 3,000,592,982,016 bytes
Device is: In smartctl database [for details use: -P showall] ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Thu Jul 25 11:34:35 2013 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: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
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: ( 584) seconds.
Offline data collection
capabilities: (0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
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: ( 255) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3085) 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 112 100 006 Pre-fail Always – 42794360
3 Spin_Up_Time 0x0003 093 093 000 Pre-fail Always – 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always – 9
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always – 0
7 Seek_Error_Rate 0x000f 077 060 030 Pre-fail Always – 54077906
9 Power_On_Hours 0x0032 094 094 000 Old_age Always – 5750
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always – 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always – 9
183 Runtime_Bad_Block 0x0032 099 099 000 Old_age Always – 1
184 End-to-End_Error 0x0032 100 100 099 Old_age Always – 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always – 0
188 Command_Timeout 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 068 050 045 Old_age Always – 32 (Lifetime Min/Max 30/34)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always – 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always – 6
193 Load_Cycle_Count 0x0032 087 087 000 Old_age Always – 27833
194 Temperature_Celsius 0x0022 032 050 000 Old_age Always – 32 (0 20 0 0)
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
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline – 277356103078626
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline – 10752438510457
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline – 48531878217758

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 Short offline Completed without error 00% 5750 –
# 2 Extended offline Completed without error 00% 5 –

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.[/bash]

3.7/5 - (6 votes)

Auch cool

Linux richtig anwenden: Tipps und Tricks für eine optimale Erfahrung

Die Kombination aus Spiele-Plattformen, und dem Betriebssystem Linux mag auf den ersten Blick ungewöhnlich erscheinen. …