在注意到异常长的磁盘操作延迟后,我查找了 journalctl,这就是我发现的:
Feb 22 14:02:11.711182 Onan01 kernel: ata10: hard resetting link
Feb 22 14:02:12.186958 Onan01 kernel: ata10: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Feb 22 14:02:12.187044 Onan01 kernel: ata10.00: configured for UDMA/33
Feb 22 14:02:12.187068 Onan01 kernel: ata10: EH complete
Feb 22 14:02:22.782960 Onan01 kernel: ata10: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Feb 22 14:02:22.783033 Onan01 kernel: ata10.00: configured for UDMA/33
Feb 22 14:03:27.472083 Onan01 kernel: ata10.00: exception Emask 0x0 SAct 0x0 SErr 0xd0000 action 0x6 frozen
Feb 22 14:03:27.472241 Onan01 kernel: ata10: SError: { PHYRdyChg CommWake 10B8B }
Feb 22 14:03:27.472271 Onan01 kernel: ata10.00: failed command: WRITE DMA EXT
Feb 22 14:03:27.472300 Onan01 kernel: ata10.00: cmd 35/00:18:00:35:44/00:00:74:00:00/e0 tag 14 dma 12288 out
res 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
Feb 22 14:03:27.472323 Onan01 kernel: ata10.00: status: { DRDY }
Feb 22 14:03:27.472345 Onan01 kernel: ata10: hard resetting link
Feb 22 14:03:27.950979 Onan01 kernel: ata10: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Feb 22 14:03:27.951084 Onan01 kernel: ata10.00: configured for UDMA/33
Feb 22 14:03:27.951113 Onan01 kernel: ata10: EH complete
Feb 22 14:04:03.852081 Onan01 kernel: ata10.00: exception Emask 0x10 SAct 0x0 SErr 0x40d0000 action 0xe frozen
Feb 22 14:04:03.852242 Onan01 kernel: ata10.00: irq_stat 0x00000040, connection status changed
Feb 22 14:04:03.852274 Onan01 kernel: ata10: SError: { PHYRdyChg CommWake 10B8B DevExch }
Feb 22 14:04:03.852301 Onan01 kernel: ata10.00: failed command: WRITE DMA EXT
Feb 22 14:04:03.852325 Onan01 kernel: ata10.00: cmd 35/00:38:58:35:44/00:00:74:00:00/e0 tag 17 dma 28672 out
res 50/00:00:38:23:00/00:00:ac:00:00/e0 Emask 0x10 (ATA bus error)
Feb 22 14:04:03.852357 Onan01 kernel: ata10.00: status: { DRDY }
第一种错误(超时)似乎比第二种错误(ATA 总线错误)更频繁。每个都有不少。SATA 通道ata10
连接到 WD Caviar Green HDD。
此磁盘上的 SMART 诊断显然是干净的:
sudo smartctl --all /dev/sdf1
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-100-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD20EZAZ-00GGJB0
Serial Number: WD-WXT1A29LE265
LU WWN Device Id: 5 0014ee 211b07a4f
Firmware Version: 80.00A80
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 3.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Feb 23 11:37:14 2022 IST
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: (32520) 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: ( 103) minutes.
Conveyance self-test routine
recommended polling time: ( 2) 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 - 0
3 Spin_Up_Time 0x0027 184 170 021 Pre-fail Always - 1783
4 Start_Stop_Count 0x0032 099 099 000 Old_age Always - 1573
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 083 083 000 Old_age Always - 13100
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 - 1524
192 Power-Off_Retract_Count 0x0032 199 199 000 Old_age Always - 761
193 Load_Cycle_Count 0x0032 147 147 000 Old_age Always - 160779
194 Temperature_Celsius 0x0022 115 104 000 Old_age Always - 28
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
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% 13100 -
# 2 Short offline Completed without error 00% 13099 -
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 测试似乎无法正常工作。它们从进度 90% 直接完成(没有 80%、70% 等),之后,它们不会出现在“SMART 自测日志”部分中。
我连续两天经历了文件操作延迟。重新启动后,问题似乎消失了,然后又回来了。具体来说,问题表现为复制或移动文件的长时间延迟以及 LibreOffice 挂起文件保存。知道导致此类错误的原因是什么吗?
操作系统:Ubuntu 20.04
处理器:锐龙3
MB:技嘉 X570 UD
您引用的消息表明 S-ATA 链路存在硬件问题。SMART 专注于磁盘驱动器本身的内部工作,不会报告此类问题。
可能的原因包括 S-ATA 电缆损坏或脱落、连接器脏污或安装不当,或者主板或磁盘驱动器上的接口有缺陷。
故障排除步骤: