• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

Sign in to follow this  

Need help - Will Pay $ - Someone Familiar with Repairing CR2 files?

Recommended Posts

+theblazingangel    137

Tried this, can't find that address or sequence,,,

I presume that you're getting this error when running the dd command as per my instructions above? Note that in the command, the "if=" bit refers to the input file/device and the "of=" bit refers to the output file/device. In the command I pasted I simply used examples, you need to use the file manager to see what the actual names are for your devices, much like specifying the correct drive letter in Windows! I assume that's where you're going wrong.

Specifically, in the command I wrote, /dev/hda is kind of the equivalent of specifying c:\ in Windows. You need to change this to point to the memory card. Whatever you do don't mess things up and overwrite things on the card else you'll never get the pics back. /dev/hdb refers to the drive on which to store the image file you're creating. image.dd is the name of this image file we're creating.

Share this post

Link to post
Share on other sites
+theblazingangel    137

Actually, I made a mistake, here's the correct command:

sudo dd if=/dev/hda of=/dev/hdb1/image.dd bs=512 conv=noerror,sync
Note, you still need to replace the example references with the correct ones as I just described above. If not done correctly, you could end up overwriting data and screwing things up, so be careful!


To help you with getting the correct references:

Understanding device/partition references

A physical storage device (disk/drive/memory-card) will contain one or more "partitions". A partition is simply a portion of the device's storage space which will contain a file system. A device could have just one or could have multiple. Each drive letter in Windows (like C:\) is linked to a specific "partition" and therefore its file system. References to the physical drive itself in Windows are a little more obscure and I won;t go into. In Linux, /dev/hda (hard disk/drive A) is an example reference to a physical device. The 'hd' bit can change; 'hd' is for "IDE" connected disks (considered old now) and 'sd' is for SATA/SCSI connected disks. (USB connected devices you may find referenced with 'sd' also). The letter 'a' on the end means this is the first such device, and with additional devices you'll find 'b', 'c', etc. References to partitions and the file system they contain, in Linux, start with the device reference and simply add a number on the end to reference the specific partition. For example /dev/hda1 refers to the first partition of the first 'hd' connected disk.

(The above isn't strictly a completely perfect and accurate description, but good enough for this).

Note that in the dd command I gave you a couple weeks ago, I made a mistake when specifying the output file; I used a device reference instead of a partition reference (forgot the '1'). (A file needs to be stored within a filesystem of a partition). This is fixed above.

Finding the correct references

The file manager might not actually be the best solution for finding the references you need for the command, as I had suggested above.

In the terminal, try the command:

This will list devices and their partitions. Hopefully you'll have no trouble identifying the device reference for the memory card (disk/device reference not partition reference please).

You should hopefully have no trouble also identifying the partition reference for the file system in which you need to save the drive image that needs to be created. This partition needs to be "mounted" though (opened for reading/writing). See below!


Note, the memory card does NOT need to be mounted, we're going to be reading from the raw device, we don't need to interact with the filesystem it contains as you normally would!

If there's already a "mount point" specified under the respective column in the output of the above command (lsblk) for the partition on which you want to save the disk image we're creating, then it's already mounted. If it's mounted you can browse to that location with the file manager to confirm it's the partition you think it is if you need to.

If it's not mounted, do the following:

sudo mkdir /tmp_mount_1
sudo mount /dev/sdb1 /tmp_mount_1
Replacing the partition reference here with the one for the partition needing to be mounted. This will mount the partition and therefore allow files to be written to it.


Note, 'sudo' at the start of a command essentially means run the following command as root (i.e. essentially with admin prvileges).

Share this post

Link to post
Share on other sites
Constantin Mindru    0

getting there



vcfan, have you managed to get a full color JPEG or CR2 image? I have the same problem.... I only manage to get a black&white Jpeg image from my cr2 files with Photomechanics or other convert software. When load the cr2 in Camera Raw appear in color but corrupted like this image. I am curious if there is something that can be done in a HEX editor to obtain a color Jpeg image.



Share this post

Link to post
Share on other sites
Constantin Mindru    0

I'm using XVI32 to view the files, find the second instance of FF E0 in each one, and delete up to that point.



XVI32 is scriptable, so check out the documentation on their site.

Hi, zhangm. What is the second instance? I opened the cr2 in HEX editor XVI32 and searched for FF E0 but nothing appears.

Share this post

Link to post
Share on other sites
Constantin Mindru    0

If you want to get a raw byte-by-byte image of the entire memory card to me, perhaps from that I could attempt to repair the filesystem and see if we can get the entire set of files restored.

Hi, theblazingangel.

Can you tell me please, is there any possibility to recover overwritten cr2 files from a 32Gb Compact Flash memory card? If no, then is there any possibility to repair a corrupted cr2 file?

Thank you! 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.