如何从损坏的硬盘修复损坏的HFS +分区?


8

我有一个带有HFS+分区的朋友的Mac OS X磁盘。我应该从该磁盘恢复个人数据,但我不确定文件系统是否损坏或磁盘快要死了。


背景:完整症状如下。该驱动器已被Linux识别,甚至可以自动挂载(Xfce在此处使用):

liv@liv-HP-Compaq-dc7900:~$ cat /etc/mtab | grep -i hfs
/dev/sdb2 /media/Macintosh\040HD hfsplus ro,nosuid,nodev,uhelper=udisks 0 0

内核报告以下内容:

[ 4382.681310] usb 2-5: USB disconnect, device number 2
[ 4390.104044] usb 2-5: new high-speed USB device number 3 using ehci_hcd
[ 4390.259178] Initializing USB Mass Storage driver...
[ 4390.259983] scsi6 : usb-storage 2-5:1.0
[ 4390.260077] usbcore: registered new interface driver usb-storage
[ 4390.260079] USB Mass Storage support registered.
[ 4391.260684] scsi 6:0:0:0: Direct-Access     ASMT     2105             0    PQ: 0 ANSI: 6
[ 4391.261346] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 4391.494924] sd 6:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/232 GiB)
[ 4391.495668] sd 6:0:0:0: [sdb] Write Protect is off
[ 4391.495672] sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 4391.496551] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 4391.560091]  sdb: sdb1 sdb2
[ 4391.565039] sd 6:0:0:0: [sdb] Attached SCSI disk
[..]
[10376.614742] hfs: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended.  mounting read-only.
[10380.531230] sd 6:0:0:0: [sdb] Unhandled sense code
[10380.531234] sd 6:0:0:0: [sdb]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE
[10380.531239] sd 6:0:0:0: [sdb]  Sense Key : Medium Error [current] 
[10380.531243] sd 6:0:0:0: [sdb]  Add. Sense: Unrecovered read error
[10380.531253] sd 6:0:0:0: [sdb] CDB: Read(10): 28 00 00 1e 22 e8 00 00 08 00
[10380.531259] end_request: critical target error, dev sdb, sector 1975016
[10380.531264] Buffer I/O error on device sdb2, logical block 195672
[10384.353981] sd 6:0:0:0: [sdb] Unhandled sense code
[10384.353985] sd 6:0:0:0: [sdb]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE
[10384.353990] sd 6:0:0:0: [sdb]  Sense Key : Medium Error [current] 
[10384.353995] sd 6:0:0:0: [sdb]  Add. Sense: Unrecovered read error
[10384.354004] sd 6:0:0:0: [sdb] CDB: Read(10): 28 00 00 1e 22 e8 00 00 08 00
[10384.354011] end_request: critical target error, dev sdb, sector 1975016
[10384.354015] Buffer I/O error on device sdb2, logical block 195672

这是来自的相关输出lshw

 *-scsi
      physical id: 3
      bus info: usb@2:5
      logical name: scsi7
      capabilities: emulated scsi-host
      configuration: driver=usb-storage
    *-disk
         description: SCSI Disk
         product: 2105
         vendor: ASMT
         physical id: 0.0.0
         bus info: scsi@7:0.0.0
         logical name: /dev/sdb
         version: 0
         serial: 00000000000000000000
         size: 232GiB (250GB)
         capabilities: gpt-1.00 partitioned partitioned:gpt
         configuration: ansiversion=6 guid=6b43402b-9887-4a33-a329-9801b59ccdc7
       *-volume:0
            description: Windows FAT volume
            vendor: BSD  4.4
            physical id: 1
            bus info: scsi@7:0.0.0,1
            logical name: /dev/sdb1
            version: FAT32
            serial: 70d6-1701
            size: 199MiB
            capacity: 199MiB
            capabilities: boot fat initialized
            configuration: FATs=2 filesystem=fat label=EFI name=EFI System Partition
       *-volume:1
            description: Apple HFS partition
            vendor: Mac OS X (fsck)
            physical id: 2
            bus info: scsi@7:0.0.0,2
            logical name: /dev/sdb2
            version: 4
            serial: d9a741cc-8313-cc78-0000-000000800000
            size: 232GiB
            capabilities: journaled bootable osx hfsplus initialized
            configuration: boot=osx checked=2009-09-24 02:29:07 created=2009-09-23 17:29:07 filesystem=hfsplus lastmountedby=fsck modified=2013-11-03 01:02:00 name=Customer state=unclean

