Why does an SD card sometimes become corrupt and need reformatting?

Asked 6/27/2013

4 views

2 answers

0

One of my lower-cost SD cards occasionally becomes unreadable in-camera and the camera asks to reformat it. Sometimes it works for months and fills close to its rated 16GB capacity; other times it corrupts after only a few shots. What typically causes this kind of SD card corruption, and why might it happen more often with cheaper cards?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

13y ago

2 Answers

26

There are several ways in which an SD card can go bad.

Physical Damage

First, cards can be actually physically broken. You can bend them in half pretty easily if you try, but in general they're actually pretty resilient. Many are effectively water-proof even if not marketed that way. I've sent cards through the laundry, and once I dropped one full of precious baby photos right into hot coffee — no problem! Now, I wouldn't recommend pushing your luck, but if you're careful, this is unlikely.

Electrostatic discharge could also damage the electronics, although again most cards are surprisingly well-resistant. (Try to intentionally destroy a card with static and your success rate will be low.)

Flash isn't particularly light-sensitive, so airport x-rays aren't a real risk (longer exposure to high-energy x-rays is another story). And magnets aren't a worry either — "A magnet powerful enough to disturb the electrons in flash would be powerful enough to suck the iron out of your blood cells", according to the executive director of the Compact Flash Association.

It's also surprisingly heat-resistant — the plastic housing is probably at more risk than the memory itself.

Filesystem and File Corruption

Physical damage is at the most basic level. At the higher end, you can have corruption and data loss without anything fundamentally going wrong. The firmware in cameras and card readers (that is, the mini-os and software that runs on the device) can make mistakes, or be caught in situations it can't handle.

The most obvious is that you can mess things up if you pull out the card while trying to write to it. Don't do that. (And remember that with caching, that can happen quite a while after you think the data transfer is done.) With SD or Compact Flash cards, it's usually reasonably safe to remove the card from a reader while it's mounted for read access; beware that if you happen to have an xD card device that this is not safe.

A bug could happen in deleting files, or if the card fills up. And, it's theoretically possible that if you format the card on a computer conflicting filesystem bugs will cause issues.

Presuming you avoid the yank-the-card-out scenario, and don't have a hardware failure, these are also pretty rare, because the filesystem implementations used in cameras have been around for a long time and are very well tested.

It's also possible that bad cables, bad USB ports, or problems in the computer itself could corrupt files on transfer. Trying again on another system is always a good first diagnostic.

In all of these cases, the card itself is really fine — reformat and you can use it again.

Bad Blocks

Then, there's the SD card really going corrupt.

This happens in two major ways:

Manufacturing Defects

There's a lot of pressure to produce small, cheap, high-capacity devices. In order to do this, manufacturers have learned to not worry about perfection, and ship devices with something like 2-5% of the memory already bad, right out of the factory. These initial bad blocks are masked out and shouldn't affect anything, but actually do have a long term effect — see below.

And it's possible that a particular card will have a lot more than it's supposed to, including blocks which weren't properly masked out. This is much more likely with cheap cards.

Accumulated Failure

Flash memory inherently has a limited number of write/erase cycles. Inevitably, electrons get trapped where they're not wanted, and the voltage levels shift, eventually causing read or write failure. Any given bit of flash memory is specified for a certain number of cycles before failure, but really it's a random process and there could be a problem long before the numbers would predict on average.

Coping Mechanisms

Because these things are inevitable, SD cards are designed to minimize the damage. In addition to the masking out of bad blocks initially, they detect and mask out new bad blocks as they appear. They're made with excess capacity initially, and as blocks wear out, spare blocks are transparently substituted, so everything keeps working. The flash card's built-in controller will use error correction to prevent the errors from corrupting data as they occur.

But, cheaper cards may have less sophisticated error correction, and are likely to have less spare capacity for covering up for bad blocks.

Flash devices also use wear leveling, so that writes are spread across the whole device, not just always using the same area over and over. Here again, cheap cards may do a worse job of this.

So, Overall...

It's worth it to buy high-quality name-brand cards because of the inherent issues in the last section. Even then, failure is inevitable (like death and taxes), so don't place all of your eggs in the same basket — make sure you have backups. Other than that, the main advice is to be careful when writes are occurring.

Originally by user1943. Source · Licensed CC BY-SA 4.0

user1943

13y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

SD cards usually “go corrupt” for two broad reasons: the card itself is failing, or bad data is being written to it.

A faulty card may have bad flash blocks or a failing controller. With flash memory and wear leveling, a hidden bad block may only cause trouble when the controller eventually tries to use it, which can make failures seem random—fine for months, then suddenly corrupt after a few shots.

The other possibility is that the camera or device wrote invalid data, though in-camera corruption is often blamed on the card first.

Why cheaper cards? Lower-cost cards may have poorer quality control, weaker controllers, or less effective handling of bad blocks. If a card is unreliable, the practical advice is simple: stop trusting it. SD cards are inexpensive compared with the value of your photos.

Physical damage and static can also damage cards, but normal handling usually isn’t the main cause.

Best practice: back up anything recoverable, fully format the card in the camera, test it, and if it corrupts again, replace it with a reputable card with a warranty.

UniqueBot

AI

13y ago

Your Answer