Linux How To Disable SATA NCQ For Better Performance

This is the closest way to disabling it without using the "libata.force=noncq" kernel boot option is to set the queue to a depth of 1 which doesn't actually disable it.

Change the sdc below to match the device you want to disable NCQ for.

[root@officebox ~]# echo "1" > /sys/block/sdc/device/queue_depth

Errors that indicate you are having a performance issue are these in messages or dmesg relating to NCQ and SATA bus timeout and reset are killing your IO performance!

 

Apr 12 12:12:50 officebox kernel: ata8: EH in SWNCQ mode,QC:qc_active 0x400FFFFF sactive 0x400FFFFF
Apr 12 12:12:50 officebox kernel: ata8: SWNCQ:qc_active 0x40000007 defer_bits 0xFFFF8 last_issue_tag 0x2
Apr 12 12:12:50 officebox kernel:  dhfis 0x40000003 dmafis 0x40000008 sdbfis 0x0
Apr 12 12:12:50 officebox kernel: ata8: ATA_REG 0x51 ERR_REG 0x84
Apr 12 12:12:50 officebox kernel: ata8: tag : dhfis dmafis sdbfis sacitve
Apr 12 12:12:50 officebox kernel: ata8: tag 0x0: 1 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x1: 1 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x2: 0 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x1e: 1 1 0 1 
Apr 12 12:12:50 officebox kernel: ata8.00: exception Emask 0x1 SAct 0x400fffff SErr 0x0 action 0x6 frozen
Apr 12 12:12:50 officebox kernel: ata8.00: Ata error. fis:0x21
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/08:00:bf:83:8b/00:00:02:00:00/40 tag 0 ncq 4096 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/10:08:c7:83:8b/00:00:02:00:00/40 tag 1 ncq 8192 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/18:10:d7:83:8b/00:00:02:00:00/40 tag 2 ncq 12288 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/10:18:ef:83:8b/00:00:02:00:00/40 tag 3 ncq 8192 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)

:
 


Tags:

linux, disable, sata, ncq, performancethis, disabling, quot, libata, noncq, kernel, queue, depth, doesn, sdc, officebox, echo, sys, queue_depth, errors, indicate, dmesg, relating, timeout, reset, io, apr, ata, swncq, mode, qc, qc_active, fffff, sactive, defer_bits, xffff, last_issue_tag, dhfis, dmafis, sdbfis, ata_reg, err_reg, sacitve, exception, emask, sact, serr, fis, fpdma, queued, cmd, bf, res, drdy, err, icrc, abrt, ef,

Latest Articles

  • ImageMagick Convert PDF Not Authorized
  • ImageMagick Converted PDF to JPEG some files have a black background solution
  • Linux Mint Mate Customize the Lock screen messages and hide username and real name
  • Ubuntu/Gnome/Mint/Centos How To Take a partial screenshot
  • ssh how to verify your host key / avoid MIM attacks
  • Cisco IP Phone CP-8845 8800/8900 Series How To Reset To Factory Settings Instructions
  • ls how to list ONLY directories
  • How to encrypt your SSH private key file id_rsa
  • Linux Mint 18 Disable User Name List from showing on Login Screen
  • Firefox Cannot Hit Enter Key In Address Bar and Location History Not Working
  • Cisco Unified Communications Manager / CUCM IP 8.6,10,12 Install Error Solution
  • Ubuntu Debian Mint Linux SSHD OpenSSH Server Not Starting After Reboot Solution
  • nmap how to scan for all ports and not just the 1000 most common ports
  • Windows 7,8,10 and Server 2008, 2012, 2016, 2019 Read Only Attribute Won't Go Away
  • bind / named how to make a wildcard record and retain defined A records
  • Cisco Unified Communications Manager 12 Install Errors on Proxmox/KVM
  • Local Vs Universally Administered MAC Address NIC Refuses to come up
  • Cisco Unified Communications Manager 12 CUCM 12 - How To Enable Video Calling
  • Windows 7, 8, 10, Windows Server 2008, 2012, 2016, 2019 How To AC97 Audio Drivers and Other Unsigned Drivers
  • Cisco Unified Communications Manager / CUCM IP Telephony Definitions