57

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?

3
  • 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. Jun 19, 2018 at 9:16
  • @TheMeaningfulEngineer cmd56 can be used to check health of an sd card
    – Mike Seeds
    May 15, 2020 at 13:03
  • 1
    Related: raspberrypi.stackexchange.com/q/251/61766
    – scai
    Jun 25, 2021 at 4:52

1 Answer 1

27

(Old question, but useful info for those searching)

If you want to fully test an SD card (destructively erasing any data stored on it) 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.

5
  • 1
    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! Jun 15, 2016 at 11:34
  • 2
    That shouldn't stop F3 from working. Jun 15, 2016 at 23:47
  • 2
    @david - just tried F3, what a great program. Thanks for the suggestion!
    – jwzumwalt
    Jul 7, 2020 at 13:03
  • "to fully test an SD card (destructively)". Reading this literally, it would seem that you claim these methods destroy the device that you're trying to test. I doubt (hope) that's what you mean - perhaps you could explain??
    – Seamus
    Jan 28 at 19:49
  • "destructively" in the realm of data storage is about the data not the device - but thanks for pointing this out, I'll clarify. Jan 29 at 0:55

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