65

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?

Kevin
  • 40,087
  • 16
  • 88
  • 112
Grzegorz Wierzowiecki
  • 13,865
  • 23
  • 89
  • 137
  • Hey Grzegorz, any success with this question. I'm struggling with a [similar issue](https://unix.stackexchange.com/questions/450476/defining-a-state-of-a-failed-sd-cards) 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 09:16
  • @TheMeaningfulEngineer cmd56 can be used to check health of an sd card – Mike Seeds May 15 '20 at 13:03
  • 2
    Related: https://raspberrypi.stackexchange.com/q/251/61766 – scai Jun 25 '21 at 04:52

1 Answers1

33

(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.