Micro SD Card Information in PiOS BASH
With many devices and cards this utility eases microSD card identification and maintenance, as the microSD card may be difficult to access. The utility also provides an estimate of the cards age from the manufacturing date to facilitate management based on age if desired.
sdinfo identifies 35 microSD card manufacturers and 24 re-brand labels. The key advantage of 'sdinfo' being a BASH script, is Internet acess, Python, other languages or libraries are not required. If preferred, the script can be copy / pasted avoiding install of GIT (though GIT possibly a better option for version management). Developed on PiOS, the script may operate on other systems. However, has not been verified.
NOTE
- Using the scripts -c option you can check cards from other systems.
- Check out the -a (additional) option for re-branded cards.
- If you have a card not listed. Use the scripts -a option, copy the CID text and place with a photo of the card in an issue headed 'Card ID Proposal' to propose for addition to the 'aka' list.
Debian - Raspberry PI PiOS
If you don't have GIT installed, install with:
sudo apt install git
Clone the repository into a newly created directory on a Raspberry Pi (Debian)
e.g.
cd ~
sudo git clone https://github.com/OneOfTheInfiniteMonkeys/sdinfo.git
Note - Installation of GIT is not a requirement. The files can be copy/pasted if preferred, though it's probable version control might be more challenging.
Following installation using the steps detailed in the Installation section, a folder will have been created in your home directory which contains the sdinfo BASH script.
To run sdinfo script enter the following commands:
cd ~/sdinfo
Run the script :
bash sdinfo.sh
The script may take some time to run as it searches, using find, for the microSD CID file.
To test the script with an SD Card CID (e.g. from another system, list etc.)
cd ~/sdinfo
bash sdinfo.sh -c 1b534d454332515430615763c7013633
The Git Pull command will download the latest version of the repository, immediately updating the local repository.
cd ~/sdinfo
run git
sudo git pull
Using the -cv option and an available internet connection allows the running version variant to be checked against the release version on GitHub (Git is not required for this operation).
Example usage:
cd ~/sdinfo
bash sdinfo.sh -cv
Output example
SDInfo version : 00.60
Latest Release : 00.6
sdinfo supports the following command line parameters :
-a, --additional | Output additional information |
-m, --minimal | Only minimal output from the script |
-t, --table | Switch off table output (typically use with -m) |
-c, --cid | Provide a CID string to be decoded |
-cv, --checkversion | Display local code version and GitHub version |
-s, --sourcepath | Provide a path to the CID (faster if you know the location or have alternate locations) |
-h, --help, -? | Displays this help and exits |
-v, --version | Displays version information for sdinfo and exits |
< Application Name > < Command > < Revision > ( < Date {yyyy-mm-dd} {hh:mm} > ) |
A typical output from sdinfo is shown below for a Raspberry Pi SD card:
___________________
| |
| | ==|
| | ==|
| | SDInfo ==|
| | 2021-12-24 ==|
| | ==|
| | __ ____|
|________/ |__/
MID : Samsung
OID : SM
PNM : EC2QT
PRV : 30
PSN : 1633117127
MDT : 2019/1/1
AID : 1092
A concise output can be obtained using the -m and -t options together:
cd ~/sdinfo
Run the script :
bash sdinfo.sh -m -t
MID : Samsung OID : SM PNM : EC2QT PRV : 30 PSN : 1633117127 MDT : 2019/1/1 AID : 1092
Consisting of the following information :
MID | Manufacturer Identifier |
OID | OEM Identifier |
PNM | Part number |
PRV | Part version |
PSN | Part serial number |
MDT | Manufactured date yyyy/mm/01 |
AID | Age in days |
Age in days is calculated from the manufactured date and the systems current date. It assumes first of the month as the CID has no day number, assuming a start of year 2000 (2 characters), and a month number (1 character).
To see card re-branding use the -a option:
cd ~/sdinfo
Run the script :
bash sdinfo.sh -a
This code decodes the presented microSD card CID data and does not rely on your OS to determine the information presented. Thus you may see differences between information presented by the OS and by this script (Caveat emptor).
Trademarks are owned by their respective holders.
No affiliation or association is implied or should be inferred with any organisation.
Information is provided for Indication Only.