What's the life expectancy of an SD card?

102

35

I have some SD cards that I use. Is there a limit to how many times I can write over them? If I leave information on a card, is there anything that can cause it to lose this information eventually (other than a magnetic field)? What's the preferred storage conditions for these cards?

Yuval

Posted 2009-08-02T21:22:07.290

Reputation: 2 022

There is contact wear concerns also...http://superuser.com/questions/405942/how-much-does-it-wear-an-sd-card-to-be-frequently-removed-reinserted

– Moab – 2012-03-28T22:24:17.183

1Be aware of static electricity discharges too; they might destroy your card... and it's easy to get static electricity from all the rubbing on the plastic clothing - unlike the lava thing or the train. – None – 2012-10-26T09:33:14.067

Answers

103

Flash memory indeed has limited write cycles. However, by now it is unlikely that you'll encounter this within the normal lifetime of such a card. Usually this is in the order of 100,000 write cycles today and SD cards include circuitry to manage wear-leveling, that is, spread out writes over the storage media evenly to avoid "hot spots"—pages that are written too frequently and therefore failing early.

Information stored on the card is safe even in magnetic fields because the information is not stored magnetically (contrary to hard drives or floppy disks).

As for storage conditions ... you shouldn't store them in mud, water, lava or other harmful conditions. You probably also shouldn't put them on railways and let trains drive over them. Apart from that, not paying particular attention where I store my cards I haven't had any adverse effects so far. In practice I'd think whatever doesn't physically damage the card won't harm the data on it.

Joey

Posted 2009-08-02T21:22:07.290

Reputation: 36 381

@Johannes, How about booting from such memory? http://superuser.com/questions/681/booting-linux-off-usb-pendrives

– nik – 2009-08-03T01:14:28.173

37One of my SD cards has been through 3 cycles, wash cycles that is, in the washing machine and works fine...and cleaner too may I add. They are really tough. ;-) – GeneQ – 2009-08-03T03:19:16.187

2@Kevin You'd have one nickel? – Jared Harley – 2009-08-03T03:52:44.840

nik: Never tried myself but works. We've installed a traffic shaper here in the dormitory which runs off a CF card. However, we don't expect much writes there, so that may be a consideration to make before doing so. – Joey – 2009-08-03T07:54:18.923

1Seriously though don't let static electricity touch the gold contacts. The data might be OK but the microcontroller in the card would be fried. – LawrenceC – 2011-11-20T02:52:46.907

8Babu's future amazon review - "one star - I took this SD card into the volcano to take pictures with and when I came out the SD card no longer worked! JUNK DO NOT BUY!" – Natalie Adams – 2012-09-15T16:39:47.243

8

SD cards do not have 100,000 write cycles, at least not for any reasonably priced ones. SLC flash sometimes does, not MLC. See actual test data. Or here.

– derobert – 2013-07-30T15:38:51.910

3Anecdotal data: I've had two micro SD cards fail on me in the past two weeks (a 16GB and a 2GB). These cards were more or less permanently mounted in a device - so no insertion/removal wear. As far as I know they didn't have unusual write activity; these were just in phones for whatever Android phones do with them. Suddenly the phone says that there's no SD card, and nothing will read or write to them - not phones, not Windows, not Linux (in a variety of machines). I'm not sure what this tells anybody other than it doesn't necessarily take a lava flow to render an SD card non-functional. – Michael Burr – 2013-12-28T09:10:45.117

2Well, to be fair, the question was more about environmental and storage conditions. Android, depending on the apps, can be fairly write-happy. And I seem to have misread the write cycle reliability; at least Wikipedia tells a different tale with just 3k–5k cycles. – Joey – 2013-12-28T12:49:49.543

51

Never trust FLASH memory of any kind for long term storage. My experience with FLASH is integrity begins to falter in as little as 5 years. The voltages stored in the FLASH memory cells dissipate and can be misinterpreted after a while. High temperatures will accelerate the dissipation and shorten storage even less than 5 years.

High density FLASH where one cell can represent 2 bits has greatest failure rate.. most common in use as it is the cheapest to manufacture (double capacity). Many FLASH micro-controller applications are failing after 5-10 years because of FLASH memory corruption. Re-FLASHing the firmware restores the chip for another 5-10 years etc. So you must refresh FLASH memory data periodically to ensure continued integrity. Same would apply if you wanted to use the SD card as long term storage.

The FLASH memory chip itself is extremely rugged and can offer hundreds, if not thousands of years of service; as long as maximum write cycle lifespan has not been exceeded. FLASH memory cells are like millions of individual microscopic batteries that are charged at different levels. As you know, any battery new in the pack sitting on a shelf for years will eventually discharge. Same applies to FLASH memory cells, they require "recharging" periodically to maintain proper charges which represent data bits. So a FLASH memory card put into a safety deposit box for 25 years... guaranteed you will have corrupt data when you try to use it. I have seen FLASH memory with 20% corruption after 10 years of sitting in storage.

