Often the quickest is just to cat /proc/scsi/scsi
, which will have enough to show you which is which:
$ cat /proc/scsi/scsi
Attached devices:
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: ST95005620AS Rev: SD23
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: 2.0 Model: USB Flash Drive Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
So, in my case, the first (which would be sda) is a Seagate ST95005620AS, and the second (sdb) is a USB Flash Drive.
To get more detailed and specific info, look in /sys/block/sda
and /sys/block/sdb
, and also /sys/class/scsi_disk
.
/sys/class/scsi_disk
in particular contains symlinks into the PCI address tree which will reveal USB vs SATA hosts:
$ ls -l /sys/class/scsi_disk
total 0
lrwxrwxrwx 1 root root 0 2012-02-28 23:50 2:0:0:0 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0
lrwxrwxrwx 1 root root 0 2012-02-28 23:50 4:0:0:0 -> ../../devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/host4/target4:0:0/4:0:0:0/scsi_disk/4:0:0:0
$ cat /sys/block/sd[ab]/device/model
ST95005620AS
USB Flash Drive
For more info, try also, find /sys -name 'scsi*'
and find /sys/block/sd[a-z]/
.