Hello,
A while ago I had a disk that developed so many bad sectors that the firmware ran out of spare sectors to remap. I wanted to keep using it until it finally gave up (for science…). That experiment spiralled into writing a Linux kernel device-mapper target, with lots of assistance from AI along the way. It’s now starting to work.
The project is called dm-remap:
What it does:
• Emulates firmware-level bad sector remapping in software
• Transparently redirects I/O to a reserved pool of spare sectors
• Provides a resilient virtual block device on top of degraded hardware
If you’re curious, please give it a try. Feedback, bug reports, and ideas for improvement are very welcome.
..and of course don’t use it for anything important! This is highly experimental.