How to retrieve data after experiencing read errors on a USB stick
So I figured I’d post this handy piece of info. Ever have to copy data from a USB stick and run into read errors. I just did
So aside from the fact I have some shitty USB keys, I really needed to save the data on this 4GB stick. I was able to retrieve the whole partition using gddrescue. You can grab it from Ubuntu ppa..
sfeole@sfeolework:~$ apt-cache policy gddrescue
*** 1.14-1 0
500 http://us.archive.ubuntu.com/ubuntu/ oneiric/universe amd64 Packages
Read more about it here:
So by carrying out the following I was able to pull the partition off my USB stick, this copies the data block for block.
sfeole@sfeolework:~$ time sudo ddrescue -r3 -f /dev/sdb my4gusb.img
Press Ctrl-C to interrupt
rescued: 4012 MB, errsize: 0 B, current rate: 18481 kB/s
ipos: 4012 MB, errors: 0, average rate: 17958 kB/s
opos: 4012 MB, time from last successful read: 0 s
From here I was able to use a fresh new USB stick and DD my image back.
sfeole@sfeolework:~$dd if=my4gusb.img of=/dev/sdb