Jump to content

SD Card Formatting


billco

Recommended Posts

Advertisement (gone after registration)

I was reading (over of the M9 forum) about someone having issues with an SD card. Some of the suggestions to deal with the problem involved re-formatting the card on the computer and then to follow up with another formatting on the camera.

 

Could someone please share with me, the actual need for formatting SD cards. When I purchased my M9, I simply purchased an 8GB SanDisk and put it in the camera. It worked fine and to my knowledge, I didn't format it at all. I even took a 1GB card out of an old "point and shoot" I own, and it works fine as well (without any formatting).

 

What is the deal with formatting SD cards? Why does it need to be done, and when should you do it? :confused:

Link to post
Share on other sites

Normally there is no reason to ever format an SD card. It comes formatted and stays that way. Formatting a card in the camera is a useful method to solve all kinds of mysterious card errors, but it is a cure rather than a way of preventing card errors.

Link to post
Share on other sites

Simply deleting images from the card leaves behind all sorts of junk that if you left it long enough would fill the card up. In the olden days of 125mb cards you could see the number of images that could be saved gradually reducing because of this junk. Leaving the junk also adds random factors in the card that can have an effect on saving images etc.

 

So ideally you should not delete images but remove them by formatting the card each time. It only takes seconds and is like a health check for your card.

 

Steve

Link to post
Share on other sites

I've just tried a little test, writing files to a FAT-32-formatted SD card, deleting them, writing a slightly different set, and so on. This has disproved the general contention that

Simply deleting images from the card leaves behind all sorts of junk that if you left it long enough would fill the card up. In the olden days of 125mb cards you could see the number of images that could be saved gradually reducing because of this junk. Leaving the junk also adds random factors in the card that can have an effect on saving images etc.
I started by giving the 1GB card a full format in the computer and creating a two-level folder structure \XXX\DCIM like most digital cameras. Disk properties showed:

used space 12,288

free space 1,014,878,208

capacity 1,014,890,496

 

Next I ran a script that

 

  1. wrote a text file to the DCIM folder
  2. copied 49 JPEGs totalling about 110 MB
  3. deleted them all and started again.

The text file was initially about 6400 bytes long but the script made it about 6400 bytes longer each time it was written, so the following JPEGs weren't always being writting in the same locations on the card.

 

After 50 loops I stopped the script and looked at the disk properties again:

used space 12,288

free space 1,014,878,208

capacity 1,014,890,496

 

In other words no reduction in capacity.

 

Here's the script I used. Note that it deletes all the files each time round. If it never deleted all of them before writing more, the files on the card could become fragmented, which would eventually reduce the capacity of the card. But that's a well-understood fact about FAT-32 and similar file systems and should be distinguished from folklore about formatting (good) and deleting all files (bad).

 

use strict;
use File::Copy;

my $src = 'D:/Documents/pix/';
my $dest = 'K:/XXX/DCIM/' ;
my $repeats = shift @ARGV;
my $S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx\n";
my $offsetFileName = 'Offset.txt';
my $file;

for (my $j = 1; $j <= $repeats; $j++) {

 print STDERR "Loop $j - copying...\n"; 

 #generate expanding file to offset successive copies
 open my $OFFSET, '>>', $src . $offsetFileName  or die "Can't open offset file: $!";
 print $OFFSET  "$j\n\n", $S x 128;
 close $OFFSET;

 #copy offset file first
 copy $src.$offsetFileName, $dest.$offsetFileName; 

 #copy jpegs
 foreach $file (<$src*.jpg>) {
   $file =~ m!([^/]+)$!;
   $file = $1;
   print STDERR "Loop $j: $file\n"; 
   copy $src.$file, $dest.$file; 
 }

 print STDERR "        - deleting...\n";
 unlink $_ foreach (<$dest*.*>); 
}

Link to post
Share on other sites

Simply deleting images from the card leaves behind all sorts of junk that if you left it long enough would fill the card up.

Contrary to popular belief it doesn’t.

Link to post
Share on other sites

Advertisement (gone after registration)

One can smoke and perhaps never get get cancer.

 

Best practice is to reformat and not take a chance.

Formatting a card without any good reason is more analogous to quack medicine.

Link to post
Share on other sites

Contrary to popular belief it doesn’t.

 

But it can result in many more fragmented files, (Unless all files are exactly the same size.) which in time could lead to files being so badly fragmented that problems may occur. It would probably take quite a while for this to be a problem though, especially with larger capacity cards. :)

Link to post
Share on other sites

Contrary to popular belief it doesn’t.

Most likely you're right with this one, but still—to get rid of the card's contents and to start over with a 'fresh' card, re-formatting is quicker than deleting and puts less stress on the card's memory cells which do wear down with use. So what's your problem with re-formatting actually?

Link to post
Share on other sites

Contrary to popular belief it doesn’t.

 

It might.

 

Erasing images from the card using the computer might keep them in the garbage can until you decide to empty it. If you regularly use the computer to do that, you will notice that right away as the card will still be full, even after erasing many images. If you do so only from time to time and only to erase a few images at a time, you make take some time until it becomes obvious that there's some kind of leak.

 

Also, using the card to store other files might use an appreciable amount of storage space for directory entries. As far as I know, directory blocks are not reclaimed even if they do not refer to existing files any more. However, this leak is bound to withhold only a smallish part of the card from circulation.

