LLLL1007 2023-03-06 09:48 采纳率: 70%
浏览 60
已结题

debian_omv, I/O error, dev sdb,SSD,NCQ报错,


Mar  6 09:15:14 openmediavault kernel: [34258.966131] ata2.00: exception Emask 0x10 SAct 0x100 SErr 0x280100 action 0x6 frozen
Mar  6 09:15:14 openmediavault kernel: [34258.966266] ata2.00: irq_stat 0x08000000, interface fatal error
Mar  6 09:15:14 openmediavault kernel: [34258.966351] ata2: SError: { UnrecovData 10B8B BadCRC }
Mar  6 09:15:14 openmediavault kernel: [34258.966427] ata2.00: failed command: READ FPDMA QUEUED
Mar  6 09:15:14 openmediavault kernel: [34258.966500] ata2.00: cmd 60/88:40:50:34:aa/00:00:00:00:00/40 tag 8 ncq dma 69632 in
Mar  6 09:15:14 openmediavault kernel: [34258.966500]          res 40/00:40:50:34:aa/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
Mar  6 09:15:14 openmediavault kernel: [34258.966716] ata2.00: status: { DRDY }
Mar  6 09:15:14 openmediavault kernel: [34258.966776] ata2: hard resetting link
Mar  6 09:15:14 openmediavault kernel: [34259.281564] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar  6 09:15:14 openmediavault kernel: [34259.291754] ata2.00: configured for UDMA/133

Mar  6 09:15:14 openmediavault kernel: [34259.302098] I/O error, dev sdb, sector 11154512 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 0
Mar  6 09:15:14 openmediavault kernel: [34259.302270] ata2: EH complete
Mar  6 09:17:06 openmediavault kernel: [34370.881250] ata2.00: exception Emask 0x10 SAct 0x200000 SErr 0x280100 action 0x6 frozen
Mar  6 09:17:06 openmediavault kernel: [34370.881396] ata2.00: irq_stat 0x08000000, interface fatal error
Mar  6 09:17:06 openmediavault kernel: [34370.881481] ata2: SError: { UnrecovData 10B8B BadCRC }
Mar  6 09:17:06 openmediavault kernel: [34370.881558] ata2.00: failed command: READ FPDMA QUEUED
Mar  6 09:17:06 openmediavault kernel: [34370.881631] ata2.00: cmd 60/00:a8:80:7c:99/01:00:00:00:00/40 tag 21 ncq dma 131072 in
Mar  6 09:17:06 openmediavault kernel: [34370.881631]          res 40/00:a8:80:7c:99/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
Mar  6 09:17:06 openmediavault kernel: [34370.881847] ata2.00: status: { DRDY }
Mar  6 09:17:06 openmediavault kernel: [34370.881905] ata2: hard resetting link
Mar  6 09:17:06 openmediavault kernel: [34371.196783] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar  6 09:17:06 openmediavault kernel: [34371.207202] ata2.00: configured for UDMA/133

网上查询过各种帖子,好像综合起来一个意思,那就是NCQ的问题。
https://blog.csdn.net/weixin_34081595/article/details/90683707?utm_medium=distribute.pc_relevant.none-task-blog-2~default~OPENSEARCH~default-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~OPENSEARCH~default-3.control

https://blog.csdn.net/long474080434/article/details/108340837

可是我加过一些代码,在grub 最后面加入,比如:

[root@digoal ahci]# vi /etc/default/grub 
 
GRUB_CMDLINE_LINUX="rhgb quiet libata.force=noncq"

可是并没有用,依然出错。
甚至有教程说,修改这些文件,可是重启又恢复了32.

又从其它文章了解,可能是内核对SSD支持不太好,NCQ 特性很系统有影响。

root@pve:~# cat /sys/block/sda/device/queue_depth
32
root@pve:~# cat /sys/block/sdb/device/queue_depth
1
root@pve:~# 

执行关闭对应磁盘NCQ特性。原值都是32。

echo 1 > /sys/block/sdb/device/queue_depth


有谁知道怎么解决呢?好像都是说,ncq对ssd有影响,可是debian_omv系统怎么弄呢?
一开始我以为是固态硬盘,有坏道,结果并不是。

我现在只要安装一些软件,就会报错,没办法安装软件了。比如我安装。

