1

I want to do a quick write test of a SSD (that I bought on ebay).

I want to write a stream of pseudo random data and then read them back and compare.

Something like ("dd" omitted for clarity) :

random $seed > /dev/nvme0n1
random $seed | cmp - /dev/nvme0n1

... with maybe some flags to control "initstate" and buffer size

6
  • What's the fastest way to generate a 1 GB text file containing random digits? might be useful; my answer generates multiple gigabytes per second of random digits as text, from a hard-coded seed (like 13GB/s on a 2.5GHz Haswell laptop). If you're looking to test if the SSD does on the fly compression, though, you'd want something that doesn't dilute the entropy into printable ASCII, like just using the output of an xorshift+ generator directly. If you know C, my code should be easy to modify. Commented Dec 22, 2020 at 20:16
  • Or openssl comes with a rand(1) command-line program which can take a seed file. Commented Dec 22, 2020 at 20:23
  • Wow. That's blazing fast. For now, I just did the obvious : random() in a loop : about 400 MB/s, which is similar to the write speed of my $18 SSD. Commented Dec 23, 2020 at 6:17
  • 1
    Does this answer your question? using random to generate a random string in bash Commented Dec 23, 2020 at 6:26
  • Yeah, if you don't need high-quality randomness, running a 4 or 8 copies of a simple PRNG (with different seeds) like xorshift+ in parallel in the SIMD elements of a 32-byte register can approach memset speeds for DRAM (a CPU core significantly faster than DRAM in terms of bandwidth, not just latency). Commented Dec 23, 2020 at 6:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.