Manuelles Reparieren defekter Sektoren mittels hdparm
Update:
Hatte die Diskstation abgeschaltet, bis die neue HDD angekommen ist. Problem nun: Mein Volume ist weg. HDD wird nachwievor angezeigt, aber das Volume hat sich verabschiedet. Ich konnte das Problem folgendermassen lösen, vielleicht hilft es jemandem mal:
Folgendes habe ich dann zur Problemlösung getan: (Ich gebe die Commands an, die ICH benutzt habe, im konkreten Fall musst du sie für DICH anpassen!)
Schritt 1) Remote Login mittels SSH als root in die Diskstation
Schritt 2) Diagnostik der Festplatte mittels dem Tool
smartctl (hier mit Auszügen aus der Bildschirmausgabe). Bei mir handelt es sich bei der Festplatte um /dev/sda. Falls ihr mehrere Festplatten verbaut habt müsst ihr natürlich die richtige Festplatte angeben, wie z.b /dev/sdb, /dev/sdc etc.!
Rich (BBCode):
DiskStation> smartctl -a -d sat -T permissive /dev/sda
Wie wir sehen haben sich die RAW errors erhöht. (Im folgenden Auszug aus der Bildschirmausgabe von smartctl)
Rich (BBCode):
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 195 195 051 Pre-fail Always - 208
3 Spin_Up_Time 0x0027 222 196 021 Pre-fail Always - 7875
4 Start_Stop_Count 0x0032 092 092 000 Old_age Always - 8589
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 089 089 000 Old_age Always - 8593
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 092 092 000 Old_age Always - 8132
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 17
193 Load_Cycle_Count 0x0032 198 198 000 Old_age Always - 8585
194 Temperature_Celsius 0x0022 119 113 000 Old_age Always - 33
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 0x0008 200 200 000 Old_age Offline - 0
Im Folgenden sehen wir den Grund für die Erhöhung, nämlich ein fehlerhafter Sektor 9453290, der zu den vielen raw read errors führt (dies immer noch Auszug aus smartctl).
Unklar ist mir, warum der Sektor nicht automatisch repariert/re-alloziert wurde! Der reallocated_sector_ct Zähler steht nämlich auf 0. Aber offenbar liegt hier der Grund für die ganze Problematik und dafür, dass die Synology nicht von der HDD starten kann.
Rich (BBCode):
Error 54 occurred at disk power-on lifetime: 8585 hours (357 days + 17 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 08 ea 3e 90 e0 Error: UNC 8 sectors at LBA = 0x00903eea = 9453290
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 e8 3e 90 e0 00 00:00:05.156 READ DMA
ec 00 00 00 00 00 a0 0a 00:00:05.129 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 0a 00:00:05.129 SET FEATURES [Set transfer mode]
Error 53 occurred at disk power-on lifetime: 8585 hours (357 days + 17 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 08 ea 3e 90 e0 Error: UNC 8 sectors at LBA = 0x00903eea = 9453290
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 e8 3e 90 e0 00 00:00:04.527 READ DMA
ec 00 00 00 00 00 a0 0a 00:00:04.500 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 0a 00:00:04.500 SET FEATURES [Set transfer mode]
Error 52 occurred at disk power-on lifetime: 8585 hours (357 days + 17 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 08 ea 3e 90 e0 Error: UNC 8 sectors at LBA = 0x00903eea = 9453290
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 e8 3e 90 e0 00 00:00:03.898 READ DMA
ec 00 00 00 00 00 a0 0a 00:00:03.870 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 0a 00:00:03.870 SET FEATURES [Set transfer mode]
[...]
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 40% 8568 9453290
# 2 Short offline Completed without error 00% 8568 -
# 3 Extended offline Completed: read failure 90% 8543 9453290
# 4 Short offline Aborted by host 10% 8542 -
# 5 Short offline Completed: read failure 40% 8496 9453290
# 6 Short offline Completed: read failure 40% 8474 9453290
# 7 Short offline Completed without error 00% 8400 -
# 8 Short offline Completed without error 00% 8334 -
# 9 Short offline Completed without error 00% 8321 -
#10 Short offline Completed without error 00% 8288 -
#11 Short offline Completed without error 00% 8265 -
#12 Short offline Completed without error 00% 8258 -
#13 Short offline Completed without error 00% 8235 -
#14 Short offline Completed without error 00% 8209 -
#15 Short offline Completed without error 00% 8202 -
#16 Short offline Completed without error 00% 8172 -
#17 Short offline Completed without error 00% 8150 -
#18 Short offline Completed without error 00% 8143 -
#19 Short offline Completed without error 00% 8105 -
#20 Short offline Completed without error 00% 8052 -
#21 Short offline Completed without error 00% 8038 -
Schritt 3) Versuch den Sektor zu lesen mittels dem Tool hdparm
Rich (BBCode):
DiskStation> hdparm --read-sector 9453290 /dev/sda
/dev/sda:
reading sector 9453290: FAILED: Input/output error
Auch die angrenzenden Sektoren erwiesen sich als unlesbar. Erst Sektoren 9453289 unten und 9453296 oben waren wieder lesbar.
Schritt 4) Manuelles Re-Allozieren der fünf fehlerhaften Sektoren 9453290 bis 9453295, ebenfalls mit dem tool hdparm
(ACHTUNG! AUF EIGENE GEFAHR! ES DROHT TOTALVERLUST ALLER DATEN BEI FEHLERHAFTER VERWENDUNG! BACKUP BACKUP BACKUP!!)
(ACHTUNG! Alle Daten auf dem Sektor werden überschrieben! Es lässt sich nicht rückgängig machen!)
Damit der write-sector command funktioniert, muss man untenstehendes "Ich weiss was ich tue" Argument noch mitangeben. Ich lasse es absichtlich weg damit man nicht blind copy-pasten kann!! Nach --write-sector müsst ihr natürlich analog zum --read-sector command die Nummer eures Sektors angeben, in meinem Fall also 9453290. Ich lasse es ebenso weg, damit das niemand blind copy-pastet! Und auch /dev/sda muss natürlich für eure Harddrive stimmen, falls ihr mehrere HDD verbaut habt!
Rich (BBCode):
DiskStation> hdparm --write-sector Sektornummer Festplattenbezeichnung
Use of --write-sector is VERY DANGEROUS.
You are trying to deliberately overwrite a low-level sector on the media.
This is a BAD idea, and can easily result in total data loss.
Please supply the --yes-i-know-what-i-am-doing flag if you really want this.
In meinem Fall lautete der Befehl wie folgt (Screenshot, damit man es nicht blind copy pasten kann):
Dies habe ich in dieser Weise für die fünf Sektoren 9453290 bis 9453295 gemacht.
Schritt 5) Reboot der Diskstation
Schritt 6) Volume funktioniert wieder! SMART-Test fehlerfrei, sowohl Quick-Test als auch Extended-Test geben nun 0 Fehler an! Die RAW-Errors sind ebenso wieder auf 0!
Warum die fehlerhaften Sektoren nicht automatisch repariert worden sind, weiss ich nicht.
Ich werde die Platte nun probatorisch so weiter laufen lassen. Sie läuft im RAID1-Verbund mit einem Offline-Backup.
Ich hoffe es hilft irgendwann mal jemandem!
Viele Grüsse
Yil
PS: NUR mit Backup machen! Ich hafte für gar nix!