Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have several USB ports on the front of my computer, and when I insert a thumb drive into one of them, it gets mounted temporarily in /media. I can navigate to its mount point directory in /media and treat it like any other directory, but for what I am trying to do, I need the thumb drive's /dev/___ name. How can I obtain this?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

If its mounted to /media, the easiest trick is to just say

df /media/path

it will give you the /dev fs its mounted on


For more details you could do, (saving output to a file)

sudo lshw

and, look for the "/media/path" section in the output.
That will give you the association with more details.

share|improve this answer
    
Thanks, I knew there had to be some kind of command, but my Googlefu wasn't good enough to find it. df works perfectly. –  bill Sep 25 '09 at 4:54
    
I did an inverted lookup :-) recalling I always saw that detail when using df. –  nik Sep 25 '09 at 4:56
    
If it isn't mounted to media, then "fdisk -l | grep sd" will show the essentials, without scrolling off the screen if you have a lot of drives connected. –  Andy Lee Robinson Oct 4 '11 at 17:45
add comment

lsusb will do the trick.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.