如何诊断“慢速”驱动器问题

如何诊断“慢速”驱动器问题

我最近安装了一个新的 SATA 1TB Seagate Barracuda 硬盘用于存储。最近,我遇到了从驱动器“读取”滞后一两分钟的问题,如果幸运的话,可能会滞后几十秒。观看媒体会挂起程序,ls在其目录中运行会出现滞后,玩游戏也会挂起。

我该如何诊断问题(SATA 连接故障/内核问题)?最近,在一次脏关机损坏了一些目录后,我在驱动器上运行了 e2fsck。我看到一些用户建议从 SMART 开始检查驱动器运行状况。我使用 Debian Stretch。

uname -a

Linux vera 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux

所以我查看了 /var/log/messages 并发现了这个。 SATA 连接似乎有故障,内核正在尝试启动连接。我对么?

Apr  3 22:55:19 vera kernel: [40047.961486] ata4: lost interrupt (Status 0x50)
Apr  3 22:55:19 vera kernel: [40047.961524] ata4: hard resetting link
Apr  3 22:55:20 vera kernel: [40048.841537] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Apr  3 22:55:20 vera kernel: [40048.870611] ata4.00: configured for UDMA/33
Apr  3 22:55:20 vera kernel: [40048.870632] ata4: EH complete
Apr  3 22:55:54 vera kernel: [40082.779512] ata4: lost interrupt (Status 0x50)
Apr  3 22:55:54 vera kernel: [40082.779551] ata4: hard resetting link
Apr  3 22:55:55 vera kernel: [40083.655597] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Apr  3 22:55:55 vera kernel: [40083.679941] ata4.00: configured for UDMA/33
Apr  3 22:55:55 vera kernel: [40083.679954] ata4: EH complete
Apr  3 22:56:27 vera kernel: [40115.557306] ata4: lost interrupt (Status 0x50)
Apr  3 22:56:27 vera kernel: [40115.557343] ata4: hard resetting link
Apr  3 22:56:28 vera kernel: [40116.433391] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Apr  3 22:56:28 vera kernel: [40116.461843] ata4.00: configured for UDMA/33
Apr  3 22:56:28 vera kernel: [40116.461861] ata4: EH complete

类似地在 /var/log/syslog 中,

Apr  3 22:55:19 vera kernel: [40047.961486] ata4: lost interrupt (Status 0x50)
Apr  3 22:55:19 vera kernel: [40047.961502] ata4.00: exception Emask 0x10 SAct 0x0 SErr 0x40d0002 action 0xe frozen
Apr  3 22:55:19 vera kernel: [40047.961507] ata4: SError: { RecovComm PHYRdyChg CommWake 10B8B DevExch }
Apr  3 22:55:19 vera kernel: [40047.961510] ata4.00: failed command: READ DMA EXT
Apr  3 22:55:19 vera kernel: [40047.961515] ata4.00: cmd 25/00:18:70:05:16/00:00:2b:00:00/e0 tag 0 dma 12288 in
Apr  3 22:55:19 vera kernel: [40047.961515]          res 40/00:00:00:4f:c2/00:00:00:00:00/40 Emask 0x14 (ATA bus error)
Apr  3 22:55:19 vera kernel: [40047.961518] ata4.00: status: { DRDY }
Apr  3 22:55:19 vera kernel: [40047.961524] ata4: hard resetting link
Apr  3 22:55:20 vera kernel: [40048.841537] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Apr  3 22:55:20 vera kernel: [40048.870611] ata4.00: configured for UDMA/33
Apr  3 22:55:20 vera kernel: [40048.870632] ata4: EH complete
Apr  3 22:55:54 vera kernel: [40082.779512] ata4: lost interrupt (Status 0x50)
Apr  3 22:55:54 vera kernel: [40082.779529] ata4.00: exception Emask 0x10 SAct 0x0 SErr 0x40d0002 action 0xe frozen
Apr  3 22:55:54 vera kernel: [40082.779534] ata4: SError: { RecovComm PHYRdyChg CommWake 10B8B DevExch }
Apr  3 22:55:54 vera kernel: [40082.779537] ata4.00: failed command: READ DMA EXT
Apr  3 22:55:54 vera kernel: [40082.779542] ata4.00: cmd 25/00:10:e0:cf:16/00:00:2b:00:00/e0 tag 0 dma 8192 in
Apr  3 22:55:54 vera kernel: [40082.779542]          res 40/00:00:00:4f:c2/00:00:00:00:00/40 Emask 0x14 (ATA bus error)
Apr  3 22:55:54 vera kernel: [40082.779545] ata4.00: status: { DRDY }
Apr  3 22:55:54 vera kernel: [40082.779551] ata4: hard resetting link
Apr  3 22:55:55 vera kernel: [40083.655597] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Apr  3 22:55:55 vera kernel: [40083.679941] ata4.00: configured for UDMA/33

