Use ddrescue
. It will continue after errors, where dd
will simply fail.
Additionally, ddrescue
is in the repos. On 13.04, I typed sudo apt-get install gddrescue
to install.
Use sudo fdisk -l
or dmesg
to figure out the device location eg: /dev/sdb
, then run a command such as
ddrescue /dev/sdb /home/user/desktop/bkp.img
there are many options to ddrescue
, and you may want to read the man
pages. Also I'm not sure why your hardware is failing, and dumping dd
. One bad block could make dd
quit, but so could intermittent power failures. dmesg
may tell you more about hardware failures you may be experiencing.
MAKE SURE the device is not mounted! when you try to do data recovery, imaging, etc. This may cause problems.
There is a lot of things that can go wrong in data recovery. Post back if you have problems. testdisk
is a nice utility for doing data recovery once you have an image.
Just for clarity, is this a usb hard drive or usb (solid state memory) device?
I/O errors are typically indicative of hardware malfunctions rather than file-system corruptions.
Also try obtaining the SMART data analysis of the device, if it is available. This may tell you things like if the device his been over heating, powered on for a long time, has bad sectors, exposed to more than X no. of Gs etc.
/dev/sdx
pointing to the USB stick, there is a serious problem, and I think that there are no tools available to normal users, that will work. See this link for more details, askubuntu.com/questions/144852/…; Do not give up at once. Try according to the list of things that might get reading to work. Maybe you can pull the USB pendrive apart and find a micro SD card, that is still working according to the comment by @ubfan1 (at the linked answer).