# Recovery of files



## J.R. (Feb 4, 2013)

Hi,

Is there any way to recover files after the card has been subject to an "in-camera" low level format? 

I'll be selling off a few cards and just want to make sure nothing is recoverable on them.


----------



## bycostello (Feb 4, 2013)

cost would outweigh any desire to do so.... but what was on them I'm intrigued to know!!!


----------



## Halfrack (Feb 4, 2013)

Doable, but it's a trade off ....

Take an old body and a wired remote, point it at a wall and set it to continuous shooting and walk away. Card fills up with real data, wipe it once more and you're set.


----------



## J.R. (Feb 4, 2013)

bycostello said:


> cost would outweigh any desire to do so.... * but what was on them I'm intrigued to know*!!!



LOL ... The cards contain pics of my family which I don't wants in the hands of a third party for obvious reasons. These are 4-16GB slow cards which I never use now (a couple of them report errors on the 5D3). 

The 32GB 90x card from the 7D was retained upon sale of the camera so I practically have too much CF gigabytes than necessary. 

Dunno whether it would be better to just destroy the damn things because I'm not sure what these will fetch ... I was hoping of getting a fast SDHC card for the 6D.


----------



## rpt (Feb 4, 2013)

Put them in a card reader. Copy useless files over if you don't want to use up shutter count... If your file size is 1K, you will use up all memory.

You could also look for file shredding software that overwrites your current files with junk before deleting them.


----------



## J.R. (Feb 4, 2013)

rpt said:


> Put them in a card reader. Copy useless files over if you don't want to use up shutter count... If your file size is 1K, you will use up all memory.



Thanks ... I'll use the above method.


----------



## Don Haines (Feb 7, 2013)

rpt said:


> Put them in a card reader. Copy useless files over if you don't want to use up shutter count... If your file size is 1K, you will use up all memory.



That's what we do at work to hard drives being circulated through the organization.... low level format.... fill with junk files... then low level format. We shred any drives or destroy any memory cards before disposal outside of the organization. For us, the risk of someone recovering data far outweighs what we could sell used storage devices for.


----------



## rpt (Feb 7, 2013)

Don Haines said:


> rpt said:
> 
> 
> > Put them in a card reader. Copy useless files over if you don't want to use up shutter count... If your file size is 1K, you will use up all memory.
> ...


I had written a program last year. If I can find it I will post a link...


----------



## Mt Spokane Photography (Feb 7, 2013)

Only SD cards will have a in-camera low level format option. A regular in-camera format is not a low level format. If you have a camera that offers a low level format for your SD card, it writes zeros to all of the memory cells and the images are not recoverable.
Most cameras do not offer the low level format option. You can do a full format with the card in a card reader using your computer which does the same thing. A quick format does not.


----------



## J.R. (Feb 7, 2013)

Mt Spokane Photography said:


> Only SD cards will have a in-camera low level format option. A regular in-camera format is not a low level format. If you have a camera that offers a low level format for your SD card, it writes zeros to all of the memory cells and the images are not recoverable.
> Most cameras do not offer the low level format option. You can do a full format with the card in a card reader using your computer which does the same thing. A quick format does not.



The 5d3 offers a low level format for both the CF as well as ONLY for the SD card in the camera. Glad to know that the low level 'in camera' format will render any on card files unrecoverable.

Mt Spokane was right all along ... low level format is available only for the SD card and not the CF card. An edit to my post was necessitated ... 

Thanks ... JR


----------



## Drizzt321 (Feb 7, 2013)

J.R. said:


> Mt Spokane Photography said:
> 
> 
> > Only SD cards will have a in-camera low level format option. A regular in-camera format is not a low level format. If you have a camera that offers a low level format for your SD card, it writes zeros to all of the memory cells and the images are not recoverable.
> ...



