Page 1 of 1

Photoshop file corruption and external drives

Posted: Wed Dec 19, 2007 8:32 pm
by paonessa
After spending several hours on a Photoshop CS3 PSD file for printing, I saved it, opened it the next day, and discovered that various layers were corrupted. I'm hoping someone here will have an idea what the heck is going on.

In this large (ca. 900 MB) 16 bit RGB file, I had eight curves adjustment layers, each with a layer mask. The corruption was in the form of small rectangles of varying density randomly added to the layer masks.

If I repaired these, saved the file, and then re-opened it, this corruption would occur again -- except randomly through various layers. As far as I can tell, the corruption occurs when saving the file to disk. It doesn't appear in the file while it's "live" in PS, only when it's saved, closed and then re-opened.

I have had similar corruption problems in the past. It always takes the form of a rectangular area that is messed up in one or more layers. I had hoped this problem might go away when I upgraded to a new PC recently, but obviously that didn't fix it.

In the present case I was able to "fix" the problem (or at least make it temporarily go away) by resetting the Preferences in both Photoshop and Bridge (by holding Ctrl-Alt-Shift while launching each program -- not sure if Bridge was involved, but reset it anyway).

I'm worried that this problem may somehow be related to my external hard drives. One thing that resetting the Preferences did was reset the Scratch Disk to my boot drive, and away from my external drives. I was surprised to find that Adobe recommends against saving files to external and network drives. See http://kb.adobe.com/selfservice/viewContent.do?externalId=332534&sliceId=1

In my case, I have an external box with four SATA hard drives, connected via a RocketRaid 2224 RAID card and an external SATA "Multilane" or "Infiniband" cable. The drives are not in a RAID array, but instead are set to be independent drives. This box was also on the old PC (where random corruption was also occurring).

I'm not sure of this, but this corruption may only happen in very large files (500-1000 MB), which may bring the Scratch Disks into play. On the old PC (Windows XP) I had 2 GB of RAM. The new machine, which I built, has:

Intel Q6600 CPU
Gigabyte GA-P35-DS4 Intel P35 Motherboard
XFX GeForce 8600GT 256MB 128-bit Video Card
4GB RAM - Corsair SDRAM DDR2 800 (PC2 6400)
Windows Vista Ultimate
Boot drive Western Digital Raptor 10K rpm SATA
5 additional hard drives -- all Westeren Digital SATA 250 GB or 500 GB (1 internal, 4 in external SATA box)
RocketRaid 2224 RAID card PCI-X

This really has me worried! How do I ensure that each time I save a file, it doesn't become corrupted?! I'm a little astounded to see Adobe "recommend" against external hard drives:
If you use Photoshop CS2 without Adobe Creative Suite, Adobe Technical Support strongly recommends working in Photoshop directly on the local hard disk to prevent data loss. Save files to your hard disk first and then transfer them to the network or removable drive in the Finder or in Windows Explorer. To retrieve files, copy them in the Finder or in Windows Explorer from the network or removable drive to your hard disk. You can then open the files in Photoshop.
Since resetting my Preferences (and not using the external drives as Scratch Disks) I've been able to successfully save the file to both my internal and external hard drives. I'll have to experiment on the effects af adding external scratch disks.

Has anyone else experienced this? Any clues as to how to troubleshoot this?

Posted: Wed Dec 19, 2007 9:24 pm
by E.J. Peiker
Large squares are an indication of not enough memory. The files are likely OK but you can't load the large file. A 900MB file will generally have problems as you rarely have 900MB free in any Vista installation after the OS and Photoshop and any other things your system loads. Scratch disks can help but are very slow and often this results in big squares.

Posted: Wed Dec 19, 2007 9:47 pm
by paonessa
Thanks, E.J.

I knew I was pushing the limits with a large file. I thought that, with scratch disks, the *only* problem this would cause is a reduction in speed.

I have 4 GB RAM (Vista 32 bit). Do I have to set anything to take maximum advantage of that RAM? I seem to recall you saying that in Vista (as opposed to XP), there was nothing special to set to use 4GB?

I'm trying to replicate the problem right now (so far without success). Maybe I should try opening more apps to take up more memory.

Also, are you saying that if I have a file open that appears uncorrupted and I save it, the squares are introduced when I re-open it (as opposed to when it is saved to disk)?

Not sure how this relates, but I just re-booted the PC, and got an CHKDSK error on my Y disk -- that is the second internal drive, and I believe that was set to be my first scratch disk when the problems occurred yesterday (before I reset Preferences). So far, setting that as scratch hasn't reproduced the problem.

It's annoying, because it takes about two minutes to save the big file to disk. I thought I was safe using these big files, but maybe I have to rethink that.

I wish 64-bit Vista were mainstream. I would have gone that route, but it doesn't sound ready for prime time.

Posted: Thu Dec 20, 2007 12:28 am
by Royce Howland
Ralph, I am not surprised at all by Adobe's recommendation. Although they are undoubtedly talking mostly about situations involving USB, Firewire or ethernet (NAS) connections to the storage, all of which have very different performance and reliability issues to deal with than is the case with internally mounted hard disks running over SATA or PATA. Your case using the RocketRaid card and external Infiniband connection is higher end than Adobe is probably thinking of, and normally I would have thought that would be stable enough. But possibly not. There might be an issue with the RAID card, a driver, a cable or an external disk itself.

E.J.'s and your suspicion that it's related to memory / scratch is probably correct... the squares give that away. Something in memory / scratch failed and PS can't render those tiles properly. However I don't think it's strictly an issue with not enough memory... that's what scratch is there for after all, just like the Windows pagefile is there for when Windows itself runs out of memory. I know E.J. has hit issues with big files in Photoshop before, but I think I can safely say I have tortured CS2 and CS3 with large files in a way that few NSN'ers have done. :) I work on layered 16-bit TIFF's 1 - 3GB in size without qualms, and have never had Photoshop corrupt a file on me or even display it weird. I've worked on files that took 20 minutes to open on my dual core WinXP box with 4GB of RAM. Yes, Vista takes more memory than XP, but unless Vista is even buggier than I believe, that is not going to blow up Photoshop's reliability... just slow it down as it hits scratch more than before.

So I don't think it's Photoshop, memory or scratch as such. More likely related to disk problems... either the scratch disk or the data disk, or the pipeline to it. (I'm not clear from your descriptions whether PS scratch was on the external SATA box, or the 2nd internal disk, or both.) Personally I would not put scratch on an external disk ever, I have it on a dedicated internal Raptor. As for my big storage, well, it's all NAS over gigabit ethernet so my working disks are all internally mounted SATA.

Whether your file corruption happened when the file was saved, or when it was later opened, I can't hazard a guess. Assuming you have time to try some testing if this happens again, you could do the following. When you see the squares appear when you open the file, immediately close it without saving. Burn the offending file in question onto a DVD and do a file copy verification to make sure the burn worked. Take that DVD to another machine with Photoshop on it, copy the file onto a local hard disk, and try to open it. If the squares appear there too, the file itself is almost certainly corrupted, and so it would have happened when it was originally saved on your machine.

The fact that you got a disk error recently on your 2nd internal disk does indicate something funky is going on. Check your disks, make sure they are working okay. (I wonder if you need to do some "burn in" testing to see if you're getting spurious read or write errors.) Check the disk SMART statistics if you can. IMO keep PS scratch off the external SATA box. Keep an eye on the PS internal scratch/efficiency stats just so you're basically aware of when operations are hitting scratch a lot, and you may be able to correlate this if the glitch happens again.