I recently bought a generic 32Gb card on
and got what I paid for - a bunch of bad sectors which makes my recorded videos unplayable when it reaches a bad frame.
The actual fraction of bad blocks is pretty low ~ 0.001, but I can't get format to recognize them as bad. I tried using the badblocks program to detect them:
badblocks -b 512 -v -w /dev/mmcblk0p1 4296000 4096000
Checking for bad blocks in read-write mode
From block 4096000 to 4296000
Testing with pattern 0xaa: done
Reading and comparing: 4169376
After running the test twice on the same range of 200k 512byte blocks, I get about ~167 bad blocks, but the problem is that the block #s are different due to wear leveling, so I don't think the blocks can be marked bad at the file system level. The persistent # bad blocks suggests the card doesn't remap bad blocks, which would be a real bummer.
Is there anything I can do about them, or am I out of luck? Namely, does anyone know the details of wear leveling, so I can mark all logical sectors that can map to a bad physical block as bad?