LinuxQuestions.org
Review your favorite Linux distribution.
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 02-26-2010, 05:32 AM   #1
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Ways to find attached (USB) devices


Hi folks,

while checking one of our servers today I found that the USB harddisk wasn't mounted anymore. So let's go ahead and mount it. But damn what was the device name... I found it later with fdisk -l after trying to see it in dmesg and checking lspci.

So heres my question:
How would you find out if and with which devicename a external device is connected to an unkown box (not) of yours?


Just put in any method of ways to find out.

Cheers Zhjim
 
Old 02-26-2010, 06:00 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
lsusb command (maybe with option -v)
/media/.hal-mtab file
udevadm control --log-priority=info command (if you can re-plug) for LOTS of messages in /var/log/message
 
Old 02-26-2010, 07:52 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Thanks for your input catkin but
Quote:
Originally Posted by catkin View Post
lsusb command (maybe with option -v)
does not list the devicename (ala /dev/sdb) even with the -v option. Also I must say that it prints the bus and device. Maybe one can find out which /dev coresponds
Code:
Bus 001 Device 004: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Quote:
Originally Posted by catkin View Post
/media/.hal-mtab file
Hm could not find it on my RedHat 5 machine. But from the look I'd say it would only contain the devicename after it got mounted. Just like /etc/mtab holds only the mounted devices. (In contrast to /etc/fstab)
Quote:
Originally Posted by catkin View Post
udevadm control --log-priority=info command (if you can re-plug) for LOTS of messages in /var/log/message
Could not get it to work. Gone take some time to play with this.

Any other ideas.
 
Old 02-26-2010, 07:56 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
How would you find out if and with which devicename a external device is connected to an unkown box (not) of yours?
You can use
Code:
mount
Or do I miss something here ?
 
Old 02-26-2010, 08:02 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by repo View Post
Or do I miss something here ?
Yup the device is not mounted

Just to sort this. It's not a problem I'm trying to solve its more to find other various ways to see if and what is connected through usb and with what name it can be found inside /dev or similar directories.
 
Old 02-26-2010, 07:45 PM   #6
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
<mistake>

sorry...im not doing too well today...

Last edited by lupusarcanus; 02-26-2010 at 07:46 PM.
 
Old 02-26-2010, 09:37 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by zhjim View Post
It's not a problem I'm trying to solve its more to find other various ways to see if and what is connected through usb and with what name it can be found inside /dev or similar directories.
These might help
Code:
c@CW8:~$ ll -d /dev/disk/*
drwxr-xr-x 2 root root 900 Feb 27 08:02 /dev/disk/by-id
drwxr-xr-x 2 root root 120 Feb 27 08:02 /dev/disk/by-label
drwxr-xr-x 2 root root 220 Feb 27 08:02 /dev/disk/by-name
drwxr-xr-x 2 root root 420 Feb 27 08:01 /dev/disk/by-path
drwxr-xr-x 2 root root 400 Feb 27 08:02 /dev/disk/by-uuid
EDIT:
A sample output with a single USB HDD plugged in having a single partition with a labelled file system:
Code:
c@CW8:~$ ll /dev/disk/*
/dev/disk/by-id:
[snip]
lrwxrwxrwx 1 root root  9 Feb 27 08:27 usb-Hitachi_HTS545050B9A300_2512009121920487-0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Feb 27 08:27 usb-Hitachi_HTS545050B9A300_2512009121920487-0:0-part1 -> ../../sdc1

/dev/disk/by-label:
[snip]
lrwxrwxrwx 1 root root 10 Feb 27 08:27 CDB0 -> ../../sdc1

/dev/disk/by-name:
[snip; only LVM partitions were shown here]

/dev/disk/by-path:
[snip]
lrwxrwxrwx 1 root root  9 Feb 27 08:27 pci-0000:00:13.5-usb-0:5:1.0-scsi-0:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Feb 27 08:27 pci-0000:00:13.5-usb-0:5:1.0-scsi-0:0:0:0-part1 -> ../../sdc1

/dev/disk/by-uuid:
[snip]
lrwxrwxrwx 1 root root 10 Feb 27 08:27 efa8a079-ab80-41c9-b018-85810dd3c45d -> ../../sdc1

Last edited by catkin; 02-26-2010 at 10:06 PM.
 
Old 02-26-2010, 09:42 PM   #8
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Code:
sudo tail -f /var/log/messages
 
Old 03-01-2010, 08:37 AM   #9
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Original Poster
Rep: Reputation: 233Reputation: 233Reputation: 233
@catkin
Thats a nice one and exactly what I was looking for. It nicely prints the coresponding /dev file.

@schneidz
In this case it won't work out cause I can not replug the USB device.

Thanks all for your input as soon as I find some time I'll put this all nicely into some format and put it on my blog inside linuxquestions. Maybe I'll find a nice spot for this inside the tutorial section.

Chers Zhjim
 
  


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
detect process attached to devices linux_newbie79 Linux - Newbie 1 06-22-2009 07:56 AM
Microsoft provides horrible ways to fix devices Electro General 5 11-16-2006 05:49 PM
How th chack teh raid type and attached devices procfs Linux - Hardware 2 08-09-2006 11:44 PM
DHCPD attached devices jspsandhu Linux - Networking 1 06-22-2005 09:26 PM
Listing attached devices ITJedi Linux - Hardware 3 09-25-2003 07:15 PM


All times are GMT -5. The time now is 12:32 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