To check an SD card’s health on Linux, first look for errors when you use it (dmesg and a filesystem check with fsck), then test the whole card with f3 (f3write and f3read), which writes test data, reads it back, and reports bad or fake capacity. Most SD cards don’t support SMART health reports, so a full read/write test is the most reliable check. Back up the card first.
Quick Answer
Back up, then run f3write /media/you/SDCARD and f3read /media/you/SDCARD. “Data LOST: 0” means the card passed.
Step 1: Check for Errors
- Insert the card and run sudo dmesg | tail -50 to look for I/O errors.
- Find the device name with lsblk (for example, /dev/mmcblk0p1 or /dev/sdb1).
- Unmount it (sudo umount /dev/sdb1) and run sudo fsck -f /dev/sdb1 to check the filesystem.
Step 2: Test the Card With f3
- Install f3: sudo apt install f3 (Debian/Ubuntu) or your distro’s package manager.
- Mount the card and run f3write /path/to/mount. It fills free space with test files.
- Run f3read /path/to/mount. It verifies every file.
- Delete the .h2w test files when done.

Tools Compared
| Tool | Checks | Destructive? |
|---|---|---|
| dmesg | Kernel I/O errors | No |
| fsck | Filesystem consistency | No (repairs if needed) |
| f3write / f3read | Real capacity, bad areas | No (uses free space) |
| f3probe –destructive | Fast fake-capacity test | Yes, erases the card |
| badblocks -w | Every block | Yes, erases the card |
| smartctl | SMART data | No, but most SD cards don’t report SMART |
Signs a Card Is Failing
- Files that won’t open or copy, or errors in dmesg.
- The card switching to read-only on its own.
- f3read reporting corrupted or lost data.
- Capacity much smaller than the label (a fake card).
Troubleshooting
- Card is read-only: Check the lock switch on full-size cards or adapters. Many cards go read-only permanently when worn out.
- Wrong device risk: Double-check lsblk output before running any destructive command.
- Testing on Windows? Similar tools exist; also see when drives won’t open.
Frequently Asked Questions
How long does f3 take?
It depends on size and speed; a 64 GB card can take an hour or more.
Can I repair a failing card?
fsck can fix filesystem errors, but worn flash memory can’t be repaired. Replace the card.
Summary
- Back up the card.
- Check dmesg and run fsck.
- Test with f3write and f3read.
- Replace cards that lose data.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.