Wie Image einer beschädigten NTFS-Partition einhängen bzw. reparieren?

Tyl

Ensign
Registriert
Aug. 2015
Beiträge
133
Mit ddrescue erstelle ich derzeit für jemanden ein Image einer beschädigten NTFS-Partition.
Ausgaben SMART, fdisk, Mountversuch, siehe unten.

Windows lässt sich nicht booten, wenn die Festplatte, auf der die Partition liegt angeschlossen ist,
weil Windows vermutlich versucht die Festplatte zu mounten.
Linux bootet ohne Probleme. Mounten lässt sich die Festplatte unter Linux allerdings nicht.

Das mit ddrescue erstellte Teil-Image lässt sich nicht mounten.
Schätzungweise dürfte sich auch nicht das fertige Image ohne Reparatur einhängen lassen.
Probeweise hatte ich mal ein Teilabbild einer fehlerfreien 2GB NTFS-Partition erstellt;
das ließ sich ohne Probleme einhängen und auslesen.


Von dem Teilimage hatte ich schon mal Daten mit foremost und photorec gezogen.
Der große Nachteil ist allerdings,
dass die wiederhergestellten Dateien ihren ursprünglichen Dateinamen verloren haben.

Sollte sich das fertige Image reparieren lassen, sollten sich die Daten inklusive der eigentlichen Dateinamen auslesen lassen.

Daher meine Frage:
Welche Möglichkeiten gibt es das fertige Image zu reparieren, um es dann mounten zu können?

Vielleicht chkdsk?
Allerdings hatte chkdsk schon erfolglos beim Systemstart versucht (auf dem Computer, auf dem die Festplatte ursprünglich lief) das Dateisystem zu reparieren.






fdisk zur Festplatte.

Code:
Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1ER1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 279B3F20-BEBC-4C6D-BF25-E54B6081AF20
 
Device      Start        End    Sectors  Size Type
/dev/sdb1      34     262177     262144  128M Microsoft reserved
/dev/sdb2  264192 3907028991 3906764800  1.8T Microsoft basic data
 
Partition 1 does not start on physical sector boundary.


smartctl gibt besorgniserregendes zu der Festplatte aus.
Der Kurztest musste abgebrochen werden, weil jeweils 10% Rest übrigblieben.


Code:
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.78-1-lts] (local build)

Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org



=== START OF INFORMATION SECTION ===

Model Family:     Seagate Barracuda 7200.14 (AF)

Device Model:     ST2000DM001-1ER164

Serial Number:    W4Z40D7P

LU WWN Device Id: 5 000c50 09d45417a

Firmware Version: CC26

User Capacity:    2,000,398,934,016 bytes [2.00 TB]

Sector Sizes:     512 bytes logical, 4096 bytes physical

Rotation Rate:    7200 rpm

Form Factor:      3.5 inches

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b

SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)

Local Time is:    Tue Jan 19 20:26:57 2021 UTC

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:      (  17)    The self-test routine was aborted by

                    the host.

Total time to complete Offline

data collection:         (   80) 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:      ( 208) minutes.

Conveyance self-test routine

recommended polling time:      (   2) minutes.

SCT capabilities:            (0x1085)    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   116   068   006    Pre-fail  Always       -       105642608

  3 Spin_Up_Time            0x0003   096   096   000    Pre-fail  Always       -       0

  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       219

  5 Reallocated_Sector_Ct   0x0033   097   097   010    Pre-fail  Always       -       3784

  7 Seek_Error_Rate         0x000f   075   060   030    Pre-fail  Always       -       37800416

  9 Power_On_Hours          0x0032   064   064   000    Old_age   Always       -       32054

 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       219

183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0

184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0

187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       65535

188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       3 14 20

189 High_Fly_Writes         0x003a   098   098   000    Old_age   Always       -       2

