Dm-remap - A new Linux kernel device-mapper target

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:

GitHub - amigatomte/dm-remap: dm-remap is a custom Linux Device Mapper (DM) target that emulates firmware-level bad sector remapping in software. It allows you to dynamically redirect I/O from failing sectors to a reserved pool of spare sectors, creating a resilient virtual block device on top of degraded hardware..

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.

2 Likes