Erm...if the 'format' options takes just a few seconds, there's no way it's a low level format unless you are dealing with just a few hundred MByte's tops. If it takes several minutes to an hour or so, then it's probably really doing a 'low level' format, which would be resetting all of the cells on the flash memory to blank.


----------



## J.R. (Feb 7, 2013)

Drizzt321 said:


> Erm...if the 'format' options takes just a few seconds, there's no way it's a low level format unless you are dealing with just a few hundred MByte's tops. If it takes several minutes to an hour or so, then it's probably really doing a 'low level' format, which would be resetting all of the cells on the flash memory to blank.



I believe that the 5D3 offers a quick format mode and also a low level format mode. The last time I formatted the SD card, it took a good amount of time - several minutes I think. I don't have the camera here to confirm this though ... will check and revert.


----------



## J.R. (Feb 7, 2013)

Drizzt321 said:


> J.R. said:
> 
> 
> > Mt Spokane Photography said:
> ...



I checked the manual - It specifically mentions this on page 54 regarding the SD card low level format - 

"Since low-level formatting will erase all recordable sectors in the SD card, the formatting will take slightly longer than normal formatting"


----------



## rpt (Feb 7, 2013)

J.R., I found the code. It is in Java. I am attaching it here. You can use any java IDE to run it. You will need to change the drive letter defined in the line below to the drive that maps your memory card.
FillDiskSpace fds1 = new FillDiskSpace("D:");

can be changed to:
FillDiskSpace fds1 = new FillDiskSpace("G:");
if your drive G is the memory card. The program creates a folder called Dir2Fill and fills it with 1MB files containing junk. So delete everything on the card. Run the program. Once it fills up, you can delete that folder and you should be ok. In case you are paranoid about the 1MB, change the line:
private static final int ONE_MB = 1048576;
to:
private static final int ONE_MB = 1024;
and you will be fine.

Code follows:
//==Code follows: ======================================

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;


public class FillDiskSpace {

private static final String DIR_NAME = "Dir2Fill";
private static final String FILE_LINE = "AAAAAAAAAASSSSSSSSSSDDDDDDDDDDFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHJJ\r\n";
private static final String C_DRIVE = "C:";
private static final int ONE_MB = 1048576;
private static final int SIXTY_FOUR = 64;
private static final String DRV_STR_LENGTH = "Drive string must be 2 characters long.";
private static final String DRV_STR_NO_COLON = "The character at the second position must be a colon ':'";
private static final String INVALID_DRV_LTR = "Invalid drive letter. Must be between 'A' and 'Z' inclusive.";
private String sDrive = null;
private String sDirFullPath = null;

public FillDiskSpace()
{
FillDiskSpaceMthd(C_DRIVE);
}

private void FillDiskSpaceMthd(String sDir) 
{
String sErrMsg = null;

sDir = sDir.toUpperCase();
if(sDir.length() != 2)
sErrMsg = DRV_STR_LENGTH;
else if(sDir.charAt(1) != ':')
sErrMsg = DRV_STR_NO_COLON;
else if(sDir.charAt(0) < 'A' || sDir.charAt(0) > 'Z')
sErrMsg = INVALID_DRV_LTR;

if(sErrMsg != null)
{
System.out.println(sErrMsg);
return;
}

long lStart = System.currentTimeMillis()/1000l;
long lThen = lStart;
long lNow = lStart;
long lDiffSec = 0;
long lDiffSecTotal = 0;
sDrive = sDir;
sDirFullPath = sDrive + "/" + DIR_NAME;
File dir = new File(sDirFullPath); 
dir.mkdir();
int ret = 0;
int fileNo = 1;
while(ret == 0)
{
String sFileName = "File_" + fileNo + ".txt";
ret = WriteA1MbFile(sFileName);
if( fileNo%100 == 0)
{
lNow = System.currentTimeMillis()/1000l;
lDiffSec = (lNow - lThen);
lThen = lNow;
lDiffSecTotal = (lNow - lStart);
System.out.println("Wrote " + fileNo + " files so far... This set took " + lDiffSec + " sec. Total so far " + lDiffSecTotal + " sec.");
}
if(ret == 0)
fileNo++;
}
lNow = System.currentTimeMillis()/1000l;
lDiffSec = (lNow - lThen);
System.out.println("\r\nWrote " + (ret==-1?fileNo:fileNo-1) + " files in all. This set took " + lDiffSec + " sec.");
lDiffSec = (lNow - lStart);
System.out.println("Total time taken is " + lDiffSec + " sec.");

}

public FillDiskSpace(String sDir)
{
FillDiskSpaceMthd(sDir);
}

/**
* @param args
*/
public static void main(String[] args) 
{
FillDiskSpace fds1 = new FillDiskSpace("D:");

}

private int WriteA1MbFile(String sFileName) 
{
String content = FILE_LINE;
int siz = 0;

try {

File file = new File(sDirFullPath + "/" + sFileName);

// if file doesnt exists, then create it
if (!file.exists()) {
file.createNewFile();
}

FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
while( siz < ONE_MB)
{
bw.write(content);
siz += SIXTY_FOUR;
}
bw.close();


} catch (IOException e) {
// e.printStackTrace();
System.out.println(e.getMessage());
return (siz == 0? -2:-1);
}

return 0;
}

}

