Detecting (and maybe repairing?) corrupted files
July 21, 2017 12:01 PM   Subscribe

I recovered a bunch of files from a failed hard drive but it appears a chunk of them are corrupted (i.e. photos are messed up, files won't open, etc). There are all kinds: photos, music files, documents, spreadsheets . . . Is there a tool to scan through all of these and detect which ones are good and which ones aren't without manually opening each one? I'm on a Windows 10 computer. I just want to stop encountering random files that I can't open nor fix.

Also, I know about System File Checker, but these aren't system files.
posted by anonymous to Computers & Internet (3 answers total)
This is a hard problem in the general case because your filesystem doesn't care about the bytes contained in a file, so if those bytes happen to be corrupted from the expected format the system has no way of knowing. Things like System File Checker work because it has a list of files and a mechanism (usually a hash function) to determine whether the bytes in those files have changed from what is expected, but it only works because someone generated that list of files and expected hashes in advance.

Your best bet is to target specific types of files and look for utilities that can detect/repair them. For example, for MP3 music files you could use MP3Diags to do this. That said, I expect that you'll most likely be stuck hand-verifying a lot of files; in my brief poking around I saw a lot of questions like yours with mostly unsatisfactory or incomplete answers, or they required the use of software that wasn't available on Windows (like jpeginfo for checking JPEG images).
posted by Aleyn at 1:55 PM on July 21, 2017

I had a catastrophic external hard drive fail a few years ago and copied the files I could save onto my computer, mostly music. What I quickly found out was that the stuff that would play, that seemed like a totally valid file to me, was often corrupted in ridiculous ways. I found an audio book that was also half of a Garth Brooks album, for example. The file looked fine but cut off midway through into something else. I also had a bunch that were just silence after a certain point. Unfortunately I agree with Aleyn and I don't know that there are many options beyond manual ones. One thing you might be able to do with music to pick out obviously bad ones is just to look at the metadata and see if any of that is obviously super wrong or broken -- chances are that the rest of the file is in the same shape. Good luck!
posted by possibilityleft at 2:09 PM on July 21, 2017

OK, this may help a little (or maybe I'm wrong), but could you put each type of file into its own directory (mp3, pdf, jpg, etc.) and then right click the heading row in Windows Explorer and pick "More" and then pick something appropriate that each file "should" have.

For example, I went into one of my music folders and right clicked the heading line to the right of Size, and then clicked "Composers". Then if I click on (sort by) that column I see composer info, or else I see nothing if that field isn't filled in. Same thing for "Horizontal Resolution" on images, and I did "Title" and "Word Count" for Microsoft Word documents. Excel spreadsheets seemed to have "Authors". Unfortunately I couldn't find anything that seemed to come up for a folder full of PDFs.

Please note: I am not saying this proves anything, I just tried to come up with a scheme where you could look down a column of files and find suspicious files based on absent or bad metadata, and then open just them to see if they really were bad. Of course, other files might be just good enough to show decent metadata, but the rest of them could be pure trash.

posted by forthright at 7:05 PM on July 21, 2017 [1 favorite]

« Older Establishing WA state residency headaches!   |   Getting information about non-valuable old pocket... Newer »
This thread is closed to new comments.