190 Airflow_Temperature_Cel 0x0022   067   060   045    Old_age   Always       -       33 (Min/Max 17/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       -       38

193 Load_Cycle_Count        0x0032   074   074   000    Old_age   Always       -       53896

194 Temperature_Celsius     0x0022   033   040   000    Old_age   Always       -       33 (0 16 0 0 0)

197 Current_Pending_Sector  0x0012   011   011   000    Old_age   Always       -       14688

198 Offline_Uncorrectable   0x0010   011   011   000    Old_age   Offline      -       14688

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       24109h+21m+11.244s

241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       31054022609

242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       36231945969



SMART Error Log Version: 1

ATA Error Count: 2913 (device log contains only the most recent five errors)

    CR = Command Register [HEX]

    FR = Features Register [HEX]

    SC = Sector Count Register [HEX]

    SN = Sector Number Register [HEX]

    CL = Cylinder Low Register [HEX]

    CH = Cylinder High Register [HEX]

    DH = Device/Head Register [HEX]

    DC = Device Command Register [HEX]

    ER = Error register [HEX]

    ST = Status register [HEX]

Powered_Up_Time is measured from power on, and printed as

DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,

SS=sec, and sss=millisec. It "wraps" after 49.710 days.



Error 2913 occurred at disk power-on lifetime: 32039 hours (1334 days + 23 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 53 00 9e 9a 61 04  Error: UNC at LBA = 0x04619a9e = 73505438



  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 00 01 9e 9a 61 44 00      00:07:11.529  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 00      00:07:11.520  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 00      00:07:11.493  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

  ec 00 00 00 00 00 a0 00      00:07:11.493  IDENTIFY DEVICE

  ef 03 46 00 00 00 a0 00      00:07:11.480  SET FEATURES [Set transfer mode]



Error 2912 occurred at disk power-on lifetime: 32039 hours (1334 days + 23 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 53 00 9b 9a 61 04  Error: UNC at LBA = 0x04619a9b = 73505435



  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 00 01 9e 9a 61 44 00      00:07:07.654  READ FPDMA QUEUED

  60 00 03 9b 9a 61 44 00      00:07:07.653  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 00      00:07:07.644  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 00      00:07:07.617  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

  ec 00 00 00 00 00 a0 00      00:07:07.617  IDENTIFY DEVICE



Error 2911 occurred at disk power-on lifetime: 32039 hours (1334 days + 23 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 53 00 9f 9a 61 04  Error: UNC at LBA = 0x04619a9f = 73505439



  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 00 03 9b 9a 61 44 00      00:07:03.807  READ FPDMA QUEUED

  60 00 01 9e 9a 61 44 00      00:07:03.807  READ FPDMA QUEUED

  60 00 01 9f 9a 61 44 00      00:07:03.806  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 00      00:07:02.860  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 00      00:07:02.833  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]



Error 2910 occurred at disk power-on lifetime: 32039 hours (1334 days + 23 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 53 00 98 9a 61 04  Error: UNC at LBA = 0x04619a98 = 73505432



  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 00 01 9f 9a 61 44 00      00:06:59.095  READ FPDMA QUEUED

  60 00 01 9e 9a 61 44 00      00:06:59.094  READ FPDMA QUEUED

  60 00 03 9b 9a 61 44 00      00:06:59.094  READ FPDMA QUEUED

  60 00 03 98 9a 61 44 00      00:06:59.094  READ FPDMA QUEUED

  60 00 00 b0 08 64 40 00      00:06:59.093  READ FPDMA QUEUED



Error 2909 occurred at disk power-on lifetime: 32039 hours (1334 days + 23 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 53 00 98 9a 61 04  Error: UNC at LBA = 0x04619a98 = 73505432



  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 00 00 b0 08 64 40 00      00:06:55.248  READ FPDMA QUEUED

  60 00 18 98 9a 61 44 00      00:06:55.248  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 00      00:06:55.238  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 00      00:06:55.212  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

  ec 00 00 00 00 00 a0 00      00:06:55.212  IDENTIFY DEVICE



SMART Self-test log structure revision number 1

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error

# 1  Short offline       Aborted by host               10%     32054         -

# 2  Short offline       Aborted by host               10%     32054         -



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.

Mount-Versuche unter Linux:
Code:
[root@sysrescue ~]# mount /dev/sdb2 /mnt/sdb2/
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to calculate free MFT records: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.


[root@sysrescue ~]# mount /dev/sdb /mnt/sdb2/
mount: /mnt/sdb2: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.


[root@sysrescue ~]# mount /mnt/sdd1/st2000.img /mnt/img/
mount: /mnt/img: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error.
[root@sysrescue ~]#
 
Hast
du mal versucht, die Partition als ReadOnly zu mounten? Parameter sollte -ro sein.

Edit: Laut SMART hat die Platten ewig viele wiederzugewiesene sowie ausstehende Sektoren, da wundert es micht nicht, daß auch das Dateisystem schadhaft ist.
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: Tyl und areiland
EDV-Leiter schrieb:
Hast
du mal versucht, die Partition als ReadOnly zu mounten? Parameter sollte -ro sein.

Edit: Laut SMART hat die Platten ewig viele wiederzugewiesene sowie ausstehende Sektoren, da wundert es micht nicht, daß auch das Dateisystem schadhaft ist.


ReadOnly ergibt dieselben Ausgaben.

Code:
[root@sysrescue ~]# mount -o -ro /dev/sdb /mnt/sdb2/
mount: /mnt/sdb2: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

[root@sysrescue ~]# mount -ro /dev/sdb /mnt/sdb2/
mount: /mnt/sdb2/: can't find in /etc/fstab.

[root@sysrescue ~]# mount  /dev/sdb /mnt/sdb2/
mount: /mnt/sdb2: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

[root@sysrescue ~]# mount -o -ro /dev/sdb2 /mnt/sdb2/
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to calculate free MFT records: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

[root@sysrescue ~]# mount -o -ro /dev/sdb1 /mnt/sdb2/
mount: /mnt/sdb2: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
[root@sysrescue ~]#



Was sind möglichen Ursachen "ewig viele wiederzugewiesene sowie ausstehende Sektoren"?
 
Mit welchen Parametern läuft ddrescue überhaupt? Ich hoffe du lässt die fehlerhaften Sektoren erstmal aus um nicht noch mehr Schaden anzurichten?

Tyl schrieb:
Welche Möglichkeiten gibt es das fertige Image zu reparieren, um es dann mounten zu können?
Ich würde da gar nichts an dem Image reparieren! Wenn überhaupt etwas versucht wird, nur an einer Kopie davon.
Zur Datenrettung würde ich entweder GetDataBack Pro oder R-Studio nehmen, welche beide ein Image laden können (sofern du in Windows unterwegs bist)

Tyl schrieb:
Vielleicht chkdsk?
Keinesfalls! Man lässt chkdsk nie auf eine defekte Platte los.

Tyl schrieb:
Allerdings hatte chkdsk schon erfolglos beim Systemstart versucht (auf dem Computer, auf dem die Festplatte ursprünglich lief) das Dateisystem zu reparieren.
Zu spät.

Tyl schrieb:
Was sind möglichen Ursachen "ewig viele wiederzugewiesene sowie ausstehende Sektoren"?

Einerseits die übliche Ignoranz bzw. Unwissenheit bzgl. SMART Werten und der zweite Grund steht in der 11. Zeile von smartctl ;) Dazu kommt noch die hohe Laufzeit dieser Platte.
Es ist die kleine Schwester der ST3000DM001 und das sagt eigentlich alles.
Ab dem ersten Lesefehler hätte man sowieso schon aktiv werden müssen und die Daten unverzüglich sichern.

Ich kann mir auch kaum vorstellen, dass chkdsk nur einmal auf dieser Platte gelaufen ist. Allein das sollte schon eine Warnung sein.

Hätte der jemand natürlich ein Backup gehabt und sich vielleicht mal wenigstens einmal pro Woche SMART Werte angeschaut, hätte das Ihm und dir viel Stress und Zeit erspart.

Leider sind meine Linux Kenntnisse knapp über Null angesiedelt, also kann ich nichts zum Thema mounten sagen.
Vielleicht hilft dir aber das etwas:
https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/
 
  • Gefällt mir
Reaktionen: Tyl
Fusionator schrieb:
Mit welchen Parametern läuft ddrescue überhaupt? Ich hoffe du lässt die fehlerhaften Sektoren erstmal aus um nicht noch mehr Schaden anzurichten?

Ohne den -r Parameter. Ich habe das so verstanden, dass bei einem Lesefehler ddrescue zum nächsten Sektor geht. Hat man aber bspw. den Parameter -r3, dann versucht ddrescue die Stelle 3 mal zu lesen.

Fusionator schrieb:
Ich würde da gar nichts an dem Image reparieren! Wenn überhaupt etwas versucht wird, nur an einer Kopie davon.
Zur Datenrettung würde ich entweder GetDataBack Pro oder R-Studio nehmen, welche beide ein Image laden können (sofern du in Windows unterwegs bist)

Ich hatte schon gestern eine Kopie des fast fertigen Image angelegt. Leider sind mir die gegebenen 2TB Festplatten minimal zu klein. Heute werde ich das Image auf eine neue 6TB Festplatte ziehen. Geplant habe ich auf der 6TB zwei Partitionen anzulegen und auf beiden das Image zu vervollständigen.
Sollte das ordentliche Mounten nicht klappen, weil sich das Image nicht reparieren lässt, werde ich die Daten mit Photorec auslesen. Hatte ich schon probeweise versucht, ging ohne Probleme. Leider bleibt dabei der ursprüngliche Dateiname nicht erhalten.

Fusionator schrieb:
Keinesfalls! Man lässt chkdsk nie auf eine defekte Platte los.

Es geht nur um das Image. Backup des Image wird vorhanden sein. Anscheinend muss das irgendwie gehen. Siehe hier: https://wiki.archlinux.org/index.php/File_recovery#Using_QEMU_to_repair_NTFS
Dort wird das mit QEMU unter Linux vorgeschlagen.

Fusionator schrieb:
Leider sind meine Linux Kenntnisse knapp über Null angesiedelt, also kann ich nichts zum Thema mounten sagen.
Vielleicht hilft dir aber das etwas:
https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/

Danke, Werde ich probieren.
 
Fusionator schrieb:
EDV-Leiter schrieb:

Eine kurze Rückmeldung:

Nachdem ddrescue in der "scraping"-Phase (pass 5) ankam, wurde es sehr langsam und deshalb unterbrach ich das Programm.

Unter Linux ließ sich die erstellte Image-Datei problemlos mounten. Alle Daten waren zwar nicht verfügbar in dem Image, aber die wichtigsten Daten konnte ich inklusive des Dateinamens und der Ordnerstruktur sichern.
 
Zurück
Oben