Open i3v opened 8 years ago
Can DZAT be detected on HDDs behind RAID?
The main use case for trimcheck is checking whether TRIM passthrough is working on the storage controller.
Perhaps it would still be possible to detect DZAT by writing less than a page to a trimmed page... if the page actually has been trimmed, then the data on the remainder of the page should be lost.
Can DZAT be detected on HDDs behind RAID?
I'm not 100% sure, but it looks like this is possible. ( Moreover, I'm not an expert in this field, and I've got zero practical programming experience here. )
Here's a post, that provides some details about DRAT/DZAT, including a link to an official doc. So, they are talking about the ATA IDENTIFY command word169->bit0
, word69->bit14
and word69->bit5
.
Personally, I'm dealing with 2 PCs: For the PC I've already mentioned (self-assembled, with PCIe "Kingston SHPM2280P2H/480G", OC34L5TP firmware), Intel Solid-State Drive Toolbox version 3.3.5 on Windows 10 shows the following drive details:
word169->bit0 = 1
(supported)word69->bit14 = 0
(deterministic read after trim = false)word69->bit5 = 0
(not sure what this means, cause the table says "reserved". Probably, that's an imminent result of word69->bit14 = 0
).My experiments with trimcheck-0.7-win64.exe
typically give “not kicked in yet” for weeks, then “INDETERMINATE” (I’ve seen “TRIM is working” once) . By the way, the rumors, that windows does not support PCIe SSDs do not apply here, cause “Kingston SHPM2280P2H” just emulates standard ACHI controller + disk.
Next, on another my PC (Dell 7910, "Micron M550 512GB SSD" with DL06 firmware, attached to "LSI SAS3 3008 Fury" RAID controller), same Intel SSD Toolbox, on Windows 7 is unable to obtain any drive details. Not sure why. But, hdsentinel still shows that "Deterministic read after Trim" is supported. I suspect that it reads the same info somehow. So, there might be some caveats, with reading this data through a RAID controller, but it looks like this is possible.
Perhaps it would still be possible to detect DZAT by writing less than a page to a trimmed page... if the page actually has been trimmed, then the data on the remainder of the page should be lost.
Hm... The “page” is a minimal “addressable volume” for the write operation, and “block” is a minimal addressable volume for erase operations. And each page within a block could only be written once after the whole block is erased. So, regardless of TRIM, the non-written part of the page should be zero, AFAIU. Moreover, other non-written pages within the same block should be zero too.
The problem is, AFAIU, only SSD controller knows "which LBAs is assigned to a specific page" == “the LBA to PBA translation table” == FTL.
So, I’m not sure I understood you correctly… Do you mean “it is possible to detect if-TRIM-is-functioning-OK for non-DZAT SSD by writing few pages, less than a complete block, to a trimmed block”?
I’d say this approach should work…. But the whole procedure would look significantly different from the current implementation… At least for me it looks like this:
trimcheck-0.7-win64.exe
typically give “not kicked in yet” for weeks, and then “INDETERMINATE” or, rarely, "TRIM is working". It's a pure speculation, but it looks like it means they decided to keep the corresponding part of the FTL as is (why change it?) as long as this whole part of the FTL won’t get “refreshed” for some reason. And the "this page is invalidated" information is stored elsewhere.Few additional sidenotes:
FlushFileBuffers()
, which may not actually work due if Turn off Windows write-cache buffer flushing on the device is enabled – looks like another thing to document down… Or maybe even to throw a warning, if it’s detected...Sorry for such a long post :)
Thank you for your very detailed analysis.
Unfortunately, this is much more involved than I can afford to work on right now. I've moved all my physical machines on Linux (where I use software RAID with BTRFS), and only run Windows in a VM, so no longer have any machines where I can test the program. Furthermore, as far as I know, all my SSDs do support DZAT.
The suggestion to detect DZAT through ATA commands is reasonable, however it would be a new endeavor for trimcheck, as it does not interface with drives directly, and only operates through Windows file system and volume I/O APIs.
For now, I pushed a small change adding a mention regarding DZAT to "not working" results.
You seem to have done a great deal of research on the subject. If you are interested in formulating it as a pull request, or even take over maintenance of the program, I would be glad to help where I can.
Thanks for your kind proposal! Unfortunately, currently I don't have enough free time either... Thanks for the modifications you've pushed - I believe that the most important thing here is to warn user, that things might be more difficult for non-DZAT SSDs.
just read through this, i have a mx500 1TB and 2TB and neither report DRAT as supported under ATA features
with no writes to either "TRIM" returns as indeterministic after 20 seconds.
these devices use the Silicon Motion SM2258 controller.
I suspect, that the proposed method may not work, if SSD does not support DZAT (Deterministic Read Zero After Trim). This document provides some details, related to DZAT vs Deterministic Read After Trim (DRAT). Missing these two "features" does not actually mean missing TRIM.
Here's a post about an SSD that only supports DRAT.
Another example: my "Kingston SHPM2280P2H/480G" seem to have neither DRAT nor DZAT, at least hdsentinel shows that "Deterministic read after Trim" is not supported. Thus, trimcheck-0.7-win64.exe shows that TRIM is off. Still, my Windows 10 correctly detects that this drive is an SSD (disk optimizer tool suggests to TRIM, not to defragment). And hdd sentinel shows that TRIM is supported and functioning (even though I do not understand how it checks this).
Finally, here's one more story about a combination of the parameters.