Mailinglist Archive: opensuse (818 mails)

< Previous Next >
Re: [DIAGNOSED] Re: [opensuse] Howto repair - corrupt jpeg file - anything new out there?
On 9/19/2011 2:50 PM, David C. Rankin wrote:
On 09/19/2011 01:16 PM, jdd wrote:
Le 19/09/2011 20:10, David C. Rankin a écrit :

error, but still have garbage inside. Something like a cross-linked
file on the card causing the garbage in the files. Leave it to the DOS
filesystem on the card to mess things up :)

when you write (or read) a flash card, a large part of the operation
is buffered

I sometime (too often) notice that one can umount the reader *before*
all the
reading/writing operations are completely done. Look at the blinking
diode if
you have one, it keep blinking

so one have to *wait* (30s, one minutes) before unplugging

few weeks ago I copied VirtualBox images from my computer to copy them
to a
computer 16 km away

when I tryed to copy, the files where present but unreadable. This
special usb
key do not have led :-(

I beg that the copy program first create the files, then, copy the data


Here, the data was written to the SD card by the camera, then the SD
card was put into a memory card "reader" on my laptop. The files were
then copied from the card to the hard drive using a script that
basically did:

PICFILES=$(find /media/disk -type f -iname '*.jpg')
cp -ur $PICFILES ~/img/photo

It worked well. Then I began experiencing the corruption issues.

I don't see how the command line copy operation could have not waited
for the buffer to write to disk before copying the next image from the
SD card??

Even after the copy operation was finished, I would then rsync the files
to a local server before removing the SD card from the reader. This
would have allowed at least 1-5 minutes before card removal. I would
have expected an rsync error if it was trying to transfer a file that
still had some type of buffer open?? (I could be wrong there.. I just
don't know)

Anybody see how the multi-copy of files from the SD card via the script
snippets above could have induced the corruption? To me, (at least as of
now) the culprit still looks like a bad filesystem on the SD card. The
card was reformatted shortly after this corruption issue, but given the
corruption, I just went back to a digikam download direct from the
camera rather than a copy from the SD card itself. I haven't had a
problem since. Perhaps another test is in order.

Thoughts? Guidance?

If you unmounted before you removed, then you're fine. If you didn't unmount, then no amount of waiting is really garanteed, although usually dbflush will have flushed everything every 30 seconds.

But no there are no timing related problems or fixes. If it's mounted, the kernel handles all flow control (serialization/blocking/waiting), and when you unmount, when the umount command returns then umount and the kernel have promised everyone that they are all done and the sd card itself has acknowledged the last write as completed, and the sd card does not have a ram buffer cache in it that will lose data when you unplug the card.

That sample "garbage" looked tantalizingly image related. SVGFEConvolveMatrix googles up as an image manipulation function, which as far as I can tell, shouldn;t exist actually inside an image, but certainly exists in image manipulation software.

Have you tried running an image recovery util that scans a raw drive or drive image and recovers files by recognizing headers and other known image data structures in the raw data, not, or at least not exclusively, by looking at the filesystem. They recover several kinds of files but don't pretend to know their names. You end up with a bunch of numbered files. You have to open them to decide what they are and rename or discard them.

The point would be this kind of util would not let the filesystem metadat tell it where files start and stop. It would read every byte of the disk or disk image from zero to end, trying to recognize jpg and other data structures and it would output 1.jpg, 2.png, etc... based only on it's own parsing of the raw data, not by consulting the FAT etc.

I did this to recover a lot of deleted images from my girlfriends iphone after it crashed and the only fix was to factory reset, which involved a format. I did the factory reset to get the phone alive again then immediately jailbroke it and captured a dd image over the network and was able to recover thousands of images and other common files from the 8G image. Most were junk of course, browser cache and images and sound clips that were parts of apps, but also were many of the camera images. Of course some stuff was lost for good since the new OS install and the jailbreaking process did overwrite some of the drive just to get to the point where it was even possible to get a dd image.

Of course I don't remember the name of that app. It's not on this machine. I think it was a stand-alone app, not requiring install, and it's probably at home on an external drive along with the dd image and the recovered files.

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >