外部硬盘意外故障,ddrescue 无法正常工作

外部硬盘意外故障,ddrescue 无法正常工作

今天我连接了外置硬盘来传输文件。一切似乎都运行良好 - 速度不慢,所有文件都显示出来。在传输新文件的过程中,它突然断开连接,我无法重新连接。

我相信其中没有错误,smartctl并且lsblk也显示了它。我尝试运行testdisk,它显示没有可用的分区。我没有运行深度扫描,因为我还没有创建备份映像,也不想弄乱它。每当我将其连接到 Windows 机器时,它都会出现在设备管理器中,没有任何警告,但它不可见并且无法打开。

这可能是什么问题?

更新:

到目前为止,用于ddrescue --no-split /dev/sdb image logfile创建图像失败:

rescued:         0 B,  errsize:   9727 MB,  current rate:        0 B/s
   ipos:     9277 MB,   errors:    6412,    average rate:        0 B/s
   opos:     9277 MB, run time:    4.16 m,  successful read:    4.16 m ago
Copying non-tried blocks... Pass 3 (forwards) 

dmesg:

[  947.713433] sd 6:0:0:0: Attached scsi generic sg2 type 0
[  947.713647] ses 6:0:0:1: Attached Enclosure device
[  947.713937] ses 6:0:0:1: Attached scsi generic sg3 type 13
[  947.714589] ses 6:0:0:1: Failed to get diagnostic page 0x1
[  947.714616] ses 6:0:0:1: Failed to bind enclosure -19
[  947.715864] sd 6:0:0:0: [sdb] Spinning up disk...
...
...
[  982.772209] sd 6:0:0:0: [sdb] No Caching mode page found
[  982.772218] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 1015.039086] ldm_validate_partition_table(): Disk read failed.
[ 1015.039128] Dev sdb: unable to read RDB block 0
[ 1015.039188]  sdb: unable to read partition table
[ 1015.041932] sd 6:0:0:0: [sdb] Attached SCSI disk
[ 1015.047915] scsi_io_completion: 3688 callbacks suppressed
[ 1015.047922] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 1015.047927] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 1015.047931] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Medium not present
[ 1015.047935] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 3a 37 5f 80 00 00 08 00
[ 1015.047937] print_req_error: 3688 callbacks suppressed
[ 1015.047939] print_req_error: I/O error, dev sdb, sector 976707456

smartctl:

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Black
Device Model:     WDC WD3200BEKT-75PVMT1
Serial Number:    WD-WX51A33L6540
LU WWN Device Id: 5 0014ee 6ae08eefd
Firmware Version: 01.01A01
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Wed Dec 30 14:10:00 2020 PST
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:        ( 5880) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    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:    (   2) minutes.
Extended self-test routine
recommended polling time:    (  61) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x7035) SCT Status 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     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   159   136   021    Pre-fail  Always       -       1025
  4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1142
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       2095
 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   099   099   000    Old_age   Always       -       1107
191 G-Sense_Error_Rate      0x0032   001   001   000    Old_age   Always       -       601
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       78
193 Load_Cycle_Count        0x0032   178   178   000    Old_age   Always       -       67059
194 Temperature_Celsius     0x0022   101   063   000    Old_age   Always       -       42
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   100   253   000    Old_age   Offline      -       0
240 Head_Flying_Hours       0x0032   098   098   000    Old_age   Always       -       1897
241 Total_LBAs_Written      0x0032   200   200   000    Old_age   Always       -       2423437807
242 Total_LBAs_Read         0x0032   200   200   000    Old_age   Always       -       1617390794
254 Free_Fall_Sensor        0x0032   195   195   000    Old_age   Always       -       5

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%         0         -

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.

答案1

dd-rescue 正在这里工作。

操作系统检测到错误并移除了磁盘,因此 ddrescue 无法继续运行。您应该拔下磁盘,重新插入 - 检查它是否仍为 /dev/sdb(或相应地调整命令)并重新运行该命令 - 因为它会写入日志文件,所以它应该从中断的地方继续。您可能需要多次执行此操作。

我确实注意到 ddrescue 有多个版本 - Gnu DDRESCUE 具有不同的语法和略有不同的功能。您正在使用 ddrescue - 我对此了解不多 - 但您可以通过添加 --direct 标志来获得更多信息。

我相信 GNU DDRescue 现在更加标准/常见(它是自 14.04 以来 Ubuntu 存储库中唯一的一个)。您可能想尝试一下。

相关内容