jueves, 16 de marzo de 2017

How to copy a file with I/O errors?

Sometimes we need (yes, really NEEEEEED) access a file from a damaged hard disk without recent backup.

If we try do it manually we can obtain errors and the operation can be aborted. In other cases the damaged disk can block the entire system. This is because the operating system want to give us the entire original file, without errors. If the disk responses with a error in a certain block (1Kb) inside a large file (1 Gb) the operating system won't give us the file. But we want the 99% of the file that is ok. (i.e., If the file requested file is a video, we don't care lose 1 seg.)

Short Answer:

$ dd if=/media/_MYDISK_/file.mp4 of=file.mp4 conv=noerror,sync

if= path to the original file, in the damaged filesystem
of = path to the destination file, in a safe filesystem
conv = noerrors, sync Ignore all errors and continue!!!!!!

That doesn't mean the copied file haven't any errors. After copy it, we will need specific tools to repair it. Sometimes the file format is "fault tolerant" and when we'll open it with his software (i.e. Word, Zip...) it'll be auto-repaired. In other cases we'll loose part of our data, but not all.

Long Answer: Blog of Aeroquartet

0 comentarios:

Publicar un comentario