I am copying from a damaged HDD (not SDD) where about 15% files would cause I/O error. I only want the rest of the 85% complete files, and get a list of damanged files. How to do that?
cp stops on the first read error. scp/rsync complains and deletes the copy (wanted) and quit (unwanted). There is no way to continue after an I/O error, at least not found by reading rsync(1) manual.
I Googled for a long while, all posts are about other needs:
- telling the poster that the IO error means hard disk is damanged (I know it);
- telling the poster a way to copy the good sections of a single file, fill damaged data with zeros (I have 100k files each less than 10KB, and damanged files are no use to me, even if only one byte is missing);
- telling the poster how to repeattedly run rsync (over network) to fight bad connection and finish the copy.
- telling the poster how to change default timeout to let rsync try harder to read the files (I don't wish to do this)
- telling the poster to run fsck to fix the file system error.
Thanks for reading the list of unwanted answers!
Note: This is a disk with physical damage, confirmed by the proper diagnostic tools. I've also run a thorough fsck.