![处理 ATA 错误](https://linux22.com/image/754301/%E5%A4%84%E7%90%86%20ATA%20%E9%94%99%E8%AF%AF.png)
我的 Xubuntu 16.04 产生了一个不停的 ATA 错误消息。以下是dmesg
[ 4547.943159] ata7: hard resetting link
[ 4548.657810] ata7: SATA link down (SStatus 0 SControl 300)
[ 4548.657824] ata7: EH complete
[ 4548.757449] ata7: exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen
[ 4548.757455] ata7: irq_stat 0x00000040, connection status changed
[ 4548.757459] ata7: SError: { DevExch }
[ 4548.757467] ata7: hard resetting link
[ 4549.469969] ata7: SATA link down (SStatus 0 SControl 300)
[ 4549.469983] ata7: EH complete
[ 4550.363622] ata7: exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen
[ 4550.363628] ata7: irq_stat 0x00000040, connection status changed
[ 4550.363632] ata7: SError: { DevExch }
[ 4550.363642] ata7: hard resetting link
此错误持续发生。
有关我的系统的信息:
我有两个硬盘和一张 DVD
# lsscsi
[0:0:0:0] disk ATA MAXTOR STM325082 E /dev/sda
[0:0:1:0] cd/dvd TSSTcorp CDDVDW SH-S223B SB02 /dev/sr0
[1:0:0:0] disk ATA SAMSUNG HD320KJ 0-10 /dev/sdb
硬盘的 ata 端口如下
/sys/bus/pci/devices/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
/sys/bus/pci/devices/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb
完整的 ata 端口列表是
# ls -l /sys/class/ata_port
ata1 -> ../../devices/pci0000:00/0000:00:1f.2/ata1/ata_port/ata1
ata2 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/ata_port/ata2
ata3 -> ../../devices/pci0000:00/0000:00:1f.5/ata3/ata_port/ata3
ata4 -> ../../devices/pci0000:00/0000:00:1f.5/ata4/ata_port/ata4
ata5 -> ../../devices/pci0000:00/0000:00:1c.6/0000:03:00.1/ata5/ata_port/ata5
ata6 -> ../../devices/pci0000:00/0000:00:1c.6/0000:03:00.1/ata6/ata_port/ata6
ata7 -> ../../devices/pci0000:00/0000:00:1c.6/0000:03:00.0/ata7/ata_port/ata7
还有设备
# ls -l /sys/dev/block
11:0 -> ../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:1/0:0:1:0/block/sr0
7:0 -> ../../devices/virtual/block/loop0
7:1 -> ../../devices/virtual/block/loop1
7:2 -> ../../devices/virtual/block/loop2
7:3 -> ../../devices/virtual/block/loop3
7:4 -> ../../devices/virtual/block/loop4
7:5 -> ../../devices/virtual/block/loop5
7:6 -> ../../devices/virtual/block/loop6
7:7 -> ../../devices/virtual/block/loop7
8:0 -> ../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
8:1 -> ../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
8:16 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb
8:17 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb1
8:18 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb2
8:19 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb3
8:20 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb4
8:21 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb5
8:22 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb6
最后是分区:
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop1 7:1 0 55M 1 loop /snap/core18/1754
sdb 8:16 0 298.1G 0 disk
├─sdb4 8:20 0 1K 0 part
├─sdb2 8:18 0 46.6G 0 part /
├─sdb5 8:21 0 124.6G 0 part /home
├─sdb3 8:19 0 7.9G 0 part [SWAP]
├─sdb1 8:17 0 599.9M 0 part /boot
└─sdb6 8:22 0 118.2G 0 part
loop4 7:4 0 291M 1 loop /snap/vlc/1620
sr0 11:0 1 1024M 0 rom
loop2 7:2 0 97M 1 loop /snap/core/9289
loop0 7:0 0 55M 1 loop /snap/core18/1705
sda 8:0 0 232.9G 0 disk
└─sda1 8:1 0 197G 0 part
loop5 7:5 0 96.5M 1 loop /snap/core/9436
loop3 7:3 0 290.4M 1 loop /snap/vlc/1700
问题:
我该如何解决这个错误?
任何可能有助于解决问题的帮助也值得赞赏,例如,这个 ata7 有问题的端口是什么?从我收集的所有数据来看,它似乎不对应任何物理磁盘或任何分区。
答案1
我该如何解决这个错误?
更换硬盘,因为它显然正在执行 ATA 重置。这(在几乎所有情况下)都是电子设备即将报废或存在松动接触的迹象。
或许这是 SATA/SAS 电缆(或连接器)的问题,因此您可以先检查/更换它。但最近几年,我发现大多数情况下是驱动器(电子设备)本身的问题。
我还可以更换整台电脑
是的,那也能解决问题。听起来有点激进,而且耗费时间和金钱,但那绝对能解决问题。
你能解释一下为什么我应该更换硬盘吗
因为它有缺陷。健康的驾驶者不会玩这种开关游戏。
[...] 不尝试以其他更温和的方式解决问题吗?
确实有一些可用的选项。你总是可以从 USB 启动(也许可以工作)。你可以将新硬盘放在有故障的硬盘旁边(然后忽略它),或者干脆不再使用这台电脑。但这些都无法修复损坏的硬盘。
提示:通过软件或“其他温和的方式”修复硬件问题几乎从来都不是一个真正的选择。