Jump to content

TRIM and Linux: Tread Cautiously, and Keep Backups Handy


jumperalex

Recommended Posts

Here's the list of problematic SSDs -

/* devices that don't properly handle queued TRIM commands */

Micron_M500*

Crucial_CT*M500*

Micron_M5[15]0*

Crucial_CT*M550*

Crucial_CT*MX100*

Samsung SSD 8*

 

I have a Crucial_CT240M500SSD1, included above, so I decided to research it a bit further.  The problem is that the firmware in these drives erroneously claim to be capable of handling TRIM+NCQ, a queued TRIM, but they can't actually perform it, so if Linux proceeds to send queued TRIM commands, there is a possibility of data corruption.  Windows doesn't do TRIM+NCQ so it doesn't have a problem.  Only Linux does.  But Linux has added the blacklist above that tells it to ignore the claims of these SSDs and not try it, so there should not be any problem for us, even if we have one of the drives above.  In addition, unRAID by default turns off NCQ for array drives (Disk Settings:Force NCQ disabled=Yes), because testing we did a long time ago, showed much better performance in unRAID with NCQ off, not on.  However, the Cache drive is not affected, and neither are unassigned drives.  I don't understand why SSDs would have NCQ turned on though, as it seems inapplicable to them, no head movement to optimize.  But perhaps there are other reasons to queue up the writes and TRIMS, reorder them.  It does seem possibly safer to turn off TRIM and just use scheduled fstrim commands.

 

In summary, I don't think this problem applies to us, even if we have one of the qualifying drives.

Link to comment

Good points RobJ.

 

I saw the mention about queued trims later in the evening. Also "most" of our usage patterns and the suggestion to run TRIM as a cron job (vice mounting with discard) help protect "most" people. But it is still something to keep an eye out for, another reason to disable NCQ (for those that might have enabled it), and a possible good reason to check firmware. I know I'll be updating mine this weekend for sure. The changelog specifically mentions, "Corrected error handling NCQ Trim Commands"

 

Cheers.

Link to comment

The firmware update site for most of those SSDs is ->  Crucial SSD Firmware Updates

 

I checked mine, and it hasn't been updated yet.  I already have the latest, from March 2014.

 

As far as I could tell, the only firmware updates with this fix are the ones for the MX100 and M550.

 

Here's one site for Samsung SSD firmware updates, there may be others ->  Samsung SSD Firmware Updates

 

It doesn't appear to have updates for the TRIM issue though.

Link to comment

I don't understand why SSDs would have NCQ turned on though, as it seems inapplicable to them, no head movement to optimize.

NCQ is so much more than elevator seek algorithms. SSDs, particularly larger sizes, can execute reads and writes in parallel, without NCQ you'll never get those advertised numbers. Consolidated writes reduce wear, extending flash life.

Link to comment

I don't understand why SSDs would have NCQ turned on though, as it seems inapplicable to them, no head movement to optimize.

NCQ is so much more than elevator seek algorithms. SSDs, particularly larger sizes, can execute reads and writes in parallel, without NCQ you'll never get those advertised numbers. Consolidated writes reduce wear, extending flash life.

 

Thank you!

 

I think I have begun giving up researching and knowing everything about everything.  I know I could have researched that for myself, but getting pulled too many directions.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...