当我打开驱动器时Thunar,收到以下错误消息:("Failed to open directory "Macintosh HD". Error when getting information for file '/media/Macintosh HD/.journal': Input/output error."但是,如果使用,我可以访问安装点和一些子目录emelFM2)。

在此处输入图片说明

如果尝试ls安装点,则会遇到很多I / O错误:

liv@liv-HP-Compaq-dc7900:/media/Macintosh HD$ ls -lha
ls: cannot access .hotfiles.btree: Input/output error
ls: cannot access .journal: Input/output error
ls: cannot access .journal_info_block: Input/output error
ls: cannot access .Spotlight-V100: Input/output error
ls: cannot access .Trashes: Input/output error
ls: cannot access home: Input/output error
ls: cannot access libpeerconnection.log: Input/output error
ls: cannot access net: Input/output error
ls: reading directory .: Input/output error
total 20M
drwxrwxr-t 1 root   80   35 Oct 13 22:56 .
drwxr-xr-x 3 root root 4.0K Jan 16 21:09 ..
drwxrwxr-x 1 root   80   53 Oct 18 22:07 Applications
drwxr-xr-x 1 root root   39 Sep 26 00:51 bin
drwxrwxr-t 1 root   80    2 Jul  9  2009 cores
dr-xr-xr-x 1 root root    2 Jul  9  2009 dev
-rw-rw-r-- 1  501   80  16K Sep  8 14:19 .DS_Store
lrwxr-xr-x 1 root root   11 Sep 24  2009 etc -> private/etc
---------- 1 root   80    0 Jul  9  2009 .file
drwx------ 1   99   99  246 Nov  3 00:29 .fseventsd
lrwxr-xr-x 1 root   80   60 Mar 20  2010 Guides de l’utilisateur et informations -> /Library/Documentation/User Guides and Information.localized
dr-xr-xr-t 1 root root    2 Sep 24  2009 .HFS+ Private Directory Data?
d????????? ? ?    ?       ?            ? home
-????????? ? ?    ?       ?            ? .hotfiles.btree
-????????? ? ?    ?       ?            ? .journal
-????????? ? ?    ?       ?            ? .journal_info_block
-????????? ? ?    ?       ?            ? libpeerconnection.log
drwxrwxr-t 1 root   80   58 Mar 27  2013 Library
drwxrwxrwt 1 root root    4 Sep 18  2012 lost+found
-rw-r--r-- 1 root root  20M Jun  8  2011 mach_kernel
d????????? ? ?    ?       ?            ? net
drwxr-xr-x 1 root root    2 Jul  9  2009 Network
drwxr-xr-x 1  501   80    3 Oct 26  2010 opt
drwxr-xr-x 1 root root    6 Sep 24  2009 private
drwxr-xr-x 1 root root   67 Sep 26 00:52 sbin
d????????? ? ?    ?       ?            ? .Spotlight-V100
drwxr-xr-x 1 root root    4 Jul  3  2011 System
lrwxr-xr-x 1 root root   11 Sep 24  2009 tmp -> private/tmp
d????????? ? ?    ?       ?            ? .Trashes
drwxr-xr-x 1 root root    2 May 18  2009 .vol
-rw-r--r-- 1  501   80  70K Jun 26  2013 .VolumeIcon.icns

最后,我已经尝试安装hfsprogs并运行fsck.hfsplus,但是运气不佳:

root@liv-HP-Compaq-dc7900:/home/liv# fsck.hfsplus -q /dev/sdb2
** /dev/sdb2
QUICKCHECK ONLY; FILESYSTEM DIRTY

root@liv-HP-Compaq-dc7900:/home/liv# fsck.hfsplus -d /dev/sdb2
** /dev/sdb2
    Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
** Checking HFS Plus volume.
   Invalid B-tree node size
(8, 0)
** Volume check failed.
volume check failed with error 7 
    volume type is pure HFS+ 
    primary MDB is at block 0 0x00 
    alternate MDB is at block 0 0x00 
    primary VHB is at block 2 0x02 
    alternate VHB is at block 487725342 0x1d12191e 
    sector size = 512 0x200 
    VolumeObject flags = 0x07 
    total sectors for volume = 487725344 0x1d121920 
    total sectors for embedded volume = 0 0x00 

