更换旧的 SATA 电缆。旧的是否会导致 HDD 上的 dmesg 错误?

更换旧的 SATA 电缆。旧的是否会导致 HDD 上的 dmesg 错误?

背景

当我用全新的WD Red 3TB磁盘组装一台服务器时,我可能犯了一个严重的判断错误,那就是使用了一个较旧的和一个非常旧的SATA(维基百科)电缆。我的问题本质上是硬件背景,以及在 Debian 10 Linux 系统下运行的一些历史。


我所说的这些电缆有 2 条:

  • 一个5岁以上,但仍然SATA III经过认证的数据线。恕我直言,如果过度弯曲或其他什么情况,这个可能会出错,但我不知道有任何虐待,所以也许这些年来屏蔽变得更好(?)我想等等。

  • 我惊讶地发现在同一个服务器上SATA 电缆可能已使用 15 年以上仅与串行ATAmdadm写在上面,没有别的,考虑到自从我以各种磁盘 I/O 错误消息的形式组装这台服务器dmesg并最终降低阵列性能以来,我的 RAID 1 阵列遇到了越来越小的问题,我在想如果这一条电缆或可能两条电缆都可能导致我在读取和写入阵列时出现错误。


更换电缆

我今天做的是买了 2 个德国制造的(在贴纸上找到),可能质量更高,SATA III 认证新电缆,看看会发生什么。


测试

  1. 我启动了服务器,卸载了阵列并停止了它。

  2. 已开始连夜运行这两个单独的读取磁盘命令:

    pv < /dev/sdX > /dev/null
    
  3. 还开始监控 中的错误dmesg和速度nmon。 1 小时后,到目前为止没有出现任何错误或速度减慢......


问题

dmesg假设我醒来后发现这些硬盘完全读取后没有错误,我是否可以认为旧电缆是错误的根源,或者有些事情我没有考虑到?

我无法决定是在这里发帖还是在超级用户上发帖。如果在其他地方更适合,如果有很多这样的评论,我会在早上重新发布。无论如何,感谢您抽出时间。


smartctl

WD-WCC4N6EZXNSD

smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.19.0-9-amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68EUZN0
Serial Number:    WD-WCC4N6EZXNSD
LU WWN Device Id: 5 0014ee 210a9a0ef
Firmware Version: 82.00A82
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sat Jun 20 08:47:05 2020 CEST
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:        (40380) 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:    ( 405) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x703d) 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     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   179   178   021    Pre-fail  Always       -       6050
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       31
  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   097   097   000    Old_age   Always       -       2443
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       31
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       2423
194 Temperature_Celsius     0x0022   116   109   000    Old_age   Always       -       34
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

