I have several sd micro SD cards that have a failed sector or two. But i don't see why i shouldn't be able to make a boot disk out of them. Unfortunately, dd fails when it encounters a bad sector, and ddrescue keeps trying for hours. In the end, I never get a bootable sd card. I want to know, is there any way to make a bootable sd card out of one which has a few failed sectors?
Once an SD card starts producing errors I believe it is defunct. They generally use a methodology called wear levelling (apparently often via a 32-bit ARM microcontroller) to maximize their lifespan.1
This means the addresses the card exposes are virtual, they do not literally correspond to specific physical blocks; a consequence of wear levelling is that any correspondence is prone to re-arrangement. In other words, block 106 may physically be the right after block 105, but at any point the microcontroller may change that, and this mechanism is independent of whatever computer it is plugged into and the OS accessing it. The addressing is opaque, and dynamic under the hood.
I would think the wear levelling also throws away bad physical addresses internally, but perhaps not (it may not recognize they are bad). If it exposes them:
This is a sign of bad things to come, because the wear has been leveled; if one bunch of transistors has failed, there are others that will be close to it.
You cannot isolate the physical blocks because the addressing is virtual, dynamic, and opaque.
If it isn't supposed to expose them but you are getting errors, something is even more wrong.
1. It's not required to function, but I think all major brands currently do. On a card that doesn't, you might be able to isolate the actual bad blocks, but I do not think it is a worthwhile pursuit.