FLASH thumb drives are great for transferring data from one computer to another etc, but NEVER to be used for long term archival storage. Same goes for the conventional CD ROM. After 5-10 years, the contrast dye will fail causing read errors.

The best medium for long term storage are ARCHIVAL GOLD CD-R or similar brand. The storage medium on the disk is a thin layer of 24K gold so it will not oxidize. Data retention on this type of CD is expected to be intact even after 300 years. They are expensive compared to conventional CD-R.

Gavin Curtis

Posted 2009-08-02T21:22:07.290

Reputation: 511

1This is interesting. I have not heard of this. I would also like to hear more about this recharging procedure. Or is there anyone else that can back up this statement? – zingle-dingle – 2014-06-21T04:23:33.650

1Citation needed. As wikipedia would say. – Chris F Carroll – 2015-07-19T08:24:27.120

2sorry but ... are you suffering from some sort of FLASH-induced seizure? Whats with the capitalization? – specializt – 2016-04-13T16:08:25.953

@zingle-dingle This phenomenon has a name: bit rot. There are many discussion around, e.g. https://news.ycombinator.com/item?id=9759836; https://getprostorage.com/blog/bit-rot-stop-destroying-your-data/

– Ben – 2018-12-15T13:48:46.080

A crucial question would be: do microsd card manufacturers include background data scrubbing in their chips to mitigate bit rot while being powered? periodically reading the whole device actively would be a good idea. That should trigger internal error correction, which should rewrite bad cells. otherwise, copying the whole dataset once a year is the safest option. – korkman – 2019-01-18T13:07:13.210

5 years? Hah! My HDDs don't even last that long. – Tanath – 2019-02-26T04:24:10.733

5nice writeup. Thanks for sharing your knowledge. Can you add a paragraph on how we can 'refresh FLASH memory data periodically'? Thanks. – shellter – 2012-05-04T04:00:07.080

38

Durability

In my experience, memory cards are quite durable, though occasionally finicky when it comes to formats. I recently ran a cellphone through the washing machine (it was so dirty), and the 2 GB microSD card works just fine in my new phone (I eventually got the washed phone working too, but it was a good excuse to upgrade).

Rob Galbraith, who maintains an amazing website on CompactFlash and Secure Digital cards, says

Individual flash memory cells have a limited lifespan. That's the bad news. The good news is that their lifespan is usually measured in the many, many thousands of erase/write cycles, and that card controllers use an algorithm that balances the wear across the entire card's cells. CompactFlash and SD/SDHC cards are designed to automatically and transparently map out memory cells that go bad, or in some cases when they reach a predefined limit.

Write cycles are important, but MTBF (mean time between failures) is often 1M-2M hours or more, factoring in advances such as wear leveling, bad-block marking and management, etc.

Tips

  • Do not defrag a memory card. This consumes write/erase cycles and shortens the MTBF.
  • Use FAT32 instead of a journaling file system (like NTFS), which will write more often.
  • SD cards are rated to hold data at something like 10 years sitting idle. I recall reading (not sure where) about re-energizing cards by occasionally inserting into a reader.

Anecdotes

The 2004 BBC article Digital memories survive extremes covers an interesting study by Digital Camera Shopper on the durability of memory cards.

The memory cards in most cameras are virtually indestructible, found Digital Camera Shopper magazine. Five memory card formats survived being boiled, trampled, washed and dunked in coffee or cola.

In 2004, there was an incident (covered happily in a SanDisk press release at the time) where a photographer's compact flash card survived a bridge explosion where the camera gear was set up so close to the blast that it was destroyed, but the CompactFlash card survived. Other incidents like plane crashes are hyped by SanDisk so much that, admittedly, I get nervous using other brands. That said, it's not always easy to get data from a damaged card. An atmospheric research balloon crashed in the Pacific Ocean and was recovered. One SD card was read easily but another required intervention from SanDisk, but it was eventually read.

Bill Biggart's photos from 9/11 survived the collapse of the second tower on a CompactFlash microdrive card.

Recovery

If you suspect a card may be getting flakey, or if you run into trouble reading a card, immediately create a backup of everything on the card. There are low-level recovery tools like TestDisk and PhotoRec that come in handy for this.

b w

Posted 2009-08-02T21:22:07.290

Reputation: 2 424

That's durability of the physical flash chip, not the data. Flash memory suffer from bit rot, https://en.wikipedia.org/wiki/Data_degradation, this happends more often than you could notice, if your sd card is only for media file. But it's in most likely intolerable for critical code e.g. system bootloader etc.

– Ben – 2018-12-15T13:11:38.673

