Less than 2 months ago, I ordered a thumb drive (cheap one). I used it the day it arrived and I think about 3 days after that. Merely checked it with badblocks and then
dd-ed a Linux image into it. It sat on a tray since and wasn't touched.
When I connected it today, I wanted to first check the integrity of the image on it. Didn't check out as I always got input/output errors when trying to read from the thumb drive:
$ sudo dd if=/dev/sdb of=/dev/null bs=1M dd: error reading '/dev/sdb': Input/output error 162+1 records in 162+1 records out 170524672 bytes (171 MB, 163 MiB) copied, 7.75699 s, 22.0 MB/s $ sudo dd if=/dev/sdb of=/dev/null bs=1M dd: error reading '/dev/sdb': Input/output error 74+1 records in 74+1 records out 78381056 bytes (78 MB, 75 MiB) copied, 3.81105 s, 20.6 MB/s $ sudo dd if=/dev/sdb of=/dev/null bs=1M dd: error reading '/dev/sdb': Input/output error 22+1 records in 22+1 records out 23461888 bytes (23 MB, 22 MiB) copied, 1.45307 s, 16.1 MB/s $ sudo dd if=/dev/sdb of=/dev/null bs=1M dd: error reading '/dev/sdb': Input/output error 41+0 records in 41+0 records out 42991616 bytes (43 MB, 41 MiB) copied, 2.30087 s, 18.7 MB/s $ sudo dd if=/dev/sdb of=/dev/null bs=1M dd: error reading '/dev/sdb': Input/output error 37+1 records in 37+1 records out 39321600 bytes (39 MB, 38 MiB) copied, 2.16684 s, 18.1 MB/s
The weird thing is that it always fails in different spots. Even managed to read over 300 MiB once, I think (16 GB thumb drive) (but I didn't check whether the read data was correct unfortunately).
Broken thumb drive. Who cares, right?
I then got curious and wanted to see when writing failed, just for the heck of it before throwing it way. The weird thing is: It didn't. I merely
/dev/zero onto it. After being surprised by this behavior, I
dd as many 1 MiB blocks back from the stick as possible and piped them into
sha256sum. Not only did I not receive an input/output error, but the sha256sum of it also checked out with the sha256sum taken directly from
/dev/zero (with the same number of blocks).
After being surprised by this behavior, I unplugged it for 3 hours and ran
badblocks on it: https://pastebin.com/y5SATDQq
I'm very surprised by this behavior. Why is this?
Regarding the close vote: I'm running this on it and will edit this question after it finished. I don't think it's economically viable to fake 16 GB thumb drives, these days. I bought an obviously fake one (allegedly 128 GB or 256 GB or something like that but way too cheap for that to be true) once (for experimenting) and it turned out to actually be a 16 GB thumb drive. Plus, this one has over 1'500 reviews on Amazon and an average of 4 out of 5 stars. And it is sold by the manufacturer itself (Intenso).
Okay, this one failed: https://pastebin.com/xZ5VRpf2
But I then created an ext4 file system on the thumb drive and did this: https://pastebin.com/P1CCsDJT
The pastebin paste contains comments as to what I did to figure this out.
It read more than half the data back correctly and therefore can't be a fake thumb drive. In fact, only a single 1000 MiB block was corrupted. It can't be a fake thumb drive.