LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2012, 10:07 AM   #1
vipulmahajan
LQ Newbie
 
Registered: Feb 2012
Location: New Delhi
Distribution: Ubuntu 10.04
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 03-19-2012, 10:50 AM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,539

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
I find using 'fdisk -l' is good for this.
On your distribution I guess that would be 'sudo fdisk -l'.
 
Old 03-19-2012, 12:22 PM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Try this:

Code:
# cat /proc/bus/usb/device
 
1 members found this post helpful.
Old 03-20-2012, 12:46 AM   #4
vipulmahajan
LQ Newbie
 
Registered: Feb 2012
Location: New Delhi
Distribution: Ubuntu 10.04
Posts: 5

Original Poster
Rep: Reputation: Disabled
Not found

Quote:
Originally Posted by Satyaveer Arya View Post
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.
 
Old 03-20-2012, 01:03 AM   #5
vipulmahajan
LQ Newbie
 
Registered: Feb 2012
Location: New Delhi
Distribution: Ubuntu 10.04
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
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.
 
Old 03-20-2012, 01:29 AM   #6
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,539

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
Does 'lsusb' give the information you want?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify and explain the major number, minor number, and revision number in Linux... turbomen Linux - Newbie 1 11-16-2010 02:48 AM
How to identify device descriptor for usb ntfs ext hard drive? bbneo Linux - Desktop 8 12-15-2009 10:10 AM
identify usb drive timl Red Hat 1 08-07-2009 03:03 AM
USB to serail port adaptor COM port number areftaidi Linux - Software 2 09-25-2007 01:05 AM
udevinfo - how do I uniquely identify the port a usb is on jjamesis Fedora 4 08-07-2007 08:31 AM


All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration