User avatar
Posts: 163
Joined: Sat Mar 03, 2012 11:48 am
Location: Melton Mowbray, England

SD Card Failures

Sat Feb 04, 2017 2:10 pm

I have several Pi's, some dating back to the very begining. I have experienced several SD card failures, sometimes I can reformat and use again, other times the card is scrap. In the early days I looked on line for cheap cards but over the last couple of years I only buy reputable brands from established suppliers. I am currently using Toshiba microSDHC UHS-I 16GB cards, which have a 5 year warranty, but so far two have failed in 3 months.

When I look on-line there is a lot of info on SD cards, but all related to use in cameras or sometimes phones. This leads me to wonder about the expected duty. A serious photographer may take a hundred pictures per day, so over the 5 year warranty period that is about 200,000 pictures. One of my Pi's records about 50 values per minute to a MySQL database, so that is 130 million over 5 years, 600 times the camera usage.

Is this a reasonable way to look at it or have I missed something?

I have started looking a hard disk boot as an alternative, but would be interested to hear other peoples experience and views on SD card failures.


User avatar
Posts: 97
Joined: Wed Jun 04, 2014 8:31 pm
Location: Germany

Re: SD Card Failures

Sat Feb 04, 2017 5:37 pm

I believe you may have better luck with a card that is designed for dash cam usage like the SanDisk High Endurance Video Monitoring cards. The warranty is noticeably lower (2 years vs lifetime) but I think there is a much higher chance for the card to survive heavy writes due to its intended usage. Should be around 50TB of writes for the 32 GB and 100TB for the 64GB card.

Fact is, micro SD card flash is pretty crap. Usually being a waste product of SSD manufacturing, the cards come with very low grade flash and the controllers used can only compensate so much for this.

Then again, MySQL tends to be pretty write heavy. Have you tried putting the database into a RAM disk or increasing the amount of cache MySQL is able to use before writing to disk? Small writes are bad for flash since each time a large 4KB or larger block has to be erased in order for there to be another write.

My Pi 2 has been running continuously for nearly 2 years on it current card, so 3 months seems a bit low, although that will depend on write behaviour.

Posts: 376
Joined: Wed Feb 13, 2013 1:22 pm

Re: SD Card Failures

Sat Feb 04, 2017 10:54 pm

I don't have anything that samples as rapidly as 50 per minute - my fastest long-term data sampling is 10 samples per minute. However, what I do on all my pis that are sampling and stashing data is to set up a small ram partition, mounted as eg /mnt/RAMdata, and I put the data into there as it is sampled and then periodically (say, every ten minutes) transfer it to somewhere actually on the SDcard. That takes two orders of magnitude off the number of writes to the SDcard, though it does obviously introduce the risk of losing ten minutes of data in the event of a power cut.

Return to “General discussion”