franzbischoff / RaspberryPi-SDcard-SMARTQuery

How to: Monitor SD card health and status using Raspberry Pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monitor SD card health and status using Raspberry Pi

Get S.M.A.R.T data for Transcend SD card.


The various statuses of MicroSD products are located in the SMART block of the device. By reading and analyzing the SMART block, you can get the product name, serial number, firmware version, Erase count, health, etc. of the device, so as to monitor and find the device early potential problems. This document provides a way to use the MMC test tools called mmc-utils that get SMART block to enable SMART command via the native MicroSD port on Raspberry Pi.

Hardware requirements

  • Raspberry Pi 3 Model B+ or later model
  • Raspberry Pi native MicroSD slot
  • Transcend Micro SD 430T / 450I

Install Raspberry Pi OS

  1. Download and install Raspberry Pi OS Imager(64-bit or 32-bit) to the tartget Micro SD with an SD card reader at https://www.raspberrypi.com/software

  2. Insert the Micro SD to Raspberry Pi native MicroSD slot.

Usage

  • The mmc-utils package and modify it to support SMART DUMP function. Please download the source code and modify it step by step.
  1. Download the code by following command with terminal.
$ git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/cjb/mmc-utils-old
  1. Update the 4 files in mmc-utils folder to the corresponding files.

  2. Use the Make command to compile the updated source code.

$ make
  1. After build success, check the availability of the mmc tool by -h
$ sudo ./mmc –h
  1. Get SMART buffer by following command.
$ sudo ./mmc smtbuffer /dev/mmcblk0
  1. Get SMART information by following command.
$ sudo ./mmc smart /dev/mmcblk0
  1. Get Card life by following command.
$ sudo ./mmc health /dev/mmcblk0

Command Execution

  1. To dump SMART raw data

    Buffer

  2. To show SMART info

    SMART

  3. To show card life(Heath)

    Heath

About

How to: Monitor SD card health and status using Raspberry Pi

License:GNU General Public License v3.0


Languages

Language:C 100.0%