问题:根据以上错误消息,文件系统是否已损坏或驱动器出现故障?如何修复损坏的文件系统?如果这不是问题,如何从部分故障的磁盘中恢复用户数据


UPDATE1

考虑到我从该硬盘上应使用哪个'smartctl -d'选项得到的有用输入:'scsi'或'ata'?,我现在设法smartctl在硬盘驱动器上成功运行:

root@liv-HP-Compaq-dc7900:/home/liv# smartctl -d sat -H -i -c -A -l error -l selftest -l selective '/dev/sdb'
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     TOSHIBA MK2555GSXF
Serial Number:    10J9SA69S
LU WWN Device Id: 5 000039 245a067fd
Firmware Version: FH205B
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Jan 17 18:02:43 2014 CET
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
[..]

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   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1031
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       16237
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       18
  7 Seek_Error_Rate         0x000b   100   100   050    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   050    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0032   081   081   000    Old_age   Always       -       7987
 10 Spin_Retry_Count        0x0033   253   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       5274
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       1119
192 Power-Off_Retract_Count 0x0032   084   084   000    Old_age   Always       -       8196
193 Load_Cycle_Count        0x0032   037   037   000    Old_age   Always       -       635340
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       25 (Min/Max 7/49)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       3
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       124
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   253   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       57
222 Loaded_Hours            0x0032   087   087   000    Old_age   Always       -       5415
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
224 Load_Friction           0x0022   100   100   000    Old_age   Always       -       0
226 Load-in_Time            0x0026   100   100   000    Old_age   Always       -       346
240 Head_Flying_Hours       0x0001   100   100   001    Pre-fail  Offline      -       0
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       8107

SMART Error Log Version: 1
ATA Error Count: 1210 (device log contains only the most recent five errors)
[..]

Error 1210 occurred at disk power-on lifetime: 7984 hours (332 days + 16 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 e8 22 1e 40  Error: UNC 8 sectors at LBA = 0x001e22e8 = 1975016

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 da 08 e8 22 1e 40 00      00:08:36.484  READ DMA EXT
  25 da 08 e8 22 1e 40 00      00:08:32.637  READ DMA EXT
  25 da 08 00 66 22 40 00      00:08:32.637  READ DMA EXT
  25 da 08 f8 65 22 40 00      00:08:32.625  READ DMA EXT
  25 da 08 50 c3 28 40 00      00:08:32.625  READ DMA EXT

[..]

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


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.

我不确定如何解析此输出,但是有两件事突然出现:

  • SMART overall-health self-assessment test result: PASSED
  • ATA Error Count: 1210 (device log contains only the most recent five errors)

那有多糟?我应该如何进行?


UPDATE2

按照注释中的建议,我使用Mac OS X运行diskutil verifyVolume

mac:~ admin$ diskutil list
[..]
/dev/disk1
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *250.1 GB   disk1
1:                        EFI                         209.7 MB   disk1s1
2:                  Apple_HFS Macintosh HD            249.7 GB   disk1s2

mac:~ admin$ diskutil verifyVolume /dev/disk1s2
Started filesystem verification on disk1s2 Macintosh HD
Checking Journaled HFS Plus volume
Invalid B-tree node size
The volume Macintosh HD could not be verified completely
Error: -9957: Filesystem verify or repair failed
Underlying error: 8: POSIX reports: Exec format error

fsck

mac:~ admin$ fsck -d /dev/disk1s2 
** /dev/rdisk1s2
BAD SUPER BLOCK: MAGIC NUMBER WRONG

LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y

SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).

那么,这些错误消息有多严重?是开车敬酒吗?


UPDATE3

我玩了更多,smartctl但在我看来(但请确认!)该驱动器绝对是吐司面包:

# 'smartctl' -d sat,16 -H -i -c -A -l error -l selftest -l selective '/dev/sdb'

smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     TOSHIBA MK2555GSXF
Serial Number:    10J9SA69S
LU WWN Device Id: 5 000039 245a067fd
Firmware Version: FH205B
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Jan 27 15:20:57 2014 CET
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: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
See vendor-specific Attribute list for failed Attributes.

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (  88) The previous self-test completed having
                    the electrical element of the test
                    failed.
