Test real and fake disks for bad blocks

Time and Throughput

For a disk with 128GB capacity and an average throughput of 85MB/s, this test takes around 50 minutes. The formula for computing the test duration is t=2*V/B (i.e., the time in seconds multiplied by the volume in megabytes divided by the average bandwidth in megabytes per second). The factor of 2 is attributable to transferring twice for writing and reading.

This results in a mean bandwidth of B=2*V/t. The exact size of the data medium can be discovered by lsblk -b /dev/$device. If you substitute the value into the formula, you can compute the bandwidth in bytes per second.

A buyer can assume a defect or a fake if measuring the data medium reveals a figure of less than a quarter of the "up to" figure stated by the manufacturer, or less than half of the nominal value. However, you do need to use a connection with the maximum speed for the test, for example, a UHS-II reader for a UHS-II memory card.

Happy Ending

Returning to my two 128GB test cards, bad block reported 122,973,232 defective blocks from a total 131,071,999 blocks (of 1024 bytes each) for the first card – in other words, 94 percent of the blocks are broken. The second card, on the other hand, showed no errors. According to the formula t=2*V/B, the test duration should be about one hour, which was true of the second card, which passed the line after about 70 minutes. The test of the first card took too long – over five hours.

The test with badblocks thus exposed the following about the first card: it was a fake with many faults and was incredibly slow. When I confronted the vendor with these hard facts, I convinced him to take back the card and refund the amount paid. The second and intact card, however, works perfectly in combination with a short SD card adapter with a pull tab as the second SSD in my laptop.

The Author

Rolf Freitag has a PhD in physics and is certified in practical computer science, neural networks, and artificial intelligence. He has been programming since 1995 and is currently working for a small business in Neu-Ulm, Germany.

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • F3: Testing Flash Memory

    USB memory sticks and flash memory cards are part of the equipment of almost every mobile IT user today, but media defects can cause data loss. A small tool by the name of F3 helps.

  • Memory Compression

    Data compression costs virtually no computing power today. Why not save some space by putting data compression techniques to work on RAM and cache memory?

  • Swapping with zRAM

    ZRAM is a faster RAM disk than other swap sources, and it’s easier on SSD drives.

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

  • Flash Filesystems

    Whirring machines with rotating stacks of disks are out. The elegant tablets and smartphones of today’s digital generation house flash memory that saves space and energy. We explain the characteristics of flash chips and suggest appropriate Linux filesystems.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More