You are not logged in.

#1 2015-04-18 08:49:22

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

Yesterday, I replaced the HDD of a brand new ThinkPad T550 for a Samsung 850 Pro SSD with a capacity of 256GB. I booted the machine with archlinux-2015.04.01-dual.iso, and started setup. Formatting the main partition took several minutes, and I was greeted with a bunch of error messages. Here are the first lines, copied by hand:

root@archiso ~ # mkfs.ext4 /dev/sda2
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: ^@[ 1227.636537] ata1.00: exception Emask 0x0 SAct 0x2 SErr 0x0 action 0x6 frozen
[ 1227.640017] ata1.00: failed command: SEND FPDMA QUEUED
[ 1227.643537] ata1.00: cmd 64/01:08:00:00:00/00:00:00:00:00/a0 tag 1 ncq 512 out
[ 1227.643537]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

Photo of screen:
Photo of screen showing more error messages as above

Repeating mkfs.ext4 was instant.

In a German forum about ThinkPads someone pointed me to discussions about a kernel patch. Also one could just disable NCQ (Native Command Queuing):

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

How would you resolve the issue? Could this also be faulty hardware?

Hardware details:

  • lspci reports: 00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 3)

  • CPU: Intel Core i5-5200U (Broadwell)

Offline

#2 2015-04-18 09:37:55

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

For now you should avoid using trim on your drive, you should be able to enable it once kernel 4.0 hits the stable repos. However it might be a bit slow and you will probably want to do a scheduled trim on regular intervals instead of mounting your partitions with the discard option.

That problem is most probably related to queued trim and there is a blacklist in place in the 4.0 kernel not to use that[1].

[1] http://git.kernel.org/cgit/linux/kernel … 996626221a


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2015-04-18 09:54:37

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

R00KIE wrote:

queued trim[1].

I presume, if I disable NCQ, then this should disable queued trim. Then trim would still happen, just not via NCQ.

you will probably want to do a scheduled trim on regular intervals

Even if I only disable NCQ, do I need to schedule trims manually?

As far as I understand it, trims would still happen, just immediately, i.e. not in some optimized order scheduled by NCQ.

Offline

#4 2015-04-18 10:39:00

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

If you disable ncq you may incur a speed penalty and you probably want to use that only as a temporary workaround. But you are correct, if you disable ncq you will also disable queued trim.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2015-04-18 10:57:51

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

R00KIE wrote:

If you disable ncq you may incur a speed penalty

AFAIK that's negligible on SSDs. NCQ seems to be technology primarily useful for HDDs.

if you disable ncq you will also disable queued trim.

Of course. The question is if that disables trim entirely, or if I still get non-queued trim.

Offline

#6 2015-04-18 11:48:27

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

Just found documentation in the wiki concerning the issue. One can disable NCQ using a kernel boot parameter:

libata.force=noncq

There is no mentioning that other measures are necessary to be taken, for example scheduling manual trim.

Offline

#7 2015-04-18 12:40:39

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

feklee wrote:
R00KIE wrote:

If you disable ncq you may incur a speed penalty

AFAIK that's negligible on SSDs. NCQ seems to be technology primarily useful for HDDs.

If I'm not mistaken I think I've read somewhere that this might not be the case, but since this is the internet it could have been completely wrong or I might have dreamt about it.

feklee wrote:

if you disable ncq you will also disable queued trim.

Of course. The question is if that disables trim entirely, or if I still get non-queued trim.

This would disable only queued trim, non-queued trim would still work.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2015-04-19 05:47:50

mrlamud
Member
Registered: 2014-09-27
Posts: 104

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

For someone with Samsung SSD's firmware "EXM02B6Q" - mine is 850Pro.

While installing archlinux, I cope with the same problem but only when format the first partition though installation  was successful.

Once installation finished, system operates in exellent conditions.

I would suggest not to use "discard" mount flag in fstab.
Due to NCQ error in Firmware with Linux kernel  see my log when using "discard" in fstab.

http://pastebin.com/cn01wcP4

if using mount flag “ discard” in “fstab” then when fstrim  in action your system will go freezing for a while  and your hard disk 's led will shining bright at the period.

So What?

So – to enable trim without problem with those NCQ error, I use cron. https://wiki.archlinux.org/index.php/So … M_via_cron

You have to install “cronie” package and enable cronie.service via systemd –

# systemctl enable cronie.service

By creating this script – I named it “trim”
:- Credit goto http://www.webupd8.org/2013/01/enable-t … rives.html

#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) *" >> $LOG
fstrim -v -a >> $LOG

save it ,then

#chmod +x trim

*Remark, I use -a option (trim all mounted filesystems that are supported) with fstrim command as all my partitions are ext4, if yours are not, please omit " -a" option and use mount point ( / or /home etc) instead.

Drop this script in to  /etc/cron.daily or /etc/cron.weekly or else, whatever you like.