Total time to complete Offline 
data collection:        (  120) 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:    (   2) minutes.
Extended self-test routine
recommended polling time:    (  90) minutes.
SCT capabilities:          (0x0039) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

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   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1025
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       1
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   050    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   050    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       0
 10 Spin_Retry_Count        0x0033   100   100   030    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1
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       -       0
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       3
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       27 (Min/Max 26/30)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   253   000    Old_age   Always       -       0
220 Disk_Shift              0x0002   100   100   000    Old_age   Always       -       57
222 Loaded_Hours            0x0032   100   100   000    Old_age   Always       -       0
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
224 Load_Friction           0x0022   100   100   000    Old_age   Always       -       0
226 Load-in_Time            0x0026   100   100   000    Old_age   Always       -       353
240 Head_Flying_Hours       0x0001   001   001   001    Pre-fail  Offline  FAILING_NOW 3
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0

Error SMART Error Log Read failed: scsi error badly formed scsi parameters
Smartctl: SMART Error Log Read Failed
Error SMART Error Self-Test Log Read failed: scsi error badly formed scsi parameters
Smartctl: SMART Self Test Log Read Failed
Error SMART Read Selective Self-Test Log failed: scsi error badly formed scsi parameters
Smartctl: SMART Selective Self Test Log Read Failed

我可以选出:

  • SMART overall-health self-assessment test result: FAILED! Drive failure expected in less than 24 hours. SAVE ALL DATA.
  • 240 Head_Flying_Hours 0x0001 001 001 001 Pre-fail Offline FAILING_NOW 3

我怀疑驱动器本身之类的解决方案testdiskphotorec驱动器本身都几乎是不可能的。因此,挽救任何数据的唯一希望是让自己拥有更大的硬盘,并使用dd或逐个复制故障驱动器ddrescue,然后使用photorec生成的图像进行播放。任何其他想法最欢迎!


UPDATE4

正如从损坏的硬盘恢复数据所询问的:“冰柜技巧”,我发布了smartctl -H /dev/yourdisk和的输出smartctl -A /dev/yourdisk

[Output was misleading so I removed that. See UPDATE5.]

这是否可以识别故障类型?


UPDATE5

大约一个星期前,我愚蠢地testdisk在磁盘上运行了一个晚上(在fsck尝试了几次本机Mac OS X之后),并且损坏的程度可能比所有者将其丢弃时的损坏情况还要严重。在testdisk会议结束时,我清楚地听到了喀哒声(“ click of death ”?),并且驱动器无法进行进一步的读取(所有读取均导致错误)。最初,我认为这是由于过热而发生的,但是现在我倾向于认为损坏只是在蔓延,并且驱动器现在处于非常不良的状态。

当我尝试smartctl short self-test在驱动器上运行时,测试Completed with electrical failuresmartctl输出与UPDATE3中的相同,包括240 Head_Flying_Hours 0x0001 001 001 001 Pre-fail Offline FAILING_NOW 3错误。

在此处输入图片说明

我还尝试了一次ddrescue会议,最终全部获得了0 bytes救出。

root@xubuntu:/mnt/ram# ddrescue -f -n /dev/sdc /dev/sda /mnt/ram/ddrescue.log

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:         0 B,  errsize:       0 B,  errors:       0
Current status
rescued:         0 B,  errsize:    250 GB,  current rate:        0 B/s
   ipos:     65024 B,   errors:       1,    average rate:        0 B/s
   opos:     65024 B,     time from last successful read:     3.5 m
Finished                   

在每一个读试图内核抱怨中dmesgBuffer I/O error on device

[ 3706.642819] sd 9:0:0:0: [sdc]  Sense Key : Medium Error [current]
[ 3706.642824] sd 9:0:0:0: [sdc]  Add. Sense: Unrecovered read error
[ 3706.642834] sd 9:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 00 18 00 00 08 00
[ 3706.642842] end_request: critical target error, dev sdc, sector 24
[ 3706.642845] Buffer I/O error on device sdc, logical block 3
[ 3710.910060] sd 9:0:0:0: [sdc] Unhandled sense code
[ 3710.910064] sd 9:0:0:0: [sdc]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE

因此,所有这些都明确指出了硬件损坏。但是,确切的损害类型是什么?(部分来说,我想检查“冰柜技巧”是否合适。)

正如在一个相关问题中所建议的那样,我检查了如何在硬盘出现腹部故障时恢复数据,在我看来,鉴于我注意到的症状,它可能是:

  • 驱动器正在旋转并发出喀嗒声,或者
  • 驱动器旋转并被计算机检测到,但是在尝试访问驱动器时挂起

