LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to identify port number of USB drive? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-identify-port-number-of-usb-drive-935300/)

vipulmahajan 03-19-2012 10:07 AM

How to identify port number of USB drive?
 
Hello,

We am having a tough time determining on which hub port number "sda", "sdb", etc are connected. Dmesg could be one manual method but it is not useful to us. We want a script or command based solution for the same.

allend 03-19-2012 10:50 AM

I find using 'fdisk -l' is good for this.
On your distribution I guess that would be 'sudo fdisk -l'.

Satyaveer Arya 03-19-2012 12:22 PM

Try this:

Code:

# cat /proc/bus/usb/device

vipulmahajan 03-20-2012 12:46 AM

Not found
 
Quote:

Originally Posted by Satyaveer Arya (Post 4630729)
Try this:

Code:

# cat /proc/bus/usb/device

On my machine "/proc/bus/usb" doesn't exists. Actually it's an embedded system with Linux OS.

vipulmahajan 03-20-2012 01:03 AM

Quote:

Originally Posted by allend (Post 4630649)
I find using 'fdisk -l' is good for this.
On your distribution I guess that would be 'sudo fdisk -l'.

Sorry but fdisk -l gives information of the USB drives attached on the system. It shows /dev/sda1, /dev/sdb1, etc. It doesn't specify port number of USB hub. I want to know /dev/sda1 or /dev/sdb1 is attached on which port of USB hub.

allend 03-20-2012 01:29 AM

Does 'lsusb' give the information you want?


All times are GMT -5. The time now is 09:18 PM.