36

Is there a way to estimate the lifetime of a SD card? If not, is there a utility I can use that monitors its integrity and reliability so I know when to use a new SD card?

  • 4
    I'm also confused by the reasoning behind the "close" votes as not constructive. Is it because different SD cards will have different answers? – ramblinjan Jun 13 '12 at 20:05
  • It is just very hard to answer authoritatively, until someone actually does some experiments to find out. – finnw Jun 13 '12 at 20:34
  • 2
    What makes it a bad question is that the answers will be guesses – finnw Jun 13 '12 at 20:52
  • 9
    That would make those answers bad answers. Just because it can't be answered accurately now doesn't mean it can't be accurately answered. – ramblinjan Jun 13 '12 at 20:57
  • 9
    @finnw - A question which is difficult to answer isn't a bad question, it's a good question! It's a question which people are going to keep on asking, so is perfect for a site intended as a reference for answering questions that people want answered. Bad answers on the other hand can be voted down. Not allowing people to try to answer defeats the purpose of a stack exchange site. – Mark Booth Jun 14 '12 at 10:28
10

There are several tools that will check integrity of a filesystem, and recurring errors will point to a SD card reaching the end of its lifetime.

fsck is a commonly used Linux application and you can use it to check a partition like this:

fsck /dev/sdx

Where x is the partition number.

As for estimating the lifetime, the Sandisk Product Manual states:

SanDisk SD cards have an endurance specification for each sector of 100,000 writes typical (reading a logical sector is unlimited).

However, I do not know how many read/writes the typical OS uses on average.

  • I think 'typical' would be indescribable. It would be completely dependent on the software installed. It may be possible to calculate the read/writes of a clean install but that will vary with each little update making the statistic fairly meaningless. I think the tools you listed combined with the knowledge that it will take a good while to burn up a card should be sufficient base data to go on. – ian.shaun.thomas Jun 14 '12 at 16:48
  • @tencent I think it's the best we can do. – Jivings Jun 16 '12 at 14:21
6

SD cards do the monitoring themselves, so you don't have to. Modern commercial-grade SD cards will use sophisticated wear leveling algorithms which detect and isolate bad blocks as they appear, so at any given moment no bad blocks are exposed to the file system.

Things keep going until the SD card runs out of reserved spare blocks, at which point most cards permanently lock themselves to read-only mode. This is intended to give the user a chance to read out the data and move it to another medium. This is how you know you need to get a new one.

Since the card typically runs out of spare blocks while you're writing on it, having journaling enabled greatly helps to recover your data.

3

For ATP branded Industrial SD Cards, they provide "SD Lifetime Monitoring Tool" software for Linux/Windows. But if you use this tool you must run this tool from a Host Operating System. That means you can not use this software inside SD Card to check itself. Because if you run this software, SD card can not be accessable.

For Reference - Google: ATP Industrial Grade SD Card Specification (Revision 3.8)

enter image description here

2

You can scan all blocks of your partitions with

time badblocks -sv /dev/mmcblk0p2 -o mmcblk0p2.log

mmcblk0p2 refers to the partition and has to be replaced by the partition to scan. You can list your partitions with lsblk or fdisk -l.

Bad blocks will be recorded to the log file.

Unmounting of the file system is not necessary.

You can also do non-destructive write tests (-n option), if you find it necessary.

If you don't need to preserve the data you can also do faster (destructive) write test (-w option).

1

I just came across a tool to check Panasonic SD Cards for remaining endurance:

https://av.jpn.support.panasonic.com/support/global/cs/sd/tool/card_checker.html

It only has Mac and Windows versions though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.