So I have a hard drive that is failing. I want to erase the data on it before sending it for replacement. I'm trying to use dd if=/dev/zero of=/dev/sdXX, but it stops at the first write error. How can I overwrite the drive with zeros, ignoring write errors? conv=noerror seems to only affect the input file.
|
|
|||
|
try ddrescue instead of dd - it tries harder with errors |
|||
|
|
If you are just looking to wipe the drive try dban From the site: Darik's Boot and Nuke ("DBAN") is a self-contained boot disk that securely wipes the hard disks of most computers. DBAN will automatically and completely delete the contents of any hard disk that it can detect, which makes it an appropriate utility for bulk or emergency data destruction. |
|||
|
|
|
For the record, dd also has an option
To speed up the process, and potentially avoid the drive dying in mid stride, you might also try increasing the byte size from the default 512 (which makes dd read sector-by-sector, which is slow) to something larger such as 4K (which is eight times as large):
Note: With a larger byte size, skipped errors may leave sections of readable data slightly-less than the byte size you choose, but it's still unlikely that anyone would be able to get anything from those sections after the entire disk has been run through the process. Besides that, I'm sure hard drive manufacturers properly dispose of hard drives that get returned for warranty replacement, in case the drive does fail before you were able to fully complete the overwrite process. |
|||
|
|
|
Parameters I used with ddrescue to erase drive
|
||||
|
|
|
Definitely not a power-user solution, but if the write errors are rare, you might just want to continue manually after their occurence. You could theoretically script something to do that automatically, but it's not that trivial, and I'd rather write a tool to do the trick than bother with scripting dd..
|
|||
|
|
protected by Journeyman Geek Jan 7 at 14:45
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.
badblocksalso stop on errors? Perhaps you could do a destructive write with that? – oKtosiTe Dec 15 '10 at 13:57badblocksto be sure how much bad blocks are there before I return the disk on Monday. It also erased the disk successfully, but it took nearly 50 hours. – TestUser16418 Dec 19 '10 at 19:30