How to erase a hard drive with unwritable sectors?

try ddrescue instead of dd - it tries harder with errors


Parameters I used with ddrescue to erase drive /dev/sdb (filled with zeros from /dev/zero) and log output into file log.txt (replace sdX with sdb):

ddrescue --force /dev/zero /dev/sdX log.txt