That cheap 256 GB SD card or USB stick from a marketplace listing might not be what it claims. A whole industry of counterfeit flash exists: the card reports a big size to your computer, but the real chip inside is much smaller. You copy files onto it, everything looks fine, and then the data past the real capacity silently turns to garbage — usually discovered the day you try to read your photos back.
The way to catch this is to actually write data across the whole claimed capacity and read it back to see where the real storage ends. A small open-source tool called sdcard_checker does exactly that. It writes a unique, unpredictable pattern to every region of the card, reads it back, and reports where (if anywhere) the card stopped storing your data honestly. It measures read/write speed at the same time, so it also flags the painfully slow fakes.
This guide walks a complete beginner through getting the tool and running it. A few things to know up front:
- It is Linux only — it talks to the card through Linux block devices and
/sys. - It is free software (GPLv3). The project lives at
https://github.com/frebergguru/sdcard_checker. - It ships two programs:
sdcheck(the command-line tool — the focus of this guide) andsdcheck-gui(a graphical window, covered briefly at the end).
Step 1: Get the tool
There are two ways to install it. Pick one. If you are not sure, use Option A — it is the least fuss.
Option A — Download the prebuilt version (easiest)
The project publishes ready-to-run files for each release, so you do not need a compiler or any build tools. Open the releases page in your browser:
https://github.com/frebergguru/sdcard_checker/releases
Download the latest release. You will see two kinds of file (built for 64-bit x86 / Ubuntu 24.04-compatible systems):
- An
.AppImage— a single self-contained file that runs the graphical app with zero installation. Best if you just want a window to click in. - A
.tar.gzarchive — the full system install: thesdcheckcommand-line tool, the GUI, and the helper bits that let the GUI ask for permission safely.
To use the AppImage: make it executable, then run it.
cd ~/Downloads
chmod +x sdcard_checker-*.AppImage # mark it runnable
./sdcard_checker-*.AppImage # launch the GUI
To use the tar.gz (this gives you the sdcheck command everywhere): unpack it and run the bundled installer.
cd ~/Downloads
tar -xzf sdcard_checker-*.tar.gz # extract
cd sdcard_checker-* # enter the extracted folder
./install.sh # installs sdcheck, the GUI, and helpers
The installer asks for your password (via sudo) because it copies files into system folders. When it finishes, the sdcheck command is available in any terminal. Skip ahead to Step 2.
Option B — Compile it yourself
Building from source is worth it if your distribution is not Ubuntu 24.04, if you are on a non-x86 machine (e.g. a Raspberry Pi), or if you simply prefer to build your own tools. It is only three commands once the prerequisites are in place.
Install the build prerequisites. You need CMake (3.16 or newer), a C compiler, and Git. The GTK4 library is optional — it is only needed if you also want the graphical app; without it the sdcheck command-line tool still builds fine.
# Debian / Mint / Ubuntu
sudo apt install git cmake build-essential libgtk-4-dev
# Arch / Manjaro
sudo pacman -S git cmake base-devel gtk4
# Fedora
sudo dnf install git cmake gcc gtk4-devel
Download the source and build it:
git clone https://github.com/frebergguru/sdcard_checker.git
cd sdcard_checker
cmake -B build # configure the build
cmake --build build # compile
When it finishes you will have two freshly built programs sitting in the build folder: build/sdcheck and (if GTK4 was present) build/sdcheck-gui. If a missing optional piece like GTK4 is skipped, the build simply tells you and carries on — the CLI is always built.
Install it system-wide so you can type sdcheck from anywhere:
./install.sh # installs to /usr and reloads the permission service
You can run it straight from the build folder without installing — ./build/sdcheck list — but installing is more convenient.
Step 2: Before you test — read this
Testing the full capacity of a card is destructive: it overwrites everything on the card. That is unavoidable — to prove the storage is real, the tool has to write to all of it. So:
- Back up anything you care about off the card first. A real capacity test erases it.
- Identify the right device. Wiping the wrong disk is the classic disaster. List your devices and find the card by its size and removable flag:
lsblk -o NAME,SIZE,RM,TYPE,MOUNTPOINTS
The RM column is 1 for removable media. Your SD card might appear as /dev/mmcblk0 (a built-in card slot) or /dev/sdb (a USB card reader). Note the exact name — you will use it below. As a safety net, sdcheck refuses to touch non-removable / system disks, and every destructive command requires you to type --yes and run as root.
A handful of ordinary system tools do the low-level work; most desktop Linux installs already have them: lsblk, sudo, sfdisk, udevadm, and (for formatting) mkfs.exfat / mkfs.vfat. If a command complains one is missing, install the matching package (util-linux, exfatprogs, dosfstools).
Step 3: Test the card with sdcheck
This is the main event. Work through these in order.
1. Find the card. This lists removable devices so you can confirm the name from Step 2:
sdcheck list
2. Look at the card's identity (optional, but interesting):
sdcheck info /dev/mmcblk0
Native SD slots expose the card's built-in ID (the "CID"); cheap USB readers often hide it, so do not worry if some fields are blank.
3. The safe, non-destructive check. If you just want a quick sanity check without erasing anything, test the card's free space while it is mounted. Point sdcheck at the folder where the card is mounted (find it in your file manager, or in the MOUNTPOINTS column of lsblk):
sdcheck file /run/media/you/MYCARD
This fills the unused space with the test pattern and verifies it, leaving your existing files alone. It cannot test space that is already occupied, so it is a lighter check — but it is the one to use when you cannot wipe the card.
4. The thorough, destructive capacity test. This is the definitive fake-detector. It overwrites the whole card, so make sure you backed it up:
sudo sdcheck device /dev/sdb --yes
By default this samples cleverly across the claimed capacity (fast, and enough to expose almost any fake). To write and read back every single block and build a bad-block map, add --full:
sudo sdcheck device /dev/sdb --yes --full
5. Read the verdict. Besides the on-screen report, sdcheck tells you the result through its exit code, which is handy in scripts:
0— the card is genuine (or honestly reports a limited size).2— the card is a fake: it stored less than it claimed.1— an error occurred (could not run the test).
Check it right after the command with echo $?.
Handy options
--quick— sparse sampling (this is the default; fast).--full— write and read the entire surface; slowest but most thorough.--passes N— repeat the whole testNtimes for extra confidence.--iops— also measure random 4K IOPS (the "A1" / "A2" app-performance class).--report results.json— save the full results to a JSON file you can keep.
Formatting and the all-in-one mode
Once you trust a card, sdcheck can also prepare it for use:
sudo sdcheck format /dev/sdb --yes # low-level erase
sudo sdcheck format /dev/sdb --yes --partition # erase + make a partition
sudo sdcheck auto /dev/sdb --yes # test, then format only if genuine
The auto command is the convenient one for a new card: it runs the capacity test and, if the card passes, formats it ready to use — but refuses to format a fake.
Want to try it without risking a real card?
You can rehearse the whole thing against a plain file that pretends to be a card. No root, nothing to lose:
sdcheck device ./card.img --yes --full
Great for learning the commands before you point them at real hardware.
Prefer a window over a terminal? Use sdcheck-gui
If the command line is not your thing, the project includes a graphical version with the same features — safe (free-space) testing, destructive capacity testing with the same options, low-level formatting, viewing the card identity, and saving JSON reports. Launch it either by double-clicking the AppImage from Option A, or by running:
sdcheck-gui
One nice safety design: the GUI never runs as root itself. When you ask it to do something destructive, it pops up your system's standard authorization dialog (via polkit / pkexec) to get permission for just that action. If your user is in the disk group it will not even prompt.
Quick reference
sdcheck list— show removable devices.sdcheck info /dev/mmcblk0— show card identity.sdcheck file /run/media/you/CARD— safe, non-destructive free-space test.sudo sdcheck device /dev/sdb --yes [--full]— destructive capacity test (the fake-detector).sudo sdcheck auto /dev/sdb --yes— test, then format if genuine.- Exit code:
0genuine,2fake,1error.