My SD card is automounted fine as /dev/sdb:

sr0     11:0    1  1024M  0 rom  
sda      8:0    0    80G  0 disk 
├─sda1   8:1    0    78G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0     2G  0 part [SWAP]
sr1     11:1    1  1024M  0 rom  
sdb      8:16   1   7.4G  0 disk 
├─sdb1   8:17   1    56M  0 part /media/boot
└─sdb2   8:18   1   2.7G  0 part /media/af599925-1134-4b6e-8883-fb6a99cd58f1

In dmesg:

[ 1206.970596] sd 3:0:0:0: [sdb] Attached SCSI removable disk

I would like to know a few attributes - serial #, manufacturer id, etc. that I thought would be in /sys/class. I have searched /sys/class/scsi_disk/3:0:0:0/ without any luck.

Where would I find this information? I am using the latest version of Arch-linux.


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.


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.

| improve this answer | |
  • 1
    Ok, this gives all that information. But - I though /sys/class was supposed to be a way do navigate /dev without all the device-specific (set by udev) hieracrchy? Am I wrong about that? – Charles Pehlivanian Jan 5 '14 at 21:27
  • @CharlesPehlianian See the Edit to my answer – MariusMatutiae Jan 5 '14 at 22:13
  • Ok - I was under the wrong impression then. Thanks! – Charles Pehlivanian Jan 7 '14 at 1:11
  • @CharlesPehlivanian: You can get to that detailed information via /sys/class; see @Robert's answer. It may just not be the best way. However, on some systems (e.g. Android), udevadm isn't available. – LarsH Oct 23 '15 at 17:51

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"
$ find /sys -name "cid"
$ find /sys -name "csd"

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

| improve this answer | |
  • Great. In my case, with this answer, I could find most SD and MMC device attributes. cid, csd, scr, date, fwrev, hwrev, manfid, name, oemid, serial... – agfe2 Aug 28 '18 at 8:28

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
| improve this answer | |
  • 1
    Thanks, this gives me what I was asking for, but I'd like to understand /sys/class a little better so I'd like an answer based on that. – Charles Pehlivanian Jan 4 '14 at 3:16

Looking at /sys/class/scsi_disk I discovered that (on my system) that these are symkinks to actual disks. Indeed when I do an "ls -la /sys/class/scsi_disk/ it shows a symlink for 8:0:0:0 to ../../devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb3/3-2/3-2.3/3-2.3:1.0/host8/target8:0:0/8:0:0:0/scsi_disk/8:0:0:0

If I then shift in to :/sys/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb3/3-2/3-2.3/3-2.3:1.0/host8/target8:0:0/8:0:0:0 It has a number of files which I suspect are of interest to you including -

model = model of the drive
vendor = the drive vendor

Also of interest might be parsing /proc/scsi -

/proc/scsi/scsi          contains the description of each device and associated host
                         as scsi8 which lets me derive the "8" in the next bit.

/proc/scsi/usb-storage/8 contains the Vendor, Product and serial number
| improve this answer | |
  • When do ls on your /sys/devices/... directory, as you indicate, I get a symlink back to /sys/class/scsi_disk/8:0:0:0, which is where my question began. I don't see any files for model, vendor, only FUA, device, allow_restart, etc. I have searched these with no luck. – Charles Pehlivanian Jan 5 '14 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.