Per recent postings on HN about /dev/urandom, wouldn't it fine to use data from that, rather than bothering with AES output. /dev/urandom should be cryptographically safe.
1. Test N blocks of the disk, where N is small enough that you can keep a 128-bit hash of each block of random test data in memory for the duration of the test. You can use the hashes to verify that read data is correct.
2. Then test another Nb/8 blocks using the N blocks from #1 to store 128-bit hashes of the Nb/8 test blocks.
3. Then test N(1+b/8)/8 blocks, using the blocks from #1 and #2 to hold the hashes.
4. Then test N(1+b/8 + b/8^2)/8 blocks, using the blocks from #1 and #2 and #3 to hold the hashes.
...
(Maybe replace the 8's in that with 7's, and in each block of hashes include a hash of the 7 hashes, so you can check that hash blocks are reading back fine?)
jpdaigle|6 years ago
If you write random bytes then read them back, you have nothing to compare them to.
JoachimSchipper|6 years ago
tee /dev/the/disk </dev/urandom | sha256sum
and
sha256sum /dev/the/disk
should also work fine.
tzs|6 years ago
1. Test N blocks of the disk, where N is small enough that you can keep a 128-bit hash of each block of random test data in memory for the duration of the test. You can use the hashes to verify that read data is correct.
2. Then test another Nb/8 blocks using the N blocks from #1 to store 128-bit hashes of the Nb/8 test blocks.
3. Then test N(1+b/8)/8 blocks, using the blocks from #1 and #2 to hold the hashes.
4. Then test N(1+b/8 + b/8^2)/8 blocks, using the blocks from #1 and #2 and #3 to hold the hashes.
...
(Maybe replace the 8's in that with 7's, and in each block of hashes include a hash of the 7 hashes, so you can check that hash blocks are reading back fine?)
JensRex|6 years ago
rini17|6 years ago