Question in title. Products marketed with PLP are fine, and one can open up the drive and examine the components to see if the expected hardware is there, but how do you actually go about testing that PLP is working?
"Trust--but verify." ... a wise maxim
Do you just write a continuous stream of data and yank the power cord and see what happens?
That should work ... [since you say "power
cord", I assume (in script below) you mean system power (vs SSD power)]
How do you record the last bit of data that hit the drive's cache?
[assuming
Linux] (shame on @B
you if that's a bad assumption)
Note, also, that we need to write directly to the tested SSD device itself (or a partition on it); else our "log" could lose sync with the SSD cache.
dev-name (below) should be, e.g., /dev/nvme0n1 or /dev/nvme0n1p3.
Code:
for i in {0..1000000}
do
echo -n $i "" ; dd if=/boot/vmlinuz of=dev-name oflag=direct bs=1M seek=$i count=1 2> /dev/null ; echo == $i
done
This will output:
In an attempt to (completely/significantly) fill the device cache, don't pull the cord until N (== N) reaches ~ C / (B - W)
where
C cache size (in MiB)
B bus speed (in MiB/sec)
W estimated write speed (in MiB/sec)
[Edit:] Hence, e.g.,
>>IF<< C is 100000 (~100GB) and if B is 3.2 (PCIe gen3 x4) and W is 1.2, then N = C / 2
Will probably take
a few minutes several seconds.
[Make note of that last N; at cord-pull -- so best to use actual console (or
ssh in from a different system) which won't go blank at cord-pull.]
Then, after a fresh boot, do:
Code:
od /boot/vmlinuz | head -1 | cut -d " " -f 7-9 | tr " " x > /tmp/cut-me
od -Ad dev-name | tr " " x | grep `cat /tmp/cut-me`
That last command will run (and spew) for a long time. Go have a meal, watch a show ... [It could be made a lot faster, by having originally written to a file (instead of device), but it would risk accuracy of N, if at the first ^C, the actual file metadata written lagged the (O_DIRECT) output.]
When it stops spewing, you can ctrl-C it.
For the last line output: compare the leading (decimal) number [preceding the first "x"] divided by 1048576 (1 Mi) with that N (just before cord-pull). How's your PLP? -- Did you get it all???
[Disclaimer: yes, I know I could have added " | tail -1 | ... cut ... | bc ..." instead of the ^C, but ...
]