Detect if a drive is USB?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I'm updating a script to work with EL6 (previously worked on EL5) and am 
stumped, google fu is failing me. Part of the script is to detect USB 
drives and mount them. Previously, It worked something like

isUsbDevice() {
if [ -f /sys/block/$1/usb ] ; then
  // do stuff
  fi;
}

but I don't find the "usb" file/directory anywhere to be found any more 
on el6. I've tried the output of lsusb and lsusb -v but in no case have 
I been able to find anything there matching anything in /sys/block that 
matching anything in lsusb's output.

Given an available drive (EG: /dev/sdk) how can I reliably tell it's 
interface type? (USB/SATA/PATA/SCSI ?)


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux