I have bought to my kid a “2TB” external drive on AliExpress, but I have now realized that it may just come with hacked firmware, so I am looking for a tool to check the actual capacity of a mounted path without errors.
I am posting on “offtopic” because if such a tool already exists, all good, I am not going spend time on it:-)), but if it doesn’t exist, I am thinking to a Julia script that, provided with the path to lookup, the declared capacity and a chunk_size, would loop over the chunks, create random bits of chunk_size, cheksum the chunk, write it on the target path, and read back it and all the previous chunks in order to cheksum them back.
This of course would lead to a trade-off on chunk_size between speed and practicability/accuracy..
Also, perhaps you have a better idea (instead of random bits, use some sequence that has computable check-sum or that can be sampled in reading???)…
I’d write 2000 x 1GB files to the disk, containing pseudo-random data. Then read each file back and check it equals what you expect by generating the same pseudo-random data again. Count how many match. No checksums required.
Of course it seems that such tools are already widely used, e.g. “f3” (“Fight Flash Fraud”, or “Fight Fake Flash”).. there are always new things to learn…