Help with deleted files from CF

apoc

Leading Member
Messages
549
Reaction score
152
Location
Paris, FR
I accidentally deleted some files from a Compact Flash and I need to restore them. I knew how to do this when i used windows, but now in Snow Leopard I don't have a clue of what software I need.

Can someone help me? The CF has not been used since the removal of the files, so they still must be there.

--
Sorry about my english, it's not my first language.
 
Thanks, I'll try them. Do you know any free utility? I feel like trying free software before putting down money for this.

--
Sorry about my english, it's not my first language.
 
Thanks, I'll try them. Do you know any free utility? I feel like trying free software before putting down money for this.
Sure. You can use Photorec. It's an open source program and it's free and cross platform (windows, mac, linux).

Simply download and install this software for the operating system you're using (Windows, Mac, Linux). It's free. You'll see a download menu choice on the left side of the main page. Then, just click on the desired operating system to download it (OSX in your case).

http://www.cgsecurity.org/wiki/PhotoRec

I don't know much about the Mac versions (as I don't use a Mac). But, it's a text based program, so I doubt you'd have any compatibility issues with it. I've used their windows and linux versions in the past. If so (you have any issues), try the lastest Beta version (also on the download page). I see separate downloads for Intel and PowerPC based Macs in the beta section. Here's a direct link to the download page:

http://www.cgsecurity.org/wiki/TestDisk_Download

Note that download also includes testdisk (another utility). Photorec is the one you want to use.

Use a card reader if possible, and select your memory card from the list of media it finds (hard drives, memory cards, etc.), and give it a place to save the photos to on your hard disk when you are asked Where to Save Recovered Files (or use the defaults and it will create folders for them). Note that this product may not retain the original file names with a damaged file system (but, you may not care about that), since it ignores the file allocation table entirely and goes after the underlying data (i.e., your image files). Basically, it's not going to write to your memory card. Instead, it will write the images it finds to a folder on your hard drive.

In most cases you don't need to worry about changing any of the other options. Simply leave everything at the defaults (Partition type of Intel, file types to recover, etc.) and it will try to recover any files that haven't been overwritten yet (and don't try to do anything like take more photos or you may overwrite some of them).

Here's a page showing you how to use this software:

http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step

--
JimC
------
http://www.pbase.com/jcockfield
 
Sure. You can use Photorec. It's an open source program and it's free and cross platform (windows, mac, linux).
A command line utility??? You've got to be kidding me.

But the bigger issue is why does it need root access? There is no reason any flash card recovery utility would need root to recover what's on a card, and for that reason alone, it should be avoided. It's a huge security hole.
I don't know much about the Mac versions (as I don't use a Mac).
Then why are you suggesting it?
 
It runs in a terminal window and the program looks the same regardless of the operating system it's running under. It's text, but it's still menu driven. It's quite simple to use (basically, just pick the correct source media from the list and use the defaults for the rest). ;-)

Because it doesn't have a GUI, that allows it to be more portable between operating systems (since it doesn't need to call any graphics functions). It's open source, so it can easily compile on a variety of operating systems (and you can download the source and compile it yourself if you prefer not to use the binary editions already compiled for you).

As for root access, that's not uncommon for utilities needing direct disk access (as this utility doe not use file system drivers and instead goes after the underlying data on the drive, ignoring the file system entirely). That allows it to recover images with severely corrupted file systems that other utilities can't.

I've used it many times under both Linux and Windows (mostly Linux). It's a very popular program for recovering images from corrupted media.

Testdisk is a another very useful utility in the same download. It's great for analyzing disks when the partition table is corrupted (or overwritten or deleted), figuring out the likely stop and start offsets of the partitions and letting you recreate the MBR for a damaged disk.

The OP asked for something free. Photorec is an open source program I'm familiar with that is free, and it's included the the repositories for many major Linux distros that are very security conscious.

If it's an Intel Mac, the OP could also download the .iso file for a Linux distro that already has it installed, burn it to CD and boot into it, using it that way (from a Live CD instead). I've talked quite a few users through that process in order to solve more serious media and disk issues (since some of them also have utilities like ddrescue designed to make copies of failing media; and I will sometimes talk someone through creating an image file copy of a card with hardware issues, using photorec against the created image file versus the source card itself).

--
JimC
------
http://www.pbase.com/jcockfield
 
Here's a brief tutorial from a Mac user with some screen captures I found with a quick google search for Photorec OSX

http://www.pearsonfaces.com/fpsurgeon/2007/05/data-recovery-with-free-photorec-in-os.html

It's a couple of years old now, and you'll see newer versions of the programs. But, the tutorial is still valid (the steps are the same for a simple recovery operation using Photorec).

Basically, it looks and works the same way, regardless of operating system. With something simple like deleted images (your case), the hardest thing you need to do after starting the program is select the correct source media (and you'll see the drive information and sizes in the list you can select from).

Then, just use the defaults for the rest of the options. It will autodetect the correct partition types, etc., and save the files on the hard drive you start the program from in folders named recup_dir.1, recup_dir.2, etc. (unless you change the destination folder it saves recovered images in to something else).

For severely corrupted media, there are many more options you can use. Here's the full user guide (as linked to in my first post to this thread).

http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step

If for any reason the production release won't run on your version of OS X and processor type, I'd try the beta that's specific to a processor type instead (as it looks like he's compiling versions specific to processor type with the new beta).

Note that you'll end up with more images than you deleted (as it will recover any complete images that haven't been overwritten yet by default, so you may see recovered images from multiple shoots ago since you deleted the last ones).

