Interpreting dd Input/Output error

  • You are using the default 512 bytes dd block size. You would significantly improve performance by using a larger block size, say 128k or even 1m.

  • There are two outputs because you are running two dd commands, the first one is the device reader and it shows an I/O error.

  • You are likely using LVM given the device name you use: /dev/Storage/Storage. Are you sure this is the whole disk and not a subset? Use lvdisplay to figure out what is behind this device name.


Look in your kernel log messages (dmesg, or /var/log/kern.log) for more detailed messages from the SATA drivers, if it was a hardware error. Also useful: smartctl -x /dev/sda. If it was just an attempt to read past the end of a partition or something, that might also show up in the kernel log.

To get dd to keep going after an i/o error, to read the readable parts that follow the error, use

dd if=... of=... conv=noerror bs=128k   # it doesn't get any faster beyond about 128k, because of L2 cache size

(As mentioned in comments on the OP, ddrescue has this and more. conv=noerror was added to GNU dd after ddrescue existed, IIRC.)

If you want to resume where you left off, you can use the seek and skip options, with conv=notrunc.


If you really want to see how far along dd is, look at the file position of its stdin:

cat /proc/$(pidof dd)/fdinfo/0  # dd opens its infile as fd #0

(or ls -lh the size of the output file). Copying a whole hard-drive worth of data 2 extra times by piping it through something seems silly to me, like it will just make your computer a tiny bit slower than needed for the hours the copy will take.

Or at least do:

dd if=... conv=noerror bs=128k | pv > Storage.img

Tags:

Linux

Dd