The above script will create a log file named trim.log in /var so you can observe. For example

* Mon, 13 Apr 2015 21:41:01 +0700 *
/home: 46.7 MiB (48930816 bytes) trimmed
/amadeus: 0 B (0 bytes) trimmed
/: 0 B (0 bytes) trimmed
* Tue, 14 Apr 2015 06:40:01 +0700 *
/home: 27.6 GiB (29660880896 bytes) trimmed
/amadeus: 19.2 GiB (20596305920 bytes) trimmed
/: 22.5 GiB (24119107584 bytes) trimmed

Any suggestions or corrections will be appreciated.

Last edited by mrlamud (2015-04-19 06:12:12)

Offline

#9 2015-04-19 08:17:12

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

mrlamud wrote:

For someone with Samsung SSD's firmware "EXM02B6Q" - mine is 850Pro.

Same firmware here, according to Samsung SSD Magician DC which runs on Linux.

Just tried booting with the libata.force=noncq, and now the errors when formatting the first partition are gone.

I would suggest not to use "discard" mount flag in fstab.

Did you try combining discard and libata.force=noncq?

Last edited by feklee (2015-04-19 08:21:04)

Offline

#10 2015-04-19 08:51:03

mrlamud
Member
Registered: 2014-09-27
Posts: 104

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

feklee wrote:

Did you try combining discard and libata.force=noncq?

Yes, that was the first combination I tried but problem still persists when I had already logged in DE.

So " without discard mount flag in fstab" + "Trim via cron" work fine for me.

Offline

#11 2015-04-19 10:19:31

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

Fstrim will use queued trim if available, so it's not a solution to the problem. It might make a good compromise though as I've read that "normal" trim can slow down the system if used with the discard option.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2015-04-19 14:31:15

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

mrlamud wrote:

I had already logged in DE.

What's DE?

Offline

#13 2015-04-19 23:46:25

mrlamud
Member
Registered: 2014-09-27
Posts: 104

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

feklee wrote:

What's DE?

I mean Gnome.

Offline

#14 2015-04-20 10:33:10

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

mrlamud wrote:

I mean Gnome.

I was thinking that DE is a common abbreviation for Desktop Environment, just I didn't see any connection to the SSD issue.

Anyhow, at the moment, I run without trim at all. I've read that modern SSDs include their own optimization in firmware. Furthermore the disk is oversized. Possibly only around 10% of the capacity will be used during the next months, maybe years. That means, the SSD has a lot of fresh data cells to choose from, which is beneficial for performance, as far as I understand things.

Offline

#15 2015-04-22 05:02:39

gentoofu
Member
Registered: 2006-10-05
Posts: 34

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

feklee wrote:

Anyhow, at the moment, I run without trim at all. I've read that modern SSDs include their own optimization in firmware. Furthermore the disk is oversized. Possibly only around 10% of the capacity will be used during the next months, maybe years. That means, the SSD has a lot of fresh data cells to choose from, which is beneficial for performance, as far as I understand things.

What kind of firmware optimization? It seems the Samsung drives are heavily reliant on OS communication to let the drive know which are old dirty cells that are okay to overwrite.

http://www.samsung.com/global/business/ … tions.html
http://www.samsung.com/global/business/ … per04.html

feklee wrote:

AFAIK that's negligible on SSDs. NCQ seems to be technology primarily useful for HDDs.

According to Wiki, NCQ in SSD would be beneficial by letting the drive do something while the CPU is busy, so I've left mine on and just removed "discard" from /etc/fstab.

I actually read about the NCQ bug on this drive. I can't believe it's real, lol. I am glad this thread got posted. And I'm thankful for R00KIE's and mrlamud's insightful post smile

Offline

#16 2015-04-25 00:40:36

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

gentoofu wrote:

What kind of firmware optimization? It seems the Samsung drives are heavily reliant on OS communication to let the drive know which are old dirty cells that are okay to overwrite.

I see: Only the file system knows which space on a HDD is in use and which is not.

NCQ in SSD would be beneficial by letting the drive do something while the CPU is busy, so I've left mine on and just removed "discard" from /etc/fstab.

...which won't prevent the NCQ errors. After all, I got them during creation of the file system, i.e. before the discard option was even available.

Offline

#17 2015-04-25 07:36:52

hakova
Member
Registered: 2009-11-11
Posts: 9

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

Thank you all so much! I was trying to find a solution to this problem, and disabling trim did it for me. I will post a link of this thread to another topic for reference.

Offline

#18 2015-04-25 08:45:29

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: 850 Pro SDD in ThinkPad T550: "failed command: SEND FPDMA QUEUED"

hakova wrote:

disabling trim did it for me.

As I pointed out, likely you will still get NCQ errors. I did. The only solution that I see is disabling NCQ. Then you may switch from "discard" to manual trim. See the guide by @mrlamud (haven't tried it yet).

Offline

Board footer

Powered by FluxBB