It also has options for things like changing the default Paranoid settings to use "Brute Force". It will take longer for it to run that way, but you'd have a higher chance of recovering uncorrupted images from damaged media (since it's using relatively sophisticated techniques to try and piece together parts of images that are located in more than one place on the media). That option (Paranoid: Brute Force On) will still filter any corrupted files. You can also set it to do things like set it to keep corrupted files.

But, in your case (deleted files only versus corrupted file system, card not used since you deleted them), I'd stick with the defaults (and it's very easy to use that way -- just select the source drive from the list of media it finds (select your memory card) and use the defaults for the rest.

--
JimC
------
http://www.pbase.com/jcockfield
 
It runs in a terminal window and the program looks the same regardless of the operating system it's running under. It's text, but it's still menu driven. It's quite simple to use (basically, just pick the correct source media from the list and use the defaults for the rest). ;-)
Most users are not interested in anything that uses Terminal.
Because it doesn't have a GUI, that allows it to be more portable between operating systems (since it doesn't need to call any graphics functions). It's open source, so it can easily compile on a variety of operating systems (and you can download the source and compile it yourself if you prefer not to use the binary editions already compiled for you).
None of that matters to someone who just wants to recover their images from a flash card.
As for root access, that's not uncommon for utilities needing direct disk access (as this utility doe not use file system drivers and instead goes after the underlying data on the drive, ignoring the file system entirely). That allows it to recover images with severely corrupted file systems that other utilities can't.
Root is not needed. At best, the app would only need admin access (not root) and even that may be questionable. Running an app as root that doesn't require it is really foolish.
I've used it many times under both Linux and Windows (mostly Linux). It's a very popular program for recovering images from corrupted media.
Maybe on Linux, but there are much easier to use alternatives for both Mac and Windows.
Testdisk is a another very useful utility in the same download. It's great for analyzing disks when the partition table is corrupted (or overwritten or deleted), figuring out the likely stop and start offsets of the partitions and letting you recreate the MBR for a damaged disk.
Again, users don't care about that stuff, they just want their photos.
The OP asked for something free. Photorec is an open source program I'm familiar with that is free, and it's included the the repositories for many major Linux distros that are very security conscious.
There's a reason why it's free, nobody would pay for something that primitive. Plus, there are free utilities for the Mac, including the following although the second one is a bit old:

http://store.lexar.com/imagerescue3/
http://www.bluem.net/en/mac/exif-untrasher/
If it's an Intel Mac, the OP could also download the .iso file for a Linux distro that already has it installed, burn it to CD and boot into it, using it that way (from a Live CD instead).
You've got to be kidding. Boot a Linux distro to recover a flash card? Is making something as convoluted as possible some sort of benefit?

Why would anyone download a CD sized .iso and then burn it just to boot Linux when they can download an app that's only a few megabytes and works in their operating system of choice, including this tool?
I've talked quite a few users through that process in order to solve more serious media and disk issues (since some of them also have utilities like ddrescue designed to make copies of failing media;
The fact that you have to talk someone through it should be a clue that it's not suitable for the majority of users.
and I will sometimes talk someone through creating an image file copy of a card with hardware issues, using photorec against the created image file versus the source card itself).
Making an image file is nothing more than a couple of clicks, hardly something that requires talking someone through the process.
 
It's simple to use. Just because it's terminal based is not a big deal. You're just selecting choices and pressing enter. ;-)

I've also seen it recover images from media after users were unable to get anything with commercial programs they've tried. It's very good.

As for creating a disk image, notice I mentioned hardware issues? If you have hard read errors (intermittent controller problem in a card, or sector read errors on a hard drive) versus file system corruption, then most utilities will choke. That's when I do something like talk users through using a utility called ddrescue that's preinstalled in many linux distros that can run from a Live CD to create an image file of failing media.

ddrescue is a super utility (similar to dd in that it can make a sector by sector copy of a device, without worrying about partition types, etc.), but better because it also handles hard errors, automatically adjusting read sizes into smaller and smaller areas to try and recover more data, making multiple passes as desired (only copying data that has not been read OK with subsequent passes, filling in the blocks in the destination image file or device).

ddrescue handles failing media with ease, doing much more of the work without helper programs needed to start and stop the read process, using different block sizes to more efficiently read a drive with more errors on it (larger block sizes when you have more sectors in a row readable and smaller block sizes when you have sector issues and need to read in smaller increments to read an area without any hard errors before moving on to another one).

Because it uses a log file to track what's been copied OK, you can do things like let a drive cool off before making another pass, without trying to reread areas already copied OK. It's the best thing I've used for copying a failing drive. For example, I've successfully recovered files from damaged drives when no other solutions tried would work (partimage, dd, gparted, Acronis True Image, HDClone, g4l, PC Inspector Clone Maxx0, XXCopy, EaseUS Disk Copy, CopyR.dma, CopyWipe and more). They all either refused to run, gave up after too many errors.

There are many nice utilities available for linux that are very well written for that type of recovery, and you will see hardware issues with memory cards that cause other utilities to fail when seeing hard errors, that a program like ddrescue can often handle, allowing you to make multiple passes to get a good copy of it stored in a disk image file, then using photorec against that disk image file to recover the images inside of it.

If you don't want to use them, fine. But, I've got lots of experience with these programs helping others recover data from failing drives and memory cards when other utilities they tried could not succeed.

--
JimC
------
http://www.pbase.com/jcockfield
 

Keyboard shortcuts

Back
Top