I have an old 320 GB laptop hard drive that I'm getting ready to sell (or donate). To prepare it, I'm using dd
to write one pass of random data, then one pass of zeros:
dd if=/dev/urandom of=/dev/sdb
dd if=/dev/zero of=/dev/sdb
In both cases, it gets almost to the end of the disk and then fails with:
dd: error writing '/dev/sdb': Input/output error
Using od /dev/sdb
to verify the zero write, I see:
0000000 000000 000000 000000 000000 000000 000000 000000 000000
*
4520565200000 150636 113232 106346 032136 015617 116562 007414 032774
4520565200020 122317 125101 056551 105476 117454 153132 054340 177042
4520565200040 036343 143567 116241 045303 146340 016110 034246 150020
...snip...
4520565257720 100673 143151 002110 144654 065605 120456 070460 106051
4520565257740 032350 125132 022255 032441 074515 142667 117313 127115
4520565257760 035414 166734 072432 032526 061274 137236 117436 156032
4520565260000
...which indicates to me that the zeroing mostly succeeded, but the last (4520565260000 - 4520565200000 = 60000 octal
) 24 kB of the disk still has non-zero (and likely non-random) data on it.
This disk is attached via an external USB-to-SATA adapter. I tried it under both Ubuntu and Cygwin, and saw the same result in both cases.
Is there some option I should be passing to dd
that would help, or is this the disk just physically bad? I've never had an issue with it, and it never showed any bad sectors when it used to hold an NTFS filesystem.