Skip to content

Instantly share code, notes, and snippets.

@PSJoshi
Last active September 23, 2022 07:55
Show Gist options
  • Save PSJoshi/a1a333b804b488b2caec59896f608e9b to your computer and use it in GitHub Desktop.
Save PSJoshi/a1a333b804b488b2caec59896f608e9b to your computer and use it in GitHub Desktop.
Read SD memory card information

Read SD memory card information

$ sudo udevadm info -a -n /dev/sdb

SD card vendors should be in /sys/class/mmc_host within /sys/class

Try searching /sys for some MMC (SD) specific keywords for ARM-based embedded system

$ find /sys -name "oemid"
/sys/class/mmc_host/mmc0/mmc0:aaaa/oemid
$ find /sys -name "cid"
/sys/class/mmc_host/mmc0/mmc0:aaaa/cid
$ find /sys -name "csd"
/sys/class/mmc_host/mmc0/mmc0:aaaa/csd

Another way:

# lsblk -o name,serial,uuid,partuuid,label,partlabel /dev/sdb
# lsblk -o name,serial,uuid,partuuid,label,partlabel $(blkid --label MY_MICROSD)

Ref: https://superuser.com/questions/696792/finding-attributes-of-mounted-sd-card

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment