Skip to content

SD-EMMC Health Analyzer tool that reads hardware lifetime estimates from eMMC/SD cards, calculates wear percentage, and predicts remaining lifespan based on current usage patterns (since boot).

Notifications You must be signed in to change notification settings

sam0rr/SD-EMMC-HEALTHCHECK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

SD‑EMMC Healthcheck

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.

Features

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

Prerequisites

  • bash (version 4+)
  • mmc-utils (for mmc 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

Installation

Choose one of the following methods:

1. One‑line curl + bash

Downloads and executes the script without saving it locally.

curl -fsSL https://raw.githubusercontent.com/sam0rr/SD-EMMC-HEALTHCHECK/main/healthcheck.sh | bash

2. Install as a system command

  1. 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
  2. Make executable:

    sudo chmod +x /usr/local/bin/sd-emmc-healthcheck
  3. Run it directly:

    sd-emmc-healthcheck

How it works

  1. discover_emmc_devices: Finds block devices matching mmcblk[0-9]+.
  2. select_device: Prompts user to choose a device.
  3. read_device_stats: Reads /sys/block/<device>/stat for write counters.
  4. mmc extcsd read: Retrieves EXT_CSD registers for lifetime estimates.
  5. Calculations: Uses awk and bc to compute wear percentages and TBW.
  6. Report: Displays formatted output with colors and recommendations.

License

MIT License © 2025 Samorr

About

SD-EMMC Health Analyzer tool that reads hardware lifetime estimates from eMMC/SD cards, calculates wear percentage, and predicts remaining lifespan based on current usage patterns (since boot).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages