如果我跑步sudo apt-get update
或者sudo apt-get upgrade
其他什么的,我就会总线错误(核心转储)。0%
在日志中我可以看到:
Jun 27 12:49:22 topic1 kernel: [37586.366988] ata1.00: exception Emask 0x0 SAct 0x2000000 SErr 0x0 action 0x0
Jun 27 12:49:22 topic1 kernel: [37586.367023] ata1.00: irq_stat 0x40000008
Jun 27 12:49:22 topic1 kernel: [37586.367036] ata1.00: failed command: READ FPDMA QUEUED
Jun 27 12:49:22 topic1 kernel: [37586.367056] ata1.00: cmd 60/08:c8:f0:97:eb/00:00:12:00:00/40 tag 25 ncq dma 4096 in
Jun 27 12:49:22 topic1 kernel: [37586.367056] res 41/40:00:f7:97:eb/00:00:12:00:00/40 Emask 0x409 (media error) <F>
Jun 27 12:49:22 topic1 kernel: [37586.367067] ata1.00: status: { DRDY ERR }
Jun 27 12:49:22 topic1 kernel: [37586.367073] ata1.00: error: { UNC }
Jun 27 12:49:22 topic1 kernel: [37586.368527] ata1.00: configured for UDMA/133
Jun 27 12:49:22 topic1 kernel: [37586.368567] sd 0:0:0:0: [sda] tag#25 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jun 27 12:49:22 topic1 kernel: [37586.368577] sd 0:0:0:0: [sda] tag#25 Sense Key : Medium Error [current]
Jun 27 12:49:22 topic1 kernel: [37586.368585] sd 0:0:0:0: [sda] tag#25 Add. Sense: Unrecovered read error - auto reallocate failed
Jun 27 12:49:22 topic1 kernel: [37586.368595] sd 0:0:0:0: [sda] tag#25 CDB: Read(10) 28 00 12 eb 97 f0 00 00 08 00
Jun 27 12:49:22 topic1 kernel: [37586.368600] print_req_error: I/O error, dev sda, sector 317429751
Jun 27 12:49:22 topic1 kernel: [37586.368679] ata1: EH complete
----
(我想知道为什么会出现媒体错误?)执行后
hdparm --yes-i-know-what-i-am-doing --repair-sector 317429751 /dev/sda
我收到下一个扇区错误,在本例中为 317429752。
我使用的是 Ubuntu 16.04 LTS
磁盘1:
磁盘2:
答案1
您有 NCQ 错误。
Jun 27 12:49:22 topic1 kernel: [37586.367036] ata1.00: failed command: READ FPDMA QUEUED
Jun 27 12:49:22 topic1 kernel: [37586.367056] ata1.00: cmd 60/08:c8:f0:97:eb/00:00:12:00:00/40 tag 25 ncq dma 4096 in
Jun 27 12:49:22 topic1 kernel: [37586.367056] res 41/40:00:f7:97:eb/00:00:12:00:00/40 Emask 0x409 (media error) <F>
Jun 27 12:49:22 topic1 kernel: [37586.367067] ata1.00: status: { DRDY ERR }
Jun 27 12:49:22 topic1 kernel: [37586.367073] ata1.00: error: { UNC }
本机命令队列 (NCQ) 是串行 ATA 协议的扩展,允许硬盘驱动器内部优化接收的读写命令的执行顺序。
首先我们fsck
……
- 以“试用 Ubuntu”模式启动 Ubuntu Live DVD/USB
terminal
按Ctrl+ Alt+打开窗口T- 类型
sudo fdisk -l
- 识别“Linux 文件系统”的 /dev/sdXX 设备名称
- 输入
sudo fsck -f /dev/sdXX
,替换sdXX
为您之前找到的数字 fsck
如果有错误则重复命令- 类型
reboot
然后我们修补 NCQ......
编辑sudo -H gedit /etc/default/grub
并更改以下行以包含此额外参数。然后执行sudo update-grub
将更改写入磁盘。重新启动。监视器挂起,并观察/var/log/syslog
或dmesg
是否继续出现错误消息。
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.force=noncq"
然后我们坏块...
注意:不要中止坏块扫描!
注意:不要对 SSD 造成坏块
注意:请先备份您的重要文件!
注意:这将花费很多小时
注意:您可能面临硬盘故障
在“尝试 Ubuntu”模式下启动 Ubuntu Live DVD/USB。
在terminal
...
sudo fdisk -l
# 识别所有“Linux 文件系统”分区
sudo e2fsck -fcky /dev/sdXX
# 只读测试
或者
sudo e2fsck -fccky /dev/sdXX
# 非破坏性读写测试(受到推崇的)
-k 很重要,因为它会保存之前的坏块表,并将任何新的坏块添加到该表中。如果没有 -k,您将丢失所有之前的坏块信息。
-fccky 参数...
-f Force checking even if the file system seems clean.
-c This option causes e2fsck to use badblocks(8) program to do
a read-only scan of the device in order to find any bad blocks.
If any bad blocks are found, they are added to the bad block
inode to prevent them from being allocated to a file or direc‐
tory. If this option is specified twice, then the bad block scan
will be done using a non-destructive read-write test.
-k When combined with the -c option, any existing bad blocks in the
bad blocks list are preserved, and any new bad blocks found by
running badblocks(8) will be added to the existing bad blocks
list.
-y Assume an answer of `yes' to all questions; allows e2fsck to be
used non-interactively. This option may not be specified at the
same time as the -n or -p options.
更新#1:
查看 SMART 数据后,您的硬盘似乎已损坏。如果您查看图像 #1,即总体评估,您会看到它显示2840 个坏扇区。这不好。还有读取错误率和重新定位的扇区数和当前待处理扇区数都很糟糕。
启动到 Ubuntu Live DVD/USB 并将所有文件备份到外部硬盘驱动器,然后更换驱动器。