如何验证外部硬盘是否出现故障

如何验证外部硬盘是否出现故障

Ubuntu 16.10,内核 4.8.0.45-通用

我连接了一个外部硬盘。它配置了 ext4 文件系统。它上面有 600 GB 的重要家庭照片和视频。我有它的备份,所以我们不会面临丢失所有数据的危险。这是一个相当新的(大约 18 个月前购买的)5TB 硬盘。

最近,每当我尝试从该驱动器复制或移动文件时,系统都会显示此错误消息:“错误代码 9:文件描述符错误”。仅当该驱动器是复制或移动的源时才会发生这种情况 - 当我尝试从其他源/驱动器复制或移动文件时,我不会收到该错误。

我猜是驱动器出了问题,但我不能确定。我已经在驱动器上运行了 fsck(通过 gparted)。第一次它报告了无数错误,但它说它能够修复所有错误。之后我又重复运行了几次 fsck,每次都报告没有问题。从那时起,我的问题就消失了。但我担心的是,我怎么知道这只是一个幸运的、暂时的缓解?

我如何才能确定外部硬盘是否出现故障?

如果是,我如何确定只需重新格式化并将数据复制回去就可以了,而不是必须更换它?

或者.....我的猜测不正确,并且我的问题的描述表明其他地方存在错误?

谢谢。

这是运行 smartctl 命令的结果,我不知道如何解释这些结果(“WHEN_FAILED”列中只有破折号):

main1@system1:~$ sudo smartctl -a -d sat /dev/sdi [sudo] password for main1:  smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.8.0-45-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION === Model Family:     Western Digital Green Device Model:     WDC WD60EZRX-11MVLB1 Serial Number:    WD-WX21DC42E2TP LU WWN Device Id: 5 0014ee 2b6db3009 Firmware Version:
80.00A80 User Capacity:    6,001,141,572,096 bytes [6.00 TB] Sector Sizes:     512 bytes logical, 4096 bytes physical Rotation Rate:    5700 rpm 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: 3.0 Gb/s) Local Time is:    Tue Apr  4 20:24:33 2017 CDT 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:  (0x82)   Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled. 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:      ( 4064) 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:    ( 694) minutes. Conveyance self-test routine recommended polling time:      (   5) minutes. SCT capabilities:
           (0x3035) 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      -       1  
 3 Spin_Up_Time            0x0027   202   187   021    Pre-fail  Always       -       8883  
 4 Start_Stop_Count        0x0032   097   097   000    Old_age   Always       -       3408  
 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       -       8454  
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   097   097   000    Old_age   Always       -       3405 
192 Power-Off_Retract_Count 0x0032   196   196   000    Old_age   Always      -       3259 
193 Load_Cycle_Count        0x0032   076   076   000    Old_age   Always       -       372574 
194 Temperature_Celsius     0x0022   102   093   000    Old_age   Always       -       50 
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   200   200   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

SMART Error Log Version: 1 No Errors Logged

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.

main1@system1:~$

答案1

确保备份时不会覆盖任何以前的备份——您可能已经丢失了一些文件,因此旧备份可能是您的唯一来源。安装 smartmontools 包

sudo apt-get install smartmontools

然后对有问题的磁盘运行磁盘检查(下面使用的 sdb,使用你的系统为该设备提供的磁盘:

sudo smartctl -a /dev/sdb

将结果发布到您的问题中,以获取有关磁盘健康状况的进一步意见。查看“失败时”列以查看是否有任何内容。


驱动器上没有报告任何错误,因此问题可能不是硬件。 fsck 可以“修复”许多错误,也许您最好重新格式化并从备份中恢复。不过,请确保您可以先读取备份!

相关内容