猫/过程/中断

     CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
  0:         48          0          0    1166123          0          0          0          0   IO-APIC   2-edge      timer
  1:          1          0          0          2          0          0          0          0   IO-APIC   1-edge      i8042
  8:          0          0          0          0          0          0          0          0   IO-APIC   8-edge      rtc0
  9:          0          0          0          0          0          0          0          0   IO-APIC   9-fasteoi   acpi
 12:          0          0          0          4          0          0          0          0   IO-APIC  12-edge      i8042
 14:          0          0          0      19994          0          0          0          0   IO-APIC  14-edge      ata_piix
 15:          0          0          0          0          0          0          0          0   IO-APIC  15-edge      ata_piix
 16:          0          0          0          0          0          4          0          0   IO-APIC  16-fasteoi   ehci_hcd:usb1, uhci_hcd:usb7
 18:          0          0          0          0          0          0          0          0   IO-APIC  18-fasteoi   uhci_hcd:usb4, uhci_hcd:usb8, i801_smbus
 19:          0          0        160          0          0      24990          0          0   IO-APIC  19-fasteoi   uhci_hcd:usb5, uhci_hcd:usb6, ata_piix
 21:         94         81       3922      25446      66573          0          0          0   IO-APIC  21-fasteoi   uhci_hcd:usb3
 23:          0          0          0          0          0          0          0          0   IO-APIC  23-fasteoi   ehci_hcd:usb2, uhci_hcd:usb9
 24:          0          0          0          0          0          0          0          0   PCI-MSI 49152-edge      aerdrv, PCIe PME
 25:          0          0          0          0          0          0          0          0   PCI-MSI 458752-edge      PCIe PME, pciehp
 26:          0          0          0          0          0          0          0          0   PCI-MSI 468992-edge      PCIe PME, pciehp
 27:          0          0          0          0      70083          0         18          0   PCI-MSI 1572864-edge      ens133
 28:          0          0          0          0        544          0          0          0   PCI-MSI 442368-edge      snd_hda_intel:card0
 29:          0          0          0          0          0        185          0          0   PCI-MSI 526336-edge      snd_hda_intel:card1
 30:          0          0          0          0          0          0        531     129765   PCI-MSI 524288-edge      radeon
NMI:        742        758        770        770        762        722        761        616   Non-maskable interrupts
LOC:     478730     477562     476552     397908     493850     486872     491882     734216   Local timer interrupts
SPU:          0          0          0          0          0          0          0          0   Spurious interrupts
PMI:        742        758        770        770        762        722        761        616   Performance monitoring interrupts
IWI:          0          0          0          2          0          0          1          1   IRQ work interrupts
RTR:          1          0          0          0          0          0          0          0   APIC ICR read retries
RES:     240104     166326     137077     158336     121230     117014     116487     241295   Rescheduling interrupts
CAL:      39159      40225      43556      34693      52710      37347      44372      37116   Function call interrupts
TLB:      28743      29063      31826      25607      41560      26281      32662      25775   TLB shootdowns
TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts
THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts
DFR:          0          0          0          0          0          0          0          0   Deferred Error APIC interrupts
MCE:          0          0          0          0          0          0          0          0   Machine check exceptions
MCP:          9          9          9          9          9          9          9          9   Machine check polls
ERR:          0
MIS:          0
PIN:          0          0          0          0          0          0          0          0   Posted-interrupt notification event
PIW:          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event

相关内容