CentOS中如何降低驱动器的SATA链接速度?

Nic*_*ick 6 hard-drive sata centos6

如何让 CentOS 在启动时以 3Gb/s 的速度运行 SATA 驱动器?

背景:

我遇到了声称支持 6Gb/s SATA 传输速度的主板的问题,但是当在其上使用 4 个驱动器时,在具有大量磁盘 IO 的软件 RAID 10 中,一些 SATA 链接开始抛出内核错误,即。ata1.00: failed command: WRITE FPDMA QUEUED. 但每次都是不同的驱动器,并不总是 ata1,并且在每个磁盘上单独运行扩展测试不会产生错误。

当错误发生时,Kernel/OS (CentOS 6.2) 最终会多次重置链接,当它继续失败时,它会将链接速度更改为 3Gb/s。一旦发生这种情况,该驱动器的错误将在会话的剩余时间内停止。

我想做的是告诉操作系统将 SATA 链接设置为 3Gb/s 以在启动时开始,因为我认为主板的 SATA 总线无法以 6Gb/s 的速度处理所有 4 个驱动器。我在主板的 BIOS 中找不到更改链接速度的选项。

问题:

  1. 我该怎么做?IE。一个配置文件?

  2. 是否可以在系统运行并组装好 RAID 阵列并安装根分区的情况下完成,或者我是否需要从应急 CD 启动?

  3. 这会导致任何数据丢失吗?我当然有备份,但重新安装/恢复是几个小时的工作,如果可能的话我想避免。

Nic*_*ick 7

MIfe 的答案在这里是一个很好的线索(+1 作为有用的参考),但并不完全完整。

要将 SATA 链接设置为 3Gb/s:

  1. 编辑/boot/grub/grub.conf

  2. 找到以 开头的行kernel。在我的身上,它是:

    kernel /vmlinuz-2.6.32-220.17.1.el6.x86_64 ro root=/dev/mapper/vg_lago-host rd_NO_LUKS LANG=en_US.UTF-8...

  3. 添加libata.force=3.0到该内核行的某处。

  4. 重启

完成上述操作后,我现在可以运行 IO 密集型操作,例如将虚拟机映像从磁盘的一个部分复制到另一部分,而不会再出现任何WRITE FPDMA QUEUED错误。


Mat*_*Ife 6

不幸的是,运行时没有任何内容(有 /sys/class/ata_link 包含只读信息)。

但是,在启动时,您似乎可以设置参数强制您想要的值。相关文档在这里:https : //www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html

Specifically 
    libata.force=   [LIBATA] Force configurations.  The format is comma
            separated list of "[ID:]VAL" where ID is
            PORT[.DEVICE].  PORT and DEVICE are decimal numbers
            matching port, link or device.  Basically, it matches
            the ATA ID string printed on console by libata.  If
            the whole ID part is omitted, the last PORT and DEVICE
            values are used.  If ID hasn't been specified yet, the
            configuration applies to all ports, links and devices.

            If only DEVICE is omitted, the parameter applies to
            the port and all links and devices behind it.  DEVICE
            number of 0 either selects the first device or the
            first fan-out link behind PMP device.  It does not
            select the host link.  DEVICE number of 15 selects the
            host link and device attached to it.

            The VAL specifies the configuration to force.  As long
            as there's no ambiguity shortcut notation is allowed.
            For example, both 1.5 and 1.5G would work for 1.5Gbps.
            The following configurations can be forced.

            * Cable type: 40c, 80c, short40c, unk, ign or sata.
              Any ID with matching PORT is used.

            * SATA link speed limit: 1.5Gbps or 3.0Gbps.

            * Transfer mode: pio[0-7], mwdma[0-4] and udma[0-7].
              udma[/][16,25,33,44,66,100,133] notation is also
              allowed.

            * [no]ncq: Turn on or off NCQ.

            * nohrst, nosrst, norst: suppress hard, soft
                          and both resets.

            * dump_id: dump IDENTIFY data.

            If there are multiple matching configurations changing
            the same attribute, the last one is used.
Run Code Online (Sandbox Code Playgroud)

从外观上看,内核参数 libata.force=3.0G 应该可以工作..

关于数据丢失,可能不是——但坦率地说,因为 SATA 供应商显然没有正确地遵守 SATA 规范(或其错误或其他),那么谁知道呢。