There are probably better tools but if you want simple and free then you want dd.
Assuming your non-windows is some flavor of Linux or Unix and your cards are empty of any data you want to keep then you can try this:
mount the CF card in your reader, and get its device name. I'm going to assume it's /dev/CF for purposes of this answer. Login as root.
To write the card full with random data
dd if=/dev/random of=/dev/CF bs=1k
You can do this a couple of times (how many is up to you) and if it gets an error before it finishes the whole card then it's a problem with the card.
You can check the read function of the card this way:
dd if=/dev/CF of=/dev/null bs=1k
It should read the entire card with no errors.
When you're finished you will want to reformat the card. First, write the card full of zeros so it can then be formatted in your camera:
dd if=/dev/zero of=/dev/CF bs=1k
This should write the whole card without error.
My personal opinion is that if you get ANY errors then RMA the card. I wouldn't try to re-use it by re-mapping the bad blocks.
Be aware that even if the card(s) pass the above tests it doesn't mean they're guaranteed good. It MIGHT mean an intermittent error which takes a bit longer than you thought to show itself. On the other hand if it FAILS then you have some data on which to base your RMA decision and some supporting documentation to give Sandisk to justify the RMA.
The SD Card Association actually does not recommend using just any formatting utility, including the one provided by the OS. Instead they have developed their own software called SD Formatter, which they recommend for the following reason:
This software formats all SD memory cards, SDHC memory cards and SDXC memory cards. SD Formatter provides quick and easy access to the full capabilities of your SD, SDHC and SDXC memory cards.
The SD Formatter was created specifically for memory cards using the SD/SDHC/SDXC standards. It is strongly recommended to use the SD Formatter instead of formatting utilities provided with operating systems that format various types of storage media. Using generic formatting utilities may result in less than optimal performance for your memory cards.
The SD/SDHC/SDXC memory cards have a "Protected Area" on the card for the SD standard's security function. The SD Formatter does not format the "Protected Area". Please use appropriate application software or SD-compatible device that provides SD security function to format the "Protected Area" in the memory card.
Try the Full Erase or Full Overwrite options with your card.
Best Answer
Have you checked if you are using the proper microSD for your device? For instance, I had a family friend using a class 4 SD card that resulted in a corrupted disk - when they upgraded to a class 10 they did not have any issues. The fact that it cannot read/write on any device even after being formatted leads me to believe this is probably not the solution, but check that out and make sure as it could be something small like that.
Could you share with us:
What device are you using that is corrupting the MicroSD's? (FYI I'm reading here that it may be an issue with Android 7.0 and/or common with the Moto G5)
What MicroSD's have you tried thus far?
Also a few troubleshooting tips:
If possible, format the MicroSD using the device itself rather than an external device - conversely, if you have only tried formatting the MicroSD using the device itself, try formatting on a different device.
Try to pay attention to when the MicroSD gets corrupted (i.e. when you power down the phone then power back on it is corrupted; when you try to move files to or from the disk, when you connect the device via USB and the newly connected device tries to read from or write to the MicroSD etc.)
If the MicroSD is immediately corrupted when inserted into your device, try a new MicroSD on a different device first to make sure you don't just have really bad luck with faulty MicroSD's
Run chkdsk on the MicroSD before and after it is used/corrupted
Assign a new drive letter to the MicroSD. I have heard of this being a fix in pretty specific situations but is worth giving a shot.
Hope this helps, please update with any developments!