1
1
I'm running Cygwin on Windows 7.
I was using the following dd
command to securely erase a 1TB mechanical disk:
dd if=/dev/zero of=/dev/sde bs=4M status=progress
About 2 and a half hours into the wipe, around the time I was expecting it to complete and after successfully writing about 930GB (or GiB, more likely) to the disk, I got the error:
dd: error writing '/dev/sde': Input/output error
I ran the command again with seek
to try and reproduce the error by zero-writing the last few gigabytes of the file:
dd if=/dev/zero of=/dev/sde bs=4M status=progress seek=231100
...and sure enough I got the same error:
dd: error writing '/dev/sde': Input/output error
7368+0 records in
7367+0 records out
35196174335 bytes (35 GB, 33 GiB) copied, 405.703 s, 86.8 MB/s
It seems that the wipe ran successfully, but if that was the case, then why is the error being generated?
Is it normal? If not, how can I avoid it?
Sounds like a bad sector to me. – Tom Yan – 2019-11-28T06:43:56.260
@TomYan If that is the case, shouldn't
dd
just fill it with zeroes? Or shouldn't ddrescue at least be able to deal with it? I also tried runningddrescue --force /dev/zero /dev/sdX
but got the exact same "Input/output error". – Hashim – 2019-11-29T01:39:33.917Why would they? At least that's not what they would/could do when they bump into a bad sector. (For the ddrescue case, you are talking about writing to a disk with bad sector, not reading / recovering from it.) – Tom Yan – 2019-11-29T01:49:51.640
1Your
dd
command does not specify a termination, e.g. acount=
parameter. The /dev/zero pseudo-device for input has infinite length. The only way for the command to terminate is when it tries to write past the end of the device. Hence the "error". Look at the statistics thatdd
reports. Is the "number of bytes copied" represent the entire HDD? – sawdust – 2019-11-30T03:02:40.6801What does
dd if=/dev/zero of=/dev/sda count=1
give when run withseek=1953525119
,seek=1953525120
andseek=1953525121
respectively? – Tom Yan – 2019-12-02T11:27:28.060