An SD-EMMC lifetime and health analysis tool written in Bash. This script detects SD-EMMC devices on your system, reads hardware registers, computes wear metrics, and generates a detailed report with lifespan estimates and recommendations.
- Device discovery: Automatically finds
mmcblk*
devices. - Wear analysis: Parses EXT_CSD registers to calculate A/B lifetime estimates.
- Write statistics: Computes daily and total written bytes.
- Lifespan projection: Estimates TBW, remaining life in days and years.
- Health assessment: Flags devices as Excellent, Good, or Attention Required.
- Recommendations: Provides actionable guidance based on wear.
bash
(version 4+)mmc-utils
(formmc extcsd read
)bc
(arbitrary‑precision calculator)- Linux system with
/sys/block/mmcblk*
support
If you don’t have mmc-utils
or bc
installed:
sudo apt update
sudo apt install mmc-utils bc
Choose one of the following methods:
Downloads and executes the script without saving it locally.
curl -fsSL https://raw.githubusercontent.com/sam0rr/SD-EMMC-HEALTHCHECK/main/healthcheck.sh | bash
-
Download to
/usr/local/bin
:sudo curl -fsSL \ https://raw.githubusercontent.com/sam0rr/SD-EMMC-HEALTHCHECK/main/healthcheck.sh \ -o /usr/local/bin/sd-emmc-healthcheck
-
Make executable:
sudo chmod +x /usr/local/bin/sd-emmc-healthcheck
-
Run it directly:
sd-emmc-healthcheck
- discover_emmc_devices: Finds block devices matching
mmcblk[0-9]+
. - select_device: Prompts user to choose a device.
- read_device_stats: Reads
/sys/block/<device>/stat
for write counters. - mmc extcsd read: Retrieves EXT_CSD registers for lifetime estimates.
- Calculations: Uses
awk
andbc
to compute wear percentages and TBW. - Report: Displays formatted output with colors and recommendations.
MIT License © 2025 Samorr