SMART Error Log Version: 1
ATA Error Count: 2033 (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 2033 occurred at disk power-on lifetime: 424 hours (17 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 00   2d+13:04:28.795  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.794  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00   2d+13:04:28.794  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00   2d+13:04:28.794  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.793  IDENTIFY DEVICE

Error 2032 occurred at disk power-on lifetime: 424 hours (17 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
  -- -- -- -- -- -- --
  04 61 46 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 00   2d+13:04:28.794  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00   2d+13:04:28.794  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.793  IDENTIFY DEVICE
  c8 00 08 00 00 00 e0 00   2d+13:04:28.779  READ DMA
  ef 10 02 00 00 00 a0 00   2d+13:04:28.779  SET FEATURES [Enable SATA feature]

Error 2031 occurred at disk power-on lifetime: 424 hours (17 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 00   2d+13:04:28.794  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.793  IDENTIFY DEVICE
  c8 00 08 00 00 00 e0 00   2d+13:04:28.779  READ DMA
  ef 10 02 00 00 00 a0 00   2d+13:04:28.779  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.778  IDENTIFY DEVICE

Error 2030 occurred at disk power-on lifetime: 424 hours (17 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
  -- -- -- -- -- -- --
  04 61 08 00 00 00 e0  Device Fault; Error: ABRT 8 sectors at LBA = 0x00000000 = 0

  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 00 00 00 e0 00   2d+13:04:28.779  READ DMA
  ef 10 02 00 00 00 a0 00   2d+13:04:28.779  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.778  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00   2d+13:04:28.778  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00   2d+13:04:28.778  SET FEATURES [Enable SATA feature]

Error 2029 occurred at disk power-on lifetime: 424 hours (17 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 00   2d+13:04:28.779  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.778  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00   2d+13:04:28.778  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 00   2d+13:04:28.778  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 00   2d+13:04:28.777  IDENTIFY DEVICE

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.

WD-WCC4N5EKLTNX

smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.19.0-9-amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68EUZN0
Serial Number:    WD-WCC4N5EKLTNX
LU WWN Device Id: 5 0014ee 2bb548051
Firmware Version: 82.00A82
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sat Jun 20 08:50:48 2020 CEST
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:        (39540) 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:    ( 397) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x703d) 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     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   180   179   021    Pre-fail  Always       -       5975
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       32
  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   097   097   000    Old_age   Always       -       2443
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       31
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       4
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       2443
194 Temperature_Celsius     0x0022   115   107   000    Old_age   Always       -       35
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

SMART Error Log Version: 1
ATA Error Count: 45 (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 45 occurred at disk power-on lifetime: 2416 hours (100 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 08      04:26:20.066  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.066  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      04:26:20.066  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 08      04:26:20.065  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.065  IDENTIFY DEVICE

Error 44 occurred at disk power-on lifetime: 2416 hours (100 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
  -- -- -- -- -- -- --
  04 61 46 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 08      04:26:20.066  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 08      04:26:20.065  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.065  IDENTIFY DEVICE
  ef 10 02 00 00 00 a0 08      04:26:20.046  SET FEATURES [Enable SATA feature]

Error 43 occurred at disk power-on lifetime: 2416 hours (100 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 08      04:26:20.065  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.065  IDENTIFY DEVICE
  ef 10 02 00 00 00 a0 08      04:26:20.046  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.046  IDENTIFY DEVICE

Error 42 occurred at disk power-on lifetime: 2416 hours (100 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
  -- -- -- -- -- -- --
  04 61 02 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 08      04:26:20.046  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.046  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      04:26:20.046  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 08      04:26:20.045  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.045  IDENTIFY DEVICE

Error 41 occurred at disk power-on lifetime: 2416 hours (100 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
  -- -- -- -- -- -- --
  04 61 46 00 00 00 a0  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 08      04:26:20.046  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 08      04:26:20.045  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      04:26:20.045  IDENTIFY DEVICE
  ef 10 02 00 00 00 a0 08      04:26:20.030  SET FEATURES [Enable SATA feature]

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.

保修单

这两个硬盘都在保修期内,因此如果有故障证明,我可以更换它们。

答案1

更换 SATA 电缆(尤其是 SATA v1 电缆)后

那么,更换两根 SATA 电缆后到底发生了什么?

  • 首先,正如我的问题中提到的,我读取了两个驱动器,没有错误!

  • 其次,我知道这些错误可能是特定于写入的,所以我做了一个写入测试!

下图分辨率较大,可点击放大:

更换 SATA 电缆后


你可以亲眼看看,没有更多的错误可以看到dmesg,这让我很高兴并证明了我的理论。当我组装服务器时,我没有意识到那根电缆有多旧,这让我很难过。无论如何,问题暂时解决了。

答案2

我唯一能想到的就是使用 smartctl 检查硬盘是否有问题。跑步:

smartctl -a -x /dev/sdX

将最后一个 X 替换为适当的字母,并密切注意任何不可恢复的扇区,或者注意坏扇区是否不断增加。

特别是如果根据 SMART 报告,硬盘驱动器看起来没有出现故障,并且更换电缆后您发现情况有所改善,那么我相信可以公平地说,电缆是问题所在。

答案3

相关SATA版本已于2002年(1.5G)、2005年(3.0G)和2008年(6.0G)发布。所以你的电缆是 1.5 或 3.0 时代的。理论上,旧电缆应该可以与更新、更快的设备配合使用,但这种组合的问题是众所周知的。

您可以通过以下方式获取当前 SATA 链接速度

smartctl -a /dev/sda | grep SATA

您可以使用内核参数强制内核将链接配置为较低的速度libata.force=1.5。如果旧电缆和内核参数问题消失,那么我可以合理确定电缆是问题所在。

相关内容