2

I have a particular folder on a secondary hard drive with a couple of hundred JPEG files in it (specifically Steam screenshots). A couple of days ago I noticed that, with thumbnails enabled, I can no longer open this folder, either in Windows Explorer or using Steam's screenshot viewer, without the disk effectively seizing up - it reports 100% disk usage and will take an age to process any further requests. This will continue indefinitely until reboot. After a little experimenting, I tried to compress this folder using 7z. Compression actually failed, reporting two corrupt files (helpfully, it did not report their names).

After some research I switched off thumbnails temporarily and was able to open the folder. I then switched to Details view and enabled the Dimensions column, as it has been suggested that if this data is missing then the file is corrupt. The disk seized up again.

My question is - is there any way I can determine which of these several hundred files are corrupt so that I can either repair or delete them, without causing the disk to fall over?

SDsolar
  • 1,578
  • 3
  • 18
  • 30
Telvee32
  • 21
  • 3
  • Did you run chkdsk on the drive? You could also open a command prompt and copy all the files in that folder with the copy command e.g. `copy * otherfolder`. – Tesseract Oct 09 '17 at 19:50
  • You may want to check out [this question](https://superuser.com/a/276256/302907). It has both a suggested cross-platform GUI program called [Bad Peggy](https://www.coderslagoon.com/#/product/badpeggy) and demonstrates some general approaches with [ImageMagick](https://www.imagemagick.org/script/download.php#windows) and its "identify -verbose" function. – Anaksunaman Oct 09 '17 at 20:28
  • Just open a CMD, copy the while directory to some temporary space, and watch at which file it gets stuck. – Aganju Oct 09 '17 at 20:55
  • OK, BadPeggy and `copy` both seem to agree on which file is causing the issue, at least the first one alphabetically. BadPeggy reports a disk I/O issue. Is this a sign that this particular drive might be about to fail? It's about five years old, though I have not had any similar issues with it before and performance is fine. I'm also concerned about what could happen to the disk's filesystem should I try to delete this file, either via Explorer or cmd, and if by some cruel chance the operation fails (is that even possible?). – Telvee32 Oct 10 '17 at 07:40

2 Answers2

1

Since you only have a few hundred files, then I suggest that you use a binary search to figure out where the bad files are.

You start off by compressing half of the files. If it reports a bad file, then you go back and try to compress half of that set. And so on, until you find the bad file(s).

Then you go back and do the same process on the second half of the files.

While a tad laborious, this will definitely locate the bad files.

SDsolar
  • 1,578
  • 3
  • 18
  • 30
  • To find one bad file, this is a tad laborious. If there are several, it is immensely laborious. Consider: if 17 of the user’s (approximately) 200 files are bad, then any random sample of 12 or more files can be expected to contain at least one bad one. So you could compress half of the files (100), and then half of that half (a quarter, 50), then 1/8 (25), and then 1/16 (12.5), and probably every one of those 30 tests will fail. You might as well just try to compress each file individually — that would be easier to script.  … (Cont’d) – G-Man Says 'Reinstate Monica' Feb 01 '18 at 01:56
  • (Cont’d) …    Or just try to copy them all, as suggested by [Aganju](https://superuser.com/q/1257624/354511#comment1849003_1257624). – G-Man Says 'Reinstate Monica' Feb 01 '18 at 01:56
0

Had that same issue. I used the Windows resource monitor, disk TAB to find out which files explorer was accessing. Deleted the files.

Joep van Steen
  • 4,730
  • 1
  • 17
  • 34