Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
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.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
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 at 21:27
    
@CharlesPehlianian See the Edit to my answer –  MariusMatutiae Jan 5 at 22:13
    
Ok - I was under the wrong impression then. Thanks! –  Charles Pehlivanian Jan 7 at 1:11

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
share|improve this answer
    
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 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
share|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 at 21:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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