10

I don't know if this will help, but...

We use µSD cards for the entire filesystem on an embedded device, so they see reads and writes for logging purposes as well as swap. It is a journalled filesystem (previous teams' decision) and I have seen a handful of failures in a population of say 200 devices, with some brands having more failures than others. Some are complete catastrophic failures, I can't read nor re-partition and re-format the card and some are simply filesystem corruption and a re-partition and re-write has them working again. We don't trust those to be sent into the field however.

They have only been in the field for a maximum of 3 years. Thank goodness the real information has already been sent to a database and stored.

Patrick Buick

Posted 2009-08-02T21:22:07.290

Reputation: 101

2A handful per 200 in 3 years = typical failure rate of 2-3% within 2 or 3 years? That kind of failure rate makes me want to go double-check my backups. – Chris F Carroll – 2015-07-19T08:30:17.223

1

@ChrisFCarroll, I would be relaxed if it's just 2-3%. If you check out the hard drives failure rate, you will be surprised and even horrified https://www.backblaze.com/blog/hard-drive-reliability-stats-for-q2-2015

– GTodorov – 2016-04-04T20:42:24.630

1I am facing a similar rollout of a Linux product with micro SD cards as the RFS and am also worried about failures. I've had quite a few SD cards get corrupted in the lab and a couple fail entirely. Did your testing reveal any particular good brand? Also have you tried industrial SD cards? – fred basset – 2014-05-15T22:10:42.973

10

I've used several brands of SD cards in raspberry pi computers, and they usually start seeing memory corruption after a continuous uptime of anywhere between 1 to 3 months, larger SD cards seem to last longer, smaller SD cards wear out in just a couple of weeks.

Owl

Posted 2009-08-02T21:22:07.290

Reputation: 195

What the heck are you doing with your PIs?? I've got one that has been taking 120 pictures a day for the past five months, no problem with SD card so far. Also a small web server with uptime of almost 3 months, getting at least 50 hits a day, also no problems with SD. The camera has a 16G card and the server has an 8G which was previously used for over a year in my phone. I am sure they will get corrupt eventually, but "a couple of weeks" - you must be doing some insane reading/writing. – YemSalat – 2015-06-16T12:37:39.337

3I have been using a raspi for a sprinkler controller, and just now, at the 3 year mark, the card has gone bad. Thousands of unrecoverable fsck errors. Perhaps the raspian just logs too much for the flash to manage? – voidref – 2015-07-14T00:32:32.570

2voidref, this is a bit off topic, but that's what happened to me too, twice. After that i turned off swapping in raspbian, and also mounted the root filesystems as read only and then use a ram disk to write temp files. That seems to have worked for me. I think it happened so often for me because i didn't use high quality SD cards and used smaller capacities, so the same blocks were getting rewritten loads. Eventually a crucial file gets clobbered / corrupted and rpi kernel panics. – Owl – 2016-04-03T23:23:14.737

2You need to add noatime to the mount options of all microsd partitions, especially on read-heavy operations. Even when not running a microsd, but a "real" ssd or hdd, noatime will increase your performance. – user1933738 – 2016-10-04T22:54:10.610

1There's also nodiratime, accumulated commit also worth trying. – Ben – 2018-12-15T12:59:55.290

1raspberry pis are somewhat special in their sd card corruption. They don't have a rechargable battery nor many electronic parts smoothing power variations, plus their power supplies are cheap. AFAIK that is one main source of corruption in this case, and doesn't apply to other uses of sd cards. – korkman – 2019-01-18T13:16:58.983

9

Don't store them below -40 °C or above +100 °C (for example, a car dashboard in some places).

You can theoretically damage them with a severe enough impact. 2000 g or more might be enough.

Don't short the pins, or use them in space. Don't use them for long term archival purposes - in 500 years several of the compounds will have started degrading and no-one will know how to read them any more.

Aside from that, I think it will take substantial physical damage to lose data in storage.

Colin Pickard

Posted 2009-08-02T21:22:07.290

Reputation: 6 774

@ColinPickard, yes, it's called industrial flash storage, and it costs 10x to 1000x what normal SD cards cost. – Aaron Campbell – 2016-11-04T23:41:08.763

What about near storing / reading a sd card near a black hole or a crashing plane? – Jus12 – 2017-06-21T20:31:20.340

2What's the problem with using SD cards in space? Not that I plan on trying anytime soon, just curious... – Yuval – 2009-09-02T19:35:53.223

6A regular SD card is not radiation hardened. The controllers are vulnerable during operation. You can transport them into space, or into a nuclear reactor core, just don't attempt to operate them there. – Colin Pickard – 2009-09-08T16:28:01.183

1Suitably hardened flash memory is actually used in space all the time. – Colin Pickard – 2009-09-08T16:28:40.323