20/03/2015

How to copy a file with I/O errors?

By snorlaxprime

If you encounter the following error

To salvage all readable data, we will use a fault-tolerant copy utility called dd.

dd stands for “disk duplication”. This is a command-line utility bundled with Mac OS X. A free version for Windows is also available for download.

Be extremely careful, even if you are familiar with command line, because dd can cause unrecoverable damage to your data if you don’t specify correctly input and output. You have been warned.

The arguments of dd are straight-forward:

if=path_of_file_with_IO_errors specifies input path
of=path_of_clean_copy_to_create specifies output path
conv=noerror,sync tells dd to be fault-tolerant