因此,鉴于此处发布的所有其他信息,是否可能确定磁盘遇到的故障类型?在这种情况下,“冷冻技巧”是否合适?

(向我建议 “当读写头碰到磁盘表面时,它们就会被折腾和扭曲,因此不再可能进行读取”,这听起来像是一种现实的解释,但是我不确定如何确认。)


1
这些内核消息表明您的扇区错误。您可以使用它smartctl来检查它是坏扇区还是坏扇区,或者磁盘末端是否接近。
derobert 2014年

@derobert现在,我设法smartctl在驱动器上运行(请参阅OP中的UPDATE1)。有什么见解吗?
landroni

我的建议是将其连接到Mac并尝试使用本机OS X fsck或Windows XP进行修复diskutil
bahamat 2014年

@bahamat至少在Debian中,hfsprogs上游是...苹果。尽管Debian软件包已经过时了。在上游找到最新版本非常困难……它可能是opensource.apple.com/source/hfs/hfs-226.1.1,但是版本较低,所以谁知道!
derobert 2014年

@derobert:好吧... Debian的版本是332.25-11。根据更改日志332.25-1,是2009年与Mac OS X 10.4匹配的新上游发行版。在此之前,次要版本是332.23。因此,看起来Debian的版本正在跟踪Tiger。如果是,我会fsck为现代的任何事情而经营虎牌。
bahamat 2014年

Answers:


7

看来我发现此线程为时已晚,但对于该线程的未来读者而言:

进行数据抢救时,第一步应该是使用dd或类似的东西制作驱动器的完整映像(cloneZilla是一种流行的选择)。

换句话说,按原样获得驱动器的标识,以便在尝试恢复数据时不会进一步损坏卷。


2
是的,完全是!这一直是我最初的错误。testdiskFS检查等工具所做的所有事情都是在加剧硬件问题。最好是使用类似之类的工具来克隆驱动器的映像ddrescue,因为它可以智能地跳过有问题的扇区(而dd在出现硬件损坏的第一个迹象时,该扇区将简单地失败)。
landroni 2015年

1
更好的是,使用dd_rescue而不是ddrescue。它积极地期望并处理损坏扇区的运行,跳回到理智的区域,以获取尽可能多的易于读取的数据,然后再重试缓慢的故障区域。天才和自由。
hmijail哀悼辞职者,2015年

3

根据第一个智能日志,您可能有124个坏扇区-这一部分:

196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       3
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       124

您应该执行完整扫描以确保实际数量。有些文件肯定已损坏。这就是为什么有Error Count:1210的原因,每次读取损坏的扇区时,您都会得到+1错误。如果要使磁盘工作,则必须向这些扇区写入零,因为只有在写入扇区时才能对其进行重新定位。我无法告诉您如何在hfs文件系统上进行操作,因为我从未使用过它。如果您有ext4,则可以将fsck与以下选项一起使用:

 -c                   Check for bad blocks and add them to the badblock list
 -l bad_blocks_file   Add to badblocks list

因此,您可以获取所有坏块的列表,然后知道它们的位置,这有助于估计坏块是否损坏了常规文件或其他内容。我正在使用debugfs。然后,您可以通过以下方式将零写入这些扇区:

# hdparm --yes-i-know-what-i-am-doing --write-sector 104284160 /dev/sdb

并删除损坏的文件。

从您提供的日志中:

ls: cannot access .hotfiles.btree: Input/output error
ls: cannot access .journal: Input/output error
ls: cannot access .journal_info_block: Input/output error
ls: cannot access .Spotlight-V100: Input/output error
ls: cannot access .Trashes: Input/output error
ls: cannot access home: Input/output error
ls: cannot access libpeerconnection.log: Input/output error
ls: cannot access net: Input/output error
ls: reading directory .: Input/output error

您知道哪些文件已损坏。

接下来是以下参数的值:

193 Load_Cycle_Count        0x0032   037   037   000    Old_age   Always       -       635340

这会杀死您的磁盘,或者已经杀死了它。例如,我的磁盘的寿命为500k。当它达到350k时,我就知道了。。。最终,我在磁盘固件中禁用了此功能,到目前为止,它仍然有效。

接下来是文件系统超级块。对于这种情况,您应该已经完成​​了该块的副本,并且在删除了坏块之后,您可以还原超级块。如果超级块损坏,并且您没有备份,或者您不记得备份扇区的位置,则将无法恢复数据。尝试使用:

