SD Card Image Comparison
Since I sell embedded products in a B2B environment, I use eMMC and SD cards as storage media for the operating system and system images. For mass production and delivery, the same image must be written to a large number of eMMC modules and SD cards.
However, when issues arise in some delivered products, it becomes necessary to check whether the images stored on the eMMC or SD cards are corrupted or inconsistent. To do this, I performed an image comparison between SD cards taken from a normal (working) product and a problematic one.
Using a third Linux PC, I mounted two SD cardsโone known-good and one suspected to be faultyโand compared their contents to verify whether the image itself was damaged or had any inconsistencies.
Mounting
sudo mkdir -p /mnt/sdf1 # boot1 ํํฐ์ ์ฉ sudo mkdir -p /mnt/sdf2 # root1 ํํฐ์ ์ฉ sudo mount /dev/sdf1 /mnt/sdf1 # sde1 โ /mnt/sde1 sudo mount /dev/sdf2 /mnt/sdf2 # sde2 โ /mnt/sde2 sudo mkdir -p /mnt/sdg1 # boot1 ํํฐ์ ์ฉ sudo mkdir -p /mnt/sdg2 # root1 ํํฐ์ ์ฉ sudo mount /dev/sdg1 /mnt/sdg1 # sde1 โ /mnt/sde1 sudo mount /dev/sdg2 /mnt/sdg2 # sde2 โ /mnt/sde2
Comparison
sudo sh -c ' cd /mnt/sdg2 && \ find . -path "./System Volume Information" -prune -o -type f -exec sha256sum {} + | sort \ > /home/jamesyeon/hash_sdg2.txt ' sudo sh -c ' cd /mnt/sdf2 && \ find . -path "./System Volume Information" -prune -o -type f -exec sha256sum {} + | sort \ > /home/jamesyeon/hash_sdf2.txt ' sudo diff -u ~/hash_sdg2.txt ~/hash_sdf2.txt sudo sh -c ' cd /mnt/sdg1 && \ find . -path "./System Volume Information" -prune -o -type f -exec sha256sum {} + | sort \ > /home/jamesyeon/hash_sdg1.txt ' sudo sh -c ' cd /mnt/sdf1 && \ find . -path "./System Volume Information" -prune -o -type f -exec sha256sum {} + | sort \ > /home/jamesyeon/hash_sdf1.txt ' sudo diff -u ~/hash_sdg1.txt ~/hash_sdf1.txt
sudo rsync -avc --exclude='System Volume Information/**' \ --exclude='var/lib/systemd/random-seed' \ /mnt/sdg2/ /mnt/sdf2/
ย
Unmount
sudo umount /mnt/sdd1 /mnt/sdd2 sudo umount /mnt/sdf1 /mnt/sdf2
ย
The comparison commands themselves can be scripted and executed quickly. However, the most time-consuming part of this process is the physical action of inserting and removing the SD cards used as comparison targets. This step cannot be automated. As a result, comparing dozens of SD cards requires dozens of repetitive manual actions.
ย
Related posts
AXERA AX650N setup
Sep 18, 2025
Axera AX650N Test Record
My First PCB Prototype with AI: The Connector Was Harder Than the Design
Aug 31, 2026
I designed and ordered my first small auxiliary PCB for work. AI accelerated circuit design and production preparation, but connector sourcing and validating the board in the real world still required careful manual work.
ThunderScope: The Open-Source Oscilloscope That Moves the Display and Processing to a PC
Aug 12, 2026
ThunderScope is an open-source oscilloscope that streams four channels of 1 GS/s data to a PC in real time over Thunderbolt, USB4, or PCI Express. This article explores its PC-based display and processing architecture, the ngscopeclient and TS.NET software stack, multi-unit synchronization, and the potential for custom gateware.