root@openmediavault:~# apt-get install apparmor
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apparmor is already the newest version (2.13.6-10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up proftpd-core (1.3.7a+dfsg-12+deb11u2) ...
usermod: no changes
Synchronizing state of proftpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable proftpd
Failed to enable unit: Unit file /etc/systemd/system/proftpd.service is masked.
dpkg: error processing package proftpd-core (--configure):
 installed proftpd-core package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of proftpd-mod-vroot:
 proftpd-mod-vroot depends on proftpd-abi-1.3.7a; however:
  Package proftpd-abi-1.3.7a is not installed.
  Package proftpd-core which provides proftpd-abi-1.3.7a is not configured yet.

dpkg: error processing package proftpd-mod-vroot (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openmediavault-ftp:
 openmediavault-ftp depends on proftpd-mod-vroot; however:
  Package proftpd-mod-vroot is not configured yet.

dpkg: error processing package openmediavault-ftp (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of proftpd-mod-crypto:
 proftpd-mod-crypto depends on proftpd-core (= 1.3.7a+dfsg-12+deb11u2); however:
  Package proftpd-core is not configured yet.

dpkg: error processing package proftpd-mod-crypto (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of proftpd-mod-wrap:
 proftpd-mod-wrap depends on proftpd-core (= 1.3.7a+dfsg-12+deb11u2); however:
  Package proftpd-core is not configured yet.

dpkg: error processing package proftpd-mod-wrap (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of proftpd-basic:
 proftpd-basic depends on proftpd-core; however:
  Package proftpd-core is not configured yet.
 proftpd-basic depends on proftpd-mod-wrap; however:
  Package proftpd-mod-wrap is not configured yet.
 proftpd-basic depends on proftpd-mod-crypto; however:
  Package proftpd-mod-crypto is not configured yet.

dpkg: error processing package proftpd-basic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 proftpd-core
 proftpd-mod-vroot
 openmediavault-ftp
 proftpd-mod-crypto
 proftpd-mod-wrap
 proftpd-basic
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@openmediavault:~# 


然后io也接着报错。

Mar  6 09:53:03 openmediavault kernel: [36528.159253] ata2.00: exception Emask 0x10 SAct 0x3800000 SErr 0x280100 action 0x6 frozen
Mar  6 09:53:03 openmediavault kernel: [36528.159398] ata2.00: irq_stat 0x08000000, interface fatal error
Mar  6 09:53:03 openmediavault kernel: [36528.159483] ata2: SError: { UnrecovData 10B8B BadCRC }
Mar  6 09:53:03 openmediavault kernel: [36528.159561] ata2.00: failed command: READ FPDMA QUEUED
Mar  6 09:53:03 openmediavault kernel: [36528.159634] ata2.00: cmd 60/a8:b8:30:48:47/00:00:00:00:00/40 tag 23 ncq dma 86016 in
Mar  6 09:53:03 openmediavault kernel: [36528.159634]          res 40/00:c0:20:49:47/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
Mar  6 09:53:03 openmediavault kernel: [36528.159853] ata2.00: status: { DRDY }
Mar  6 09:53:03 openmediavault kernel: [36528.159908] ata2.00: failed command: READ FPDMA QUEUED
Mar  6 09:53:03 openmediavault kernel: [36528.159980] ata2.00: cmd 60/08:c0:20:49:47/00:00:00:00:00/40 tag 24 ncq dma 4096 in
Mar  6 09:53:03 openmediavault kernel: [36528.159980]          res 40/00:c0:20:49:47/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
Mar  6 09:53:03 openmediavault kernel: [36528.160194] ata2.00: status: { DRDY }
Mar  6 09:53:03 openmediavault kernel: [36528.160248] ata2.00: failed command: READ FPDMA QUEUED
Mar  6 09:53:03 openmediavault kernel: [36528.160320] ata2.00: cmd 60/d8:c8:58:49:47/00:00:00:00:00/40 tag 25 ncq dma 110592 in
Mar  6 09:53:03 openmediavault kernel: [36528.160320]          res 40/00:c0:20:49:47/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
Mar  6 09:53:03 openmediavault kernel: [36528.160536] ata2.00: status: { DRDY }
Mar  6 09:53:03 openmediavault kernel: [36528.160593] ata2: hard resetting link
Mar  6 09:53:03 openmediavault kernel: [36528.474320] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Mar  6 09:53:03 openmediavault kernel: [36528.484339] ata2.00: configured for UDMA/133
Mar  6 09:53:03 openmediavault kernel: [36528.494456] sd 1:0:0:0: [sdb] tag#23 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
Mar  6 09:53:03 openmediavault kernel: [36528.494471] sd 1:0:0:0: [sdb] tag#23 Sense Key : Illegal Request [current] 
Mar  6 09:53:03 openmediavault kernel: [36528.494478] sd 1:0:0:0: [sdb] tag#23 Add. Sense: Unaligned write command
Mar  6 09:53:03 openmediavault kernel: [36528.494485] sd 1:0:0:0: [sdb] tag#23 CDB: Read(10) 28 00 00 47 48 30 00 00 a8 00
Mar  6 09:53:03 openmediavault kernel: [36528.494490] I/O error, dev sdb, sector 4671536 op 0x0:(READ) flags 0x80700 phys_seg 11 prio class 0
Mar  6 09:53:03 openmediavault kernel: [36528.494687] sd 1:0:0:0: [sdb] tag#24 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
Mar  6 09:53:03 openmediavault kernel: [36528.494695] sd 1:0:0:0: [sdb] tag#24 Sense Key : Illegal Request [current] 
Mar  6 09:53:03 openmediavault kernel: [36528.494701] sd 1:0:0:0: [sdb] tag#24 Add. Sense: Unaligned write command
Mar  6 09:53:03 openmediavault kernel: [36528.494707] sd 1:0:0:0: [sdb] tag#24 CDB: Read(10) 28 00 00 47 49 20 00 00 08 00
Mar  6 09:53:03 openmediavault kernel: [36528.494711] I/O error, dev sdb, sector 4671776 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
Mar  6 09:53:03 openmediavault kernel: [36528.494852] sd 1:0:0:0: [sdb] tag#25 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
Mar  6 09:53:03 openmediavault kernel: [36528.494859] sd 1:0:0:0: [sdb] tag#25 Sense Key : Illegal Request [current] 
Mar  6 09:53:03 openmediavault kernel: [36528.494867] sd 1:0:0:0: [sdb] tag#25 Add. Sense: Unaligned write command
Mar  6 09:53:03 openmediavault kernel: [36528.494872] sd 1:0:0:0: [sdb] tag#25 CDB: Read(10) 28 00 00 47 49 58 00 00 d8 00
Mar  6 09:53:03 openmediavault kernel: [36528.494876] I/O error, dev sdb, sector 4671832 op 0x0:(READ) flags 0x80700 phys_seg 14 prio class 0
Mar  6 09:53:03 openmediavault kernel: [36528.495021] ata2: EH complete

```)

  • 写回答

2条回答 默认 最新

  • 「已注销」 2023-03-06 10:07
    关注

    参考GPT和自己的思路,这错误提示看起来确实是与NCQ相关的,但是你在Grub中添加的libata.force=noncq并没有解决问题。NCQ是一种提高SATA硬盘性能的技术,它可以重排磁盘访问的顺序,以最小化磁头移动和寻道时间,但是某些硬件组合会导致NCQ功能无法正常工作,因此需要禁用NCQ。

    根据你的错误信息,你的SSD可能已经发生了一些错误,并在尝试读取某个磁盘块时引发了错误。这可能是一个物理问题,如电缆松动或硬盘故障,或者是一个逻辑问题,如文件系统损坏或坏道。

    首先,建议您在系统中运行SMART工具来查看磁盘状态并检测任何潜在的问题。您可以使用smartctl工具来执行此操作。在Debian系统中,您可以使用以下命令安装smartmontools软件包:

    sudo apt-get update
    sudo apt-get install smartmontools
    
    
    

    一旦安装完成,您可以使用以下命令检查磁盘的SMART属性:

    sudo smartctl -a /dev/sdb
    
    
    

    将命令中的 /dev/sdb 替换为您的SSD设备的正确设备名称。此命令将显示SMART属性报告,其中包含有关磁盘健康状况的详细信息。请注意任何出现在"SMART overall-health self-assessment test result"(SMART自检健康状况测试结果)行下的警告和错误。

    如果SMART报告没有发现问题,那么问题可能是文件系统损坏。您可以使用fsck工具来检查文件系统,并尝试修复任何损坏的块。确保在修复文件系统之前先卸载磁盘,以避免数据丢失。以下是一个检查和修复ext4文件系统的示例命令:

    sudo umount /dev/sdb
    sudo fsck.ext4 -f /dev/sdb
    
    
    

    将命令中的 /dev/sdb 替换为您的SSD设备的正确设备名称。此命令将检查文件系统并尝试修复任何问题。

    如果问题仍然存在,请尝试在BIOS中禁用NCQ功能。此功能通常在存储选项中,并且可能被标记为“NCQ”或“Native Command Queuing”。在禁用NCQ后,重启系统并检查是否仍然出现错误。

    如果所有这些方法都无法解决问题,那么可能需要更换SSD硬盘。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 3月7日
  • 已采纳回答 3月6日
  • 修改了问题 3月6日
  • 创建了问题 3月6日

悬赏问题

  • ¥20 如何解决访问网址被屏蔽的情况
  • ¥15 本地运行的vue2项目,使用内网穿透,前端界面一直转圈圈
  • ¥20 powerbuilder datawindow控件导出Excel数据,可不可以不自动覆盖原数据,而是在后面新插入入数据。
  • ¥100 无轴承永磁同步电机控制
  • ¥15 eps里添加本地倾斜模型
  • ¥15 telegram 问题
  • ¥15 nrf52810-c三个a 程序
  • ¥50 求一个半透明没有锯齿的圆角窗体的实现例子
  • ¥15 STM32cubeMX里的FreeRTOS无法释放内存
  • ¥15 CATIA有些零件打开直接单机确定终止