Link to post
Share on other sites


Formatting a card without any good reason ...


Given the wildly varying computer skills present in Leica users, finding a set procedure and sticking with it every single time would be very good reason indeed. Such practice would greatly increase the chances of actually walking away with a stored picture at the very modest price of some potential wear on the card's memory cells.

This thread relies to a good part on several unstated premises:
  1. The software (both in the camera and the computer) works correctly under all circumstances
  2. The user of the card and the software properly handles the card and the software
  3. None of the involved devices behave erroneously



These premises may not be as firm as one might wish to believe:

  • The FAT file system is AFAIK not an open standard; some implementations would then be somewhat hit and miss. Also, it is poorly suited to large-ish storage devices measuring in Gigabytes.
  • I have already implied above that the user might contribute to the problem by inexperience or by lack of attention to proper handling. The card must be released by both the operating system on the PC and the camera, respectively, before removing it from the card reader. Failing to do so will result in all kinds of issues which can be very hard to reproduce or even identify.
  • All bets are off if there are hardware-related issues, the most obvious candidates being the power supply to the card, the contacts and timing issues. That's probably the reason why Leica explicitly recommends just a few brands.



BTW, do people sometimes mention horses in your presence? High ones?

Link to post
Share on other sites

Ummm...Does it make any difference in normal use? (whatever that may be;)) I should think not. I find formatting an easy habit, but it is not a religion....

 

+1

I simply download my latest images onto the computer, eject the card, replace in the M9 and instruct it to reformat the card. Then I slip in a fresh battery and am good to go. I have never reformatted the card in the computer first - I thought this in itself is either overkill or could also lead to problems.

Regards

Alex

Link to post
Share on other sites

I only use recommended Scandisk Ultra II 2GB in both DMR and M8 and format every time. Nevertheless I get the occasional hiccup with either camera (always in the wrong situation, of course).

 

I noticed that newer Ultra II 2GB (no longer called "II") can take only 96 RAW photos (DMR) instead of 99 as the older ones did. I asked the manufacturer at the last Photokina and got an evasive answer, stating that everything is alright and still within standards. My (non-expert) conclusion is that they probably implemented changes to cut costs.

Link to post
Share on other sites

But it can result in many more fragmented files, (Unless all files are exactly the same size.) which in time could lead to files being so badly fragmented that problems may occur. It would probably take quite a while for this to be a problem though, especially with larger capacity cards. :)

 

Fragmentation only occurs when a new file is written in gaps between existing files, gaps that are not big enough to contain the entire file. Therefore it does not occur if you delete all files before re-using the card.

 

By "delete" I mean delete (unlink) and not "move to the recycle bin" or the equivalent.

Link to post
Share on other sites

Most likely you're right with this one, but still—to get rid of the card's contents and to start over with a 'fresh' card, re-formatting is quicker than deleting and puts less stress on the card's memory cells which do wear down with use. So what's your problem with re-formatting actually?

 

AIUI the difference in FAT-32 is that a quick format zeros the entire file allocation table, while deleting all files alters one byte in each directory entry and zeros the associated entries in the file allocation table. Sounds like six of one and half a dozen of the other to me.

 

I've no problem with re-formatting and often do it. My problem is with the superstition that reformatting = good juju, deleting = bad juju.

 

(Again, by "deleting" I mean deleting, not "moving to the recycle bin".)

Link to post
Share on other sites

AIUI the difference in FAT-32 is that a quick format zeros the entire file allocation table, while deleting all files alters one byte in each directory entry and zeros the associated entries in the file allocation table. Sounds like six of one and half a dozen of the other to me.

 

The two are really not the same.

 

Formatting creates an entirely new file system with all directories empty and as small as possible.

 

Deleting just removes the files you explicitly delete. Anything else stored on the card will persist. After deleting all well-behaved files and directories you might as well be stuck with the defective ones which provoke the problem in the first place.

 

In an ideal setting without any defects at all deleting the files and formatting the card will both be usable ways to make room on your card for new masterpieces.

Link to post
Share on other sites

The two are really not the same.

 

Formatting creates an entirely new file system with all directories empty and as small as possible.

 

Deleting just removes the files you explicitly delete. Anything else stored on the card will persist.

 

Absolutely not. A quick format on a FAT-32 drive does almost nothing except zero the FAT entries for every cluster that has not been marked as "bad". The M8 does a quick format and then creates the two directories it uses. A full format also (at least on my Windows 7 machine) checks and zeroes every single cluster, rewrites the root directory, and does stuff with boot sectors and the like.

 

Deleting on a FAT-32 drive doesn't remove any of the file contents, it just modifies their directory entries and zeros the associated FAT entries.

 

In an ideal setting without any defects at all deleting the files and formatting the card will both be usable ways to make room on your card for new masterpieces.

 

In the real world they are too. :)

Link to post
Share on other sites

... A quick format on a FAT-32 drive does almost nothing except zero the FAT entries ...

 

It also must write an empty root directory; otherwise everyone would be extremely unhappy about file entries pointing to reclaimed free space. That would be part of the "almost nothing" which a quick format does in addition of freeing clusters from the FAT.

 

Erasing files and formating the medium are two different things. Under normal (benign) circumstances it doesn't matter which you use as both will get rid of your images on the card.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...