My MacMini hdd, some months ago, stopped booting.
Upon inspection, seemly a tiny amount of sectors got corrupted, but in system-related areas, and OSX went bonkers and destroyed half of my data while trying to fix itself, and made the disk entirely unusable.
While the HDD has only 13 sectors "pending", and 0 permanent bad blocks, and 0 reallocated, I couldn't figure how to use it.
I ended grabbing another HDD I had, that has 300+ actually broken blocks, and used that one as my new boot HDD...
And it worked! Except it is obviously in a much worse shape than the original, I've been using it for months, but I am started to get worried it might die suddenly (although so far I don't got even a corrupted data issue!)
I learned that on Linux you can use a command caled "badblocks" to find all... badblocks. And then use mkfs to create the file systems avoiding such bad blocks.
But "badblocks" is slow, and destructive, so before attempting using a Linux tool on OSX HDD, I wanted to know if there is a OSX tool for that: write data on the entire HDD (triggering SMART to reallocate, or decide that some sector was okay after all, for the entire HDD), and then put it back to be used as my main OSX disk (And use the worringly bad one as backup).
And please, don't tell me to buy an HDD, I just can't afford one, if I could, I would not be "wasting" time doing HDD gymnastics like this.