# file -s /dev/sdb1
# file -s /dev/sdb

但是您可以读取文件系统(ls命令),所以还不错,我认为在删除badblocks并删除一些文件之后,一切都应该没问题。


谢谢!作为一般说明,我毫不怀疑驱动器已损坏(在我甚至无法挂载HFS +分区之前,但现在内核甚至都检测不到该驱动器;完全公开:我愚蠢地testdisk在其上跑了一个晚上,损坏了可能会比所有者仅仅丢弃它的情况更糟)。因此,现在我只是希望从中得到ddrescue我所能提供的一切,然后再解决photorec所有可能的问题。
landroni 2014年

有几个问题。“ Load_Cycle_Count”是什么意思,为什么它会杀死磁盘?如何在固件中禁用它?“接下来的事情是文件系统超级块。您应该复制该块[..]”。我应该在获得整个文件后立即对其进行复制!!但是无论如何,现在超级块很可能被炸了,因为最近当我连接磁盘时,内核抱怨超级块损坏了dmesg
landroni 2014年

1
在此处阅读有关此内容community.wd.com/t5/My-Book-Live/…–我有WD磁盘,我可以使用idle3-tools-idle3-tools.sourceforge.net
Mikhail Morfikov

1
这是因为有三个值001 001 001-如果VALUE = <THRESH,则磁盘可能会发生故障,因此您将获得该信息。这也可能意味着什么。
Mikhail Morfikov 2014年

1
@landroni-我不确定冻结磁盘是否是一个好主意,但是如果您的磁盘已死或快要死了,并且您不能简单地使它工作,就不会造成更大的伤害,所以如果您没有其他选择,只是这样做,但我认为这不会有所帮助。
Mikhail Morfikov 2014年

-2

机械驱动器故障

为了从坏块中恢复数据,您可以使用$ 89 SpinRite实用程序恢复数据。SpinRite不依赖于文件系统。

HFS +文件系统损坏

如果HFS +文件系统中存在问题,请使用Mac OS X上的$ 99.95 DiskWarrior实用程序修复HFS +问题。

由于您已经使用了其他(fsck)修复工具,因此需要在“ 清理 ”模式下使用DiskWarrior 。您可以通过按住alt“ Rebuild”(按住“ ALT”键的同时将“ Rebuild”更改为“ Rebuild ...”)之前的按住来获得隐藏的“清除”选项。现在,在“ Scavenge”上添加一个复选标记,然后开始“ Rebuild”。

DiskWarrior的“清理”已针对在另一个磁盘修复实用程序已用于恢复文件之后恢复文件进行了优化。OP的损坏可能是由逻辑或物理问题引起的。DiskWarrior专攻消除“逻辑”目录错误,SpinRite专攻恢复由“物理”硬盘问题引起的数据。


DiskWarrior的“清理”模式与正常情况有什么不同?为什么这些工具特别适合解决OP的情况?
2014年

1
@MichaelKjörlingDiskWarrior的“清理”已针对在另一个磁盘修复实用程序已用于恢复文件之后恢复文件进行了优化。OP的损坏可能是由逻辑或物理问题引起的。DiskWarrior专攻消除“逻辑”目录错误,SpinRite专攻恢复由“物理”硬盘问题引起的数据。
Pro Backup

您应该编辑您的帖子以包括其他信息,然后可以使用@注释来通知原始评论者。评论中的信息仅具有容易被噪音所掩盖的趋势。
2014年

1
我必须推荐AGAINST SpinRite。当我尝试从硬盘上抢救数据时,它只浪费了宝贵的时间在即将死掉的磁盘上(少于24 MB的时间不到1 MB,直到我放弃并尝试了其他方法)。最终,我设法使用Linux(ddrescue和dd_rescue)取回了大约80%的数据。我在DiskWarrior上有很好的经验,尽管不是在清除模式下。
hmijail哀悼辞职者,2015年

我有过几次非常相似的情况,现在对新情况进行故障排除。而且我必须在@ 2 hmijail上设置第二个:ddrescue,到目前为止 testdisk,其他免费软件工具被证明是最有用的。 jpgrecover有现货的Debian表现出色。同样,指向一个名为Easeus文件恢复向导的烦人的OSX工具也可以很好地工作,但是如果磁盘像OPs问题中那样弄乱了,则不是这样。
forgotstackxpassword
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.