I wrote this tool a while back and posted it up on github but never advertised it. I’m a bit of a data hoarder and as a result have had to deal with dying harddrives many a times. I never found dd or badblocks to be as useful as I’d like and certainly not safe enough. On more than one occasion I’ve fat fingered the overwriting of a good drive after the OS decided to change the device name of a drive I was working on. As a result I cracked open the ATA specs and wrote a much safer, more featureful tool for scanning hard drives and attempting the reallocation of blocks.
Quick rundown of features:
- readonly scanning of bad blocks
- safe ‘fix’ mode which won’t overwrite good blocks
- burnin mode for checking new drives
- manual marking blocks as corrupted
- find files given list of blocks
- dump list of files and associated block ranges
- dump list of blocks used by a file
Technically this tool should work on SSDs as well but I’m not sure they react the same way to error conditions.
Find out more over at github: https://github.com/trapexit/bbf