How can I check the health condition of an SD card?

When I want to check a hard drive, I can use SMART, how should I check an SD card? Is there a universal approach?

  • Hey Grzegorz, any success with this question. I'm struggling with a similar issue and am checking if someone ever did a deeper dive into what the mmc susbsystem of the kernel might offer for this problem. – TheMeaningfulEngineer Jun 19 '18 at 9:16
  • @TheMeaningfulEngineer cmd56 can be used to check health of an sd card – Mike Seeds May 15 at 13:03

(Old question, but useful info for those searching)

If you want to fully test an SD card (destructively) you can check the entire data space with the F3 tools which have been ported to Linux

They let you write a variety of patterns to the disk and then check to see if there are any failures.

You could also use badblocks, but badblocks uses repeating patterns that counterfeit scam SD cards will often still pass (cards that have less than advertised space, a common issue with online purchased cards), F3 specifically looks for these kinds of issues and is free.

It's slow, and it completely rewrites your card (or at least fills up the empty space if you just want to test that), but it's fairly comprehensive.

| improve this answer | |
  • AFAIK now flash cards have internal logic for changing sectors, so place with given offset written once might be not that same as later. Anyhow thanks for sharing! – Grzegorz Wierzowiecki Jun 15 '16 at 11:34
  • 1
    That shouldn't stop F3 from working. – David Ljung Madison Stellar Jun 15 '16 at 23:47
  • 1
    @david - just tried F3, what a great program. Thanks for the suggestion! – jwzumwalt Jul 7 at 13:03

SD cards are pretty much the worst kind of flash storage. They're fine for cameras that do large linear reads and writes to FAT format cards, and don't overwrite the same spot very often, but they wear out very quickly of you try to put a rootfs on them. I have a very unhappy card in a dev board to prove it.

I don't know of a way to monitor the card, but in my experience it'll be the files you use most that die first. On my card it was the apt files under /var (the ones that get updated every day) that developed faults.

If you need to use flash storage, USB drives are a faster and more reliable option.

EDIT: If you want to check a cards current state, plain old fsck is certainly a good start. Do not be tempted to do any sort of bad-blocks scan though as you'll only wear the card out sooner.

| improve this answer | |
  • 14
    OK, but he already has an SD card and wants to check its condition. You don't address his question. – Kevin Apr 4 '12 at 21:27
  • Like I said, I don't know a way to monitor the condition. I will add a comment about scanning them though. – ams Apr 4 '12 at 21:33
  • 14
    If you don't know the answer...then don't answer... "Flash cards suck" is not helpful. – Cerin Jun 29 '16 at 2:06
  • 2
    @cerin not knowing an answer is different from not knowing a way. Perhaps the answer is that there is no way to monitor (like with SMART for ATA/SATA/etc. drives), and therefore ams does provide an answer. This is also my opinion that there is no way to query an interface to check an SD card health status, as flash card are pretty dumb (w.r.t. SSDs or HDDs) they do not have attributes which you could query. As ams suggest in his edit, doing fsck and also monitoring for log messages from the VFS/block layer in syslog are the best approach to see problem coming. – Huygens Apr 15 '18 at 14:02

I answered a similar question on superuser here.

In brief: I personally use the non well known software named F3.

Also take into account that *not all USB SD cards readers can read correctly "big" SD cards:

  • SDHC: 2Go - 32Go
  • SDXC: 32Go - 2To

If you try to read a SDXC card on a card reader that can only read SDHC cards, you'll not be able to read correctly all card data, and that can look like data corruption.

Source: - Wikipedia - sandisk

| improve this answer | |
  • SDXC cards are functionally exactly the same as SDHC, just that they come formatted with exFAT. – Paul M Nov 18 '18 at 22:26
  • 1
    This answer doesn't seem to add anything except incorrect info about SDXC/SDHC? – David Ljung Madison Stellar Jul 2 '19 at 6:24
  • @DavidLjungMadison I'm conused but where do you see incorrect info about SDXC/SDHC ? – brunetton Jul 3 '19 at 10:04
  • 1
    Fair enough - I'm still confused as to how this is an answer to the OP question? This seems more like it should be a comment... – David Ljung Madison Stellar Jul 3 '19 at 23:21
  • 1
    The link is dead, any alternatives? – Roman Gaufman Apr 3 at 15:33

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.