//==Code ends: =======================================


----------



## J.R. (Feb 7, 2013)

Thanks rpt ... just the thing I was looking for. Will try this once I get home!


----------



## Drizzt321 (Feb 7, 2013)

The problem with that method is that it won't really hit 100% of all sectors that are writable. I'd guess especially not in CF cards, and possibly not in SD cards since there is generally a small amount of storage space set aside as spare area and for wear-leveling, which means it's not accessible via normal LBA parameters, but the controller can still read/write to it. You probably can trick the controller into reading from those spare sectors with some effort, which means you could still recover some data.

And I'm kinda surprised someone will buy some older cards, especially if a few of them give you an error in your 5d3. If you're honestly that worried, then just thrown them out. You aren't going to get much money for them, are you? If it's anything like $20-30 and you're really worried, I'd just toss them, save yourself somewhat of a headache. If that's _per_ card, then maybe it's worth it, since after 3 or 4 cards you can get some nice, big, shiney new cards. But that begs the question, why is the buyer not willing to shell out for some decent new cards? They aren't that expensive in the 8-16GB range.


----------



## J.R. (Feb 8, 2013)

Drizzt321 said:


> And I'm kinda surprised someone will buy some older cards, especially if a few of them give you an error in your 5d3. If you're honestly that worried, then just thrown them out. You aren't going to get much money for them, are you? If it's anything like $20-30 and you're really worried, I'd just toss them, save yourself somewhat of a headache. If that's _per_ card, then maybe it's worth it, since after 3 or 4 cards you can get some nice, big, shiney new cards. But that begs the question, why is the buyer not willing to shell out for some decent new cards? They aren't that expensive in the 8-16GB range.



Thanks! Where I live the equipment is pretty expensive. A 16GB CF costs anywhere between $80-$100 and a used card will sell for 1/4th of half that. The buyer is from our local photography club, the same guy I sold the 7D to ... He's running out of CF memory now that he is shooting raw


----------



## Drizzt321 (Feb 8, 2013)

J.R. said:


> Drizzt321 said:
> 
> 
> > And I'm kinda surprised someone will buy some older cards, especially if a few of them give you an error in your 5d3. If you're honestly that worried, then just thrown them out. You aren't going to get much money for them, are you? If it's anything like $20-30 and you're really worried, I'd just toss them, save yourself somewhat of a headache. If that's _per_ card, then maybe it's worth it, since after 3 or 4 cards you can get some nice, big, shiney new cards. But that begs the question, why is the buyer not willing to shell out for some decent new cards? They aren't that expensive in the 8-16GB range.
> ...



Oh my, that's really expensive.


----------

