I recently bought an SSD to upgrade my aging HP DV6227CL laptop. A few weeks after installing Ubuntu, I started experiencing occasional disk freezes during use that would require a hard reset as well as lock-ups during the boot process. When either of these things happened, the disk activity LED would stay lit indefinitely. When a lock up happened after Ubuntu was booted, I could still click around and do things that didn’t require accessing the disk.

I initially thought the SSD was failing, but two things didn’t really add up. Firstly no data corruption occurred, and secondly I could ALWAYS get to the GRUB boot selection menu. At no point in time did my laptop BIOS fail to recognize the SSD, so I figured it must be something else. This led me on a long journey down the Google-hole. Searching for strings in these error messages that appeared on my tty did the trick:

SSD_tty_errors

Namely the bit mentioning “ncq” (Native Command Queuing), led me to a solution. It turns out that the Nvidia MCP55 SATA controller doesn’t do well with high I/O SSD’s when native command queuing is enabled, as this jackpot article describes.

That page is where I found my solution, I just needed to disable NCQ in the Linux kernel. The page suggests other possible fixes such as disabling apic, acpi, among other things, but in my situation I only needed to turn off NCQ. This must be done with GRUB, as it has to be set before boot. This article gives a nice explanation of how to edit kernel boot parameters with GRUB 2 (which is what modern Ubuntu uses).

Here’s the quick explanation of how to apply the fix on Ubuntu. Open up a terminal and enter:

sudo gedit /etc/default/grub

You’re looking for the line that reads GRUB_CMDLINE_LINUX_DEFAULT. These are the options that will be set in your kernel at boot. Append libata.force=noncq to the end of the list to disable NCQ. The line in my file reads like so, but some of your parameters may be different:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ro libata.force=noncq”

After adding the option and saving the file, run in terminal:

sudo update-grub

This will update the bootloader to apply the options every time you start Ubuntu (or whichever distribution you’re using). It’s been three days since I applied this fix and have had no freezes, when prior to it I would experience multiple freezes daily.