Finding attributes of mounted SD card

The proper way to do this, in Arch Linux but by now in all systems which use udev, is the command:

  sudo udevadm info -a -n /dev/sdb

in your case.

Edit:

A reply to your comment: I believe you are mistaken. The class is a view of a device which is independent of the low-level implementation details. The classic example is a disk. You may of course have a SCSI disk or an ATA disk, but, at the class level, they are the same thing. The idea of the class is to allow users to build userspace code which is independent of how they are connected to the network, how they work, which device driver they use, and so on. In a way, the class is the highest level of abstraction available as a model for devices.

Thus you are wrong in searching for such details as your SD card vendor (which, by the way, should be in /sys/class/mmc_host, if anything at all) within /sys/class.


The exact layout is driver dependent, but try searching /sys for some MMC (SD) specific keywords. Below is from an 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

Bunnie's blog entry on SD card shenanigans is a good place to start back-tracking what those ID numbers mean.


I don't use Arch Linux, but "usb-devices" lists the details of all USB devices the system knows about, and included the following for a USB key I plugged in:

T:  Bus=03 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0781 ProdID=5567 Rev=01.26
S:  Manufacturer=SanDisk
S:  Product=Cruzer Blade
S:  SerialNumber=4C532000060624123092
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage