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.

How do you find the device (e.g. /dev/*) for a mounted USB drive in Linux (Ubuntu 10.04)? I'm trying to format a Cruzer USB flash drive, and when I plug it in, the icon for the mounted filesystem appears on my desktop. However, when I open GParted, it doesn't list the filesystem as an option to partition.

The recommendations I've found through Google include monitoring tail -f /var/log/messages, which they claim should list the device name when the drive is mounted, but this never happens for me. I've also read that the USB drive would usually be linked to /dev/sdb, but this appears as a broken link on my filesystem. How else would I find the device?

share|improve this question
add comment

4 Answers 4

up vote 7 down vote accepted

You can look at mount, dmesg, /proc/partitions... There are many ways to find it.

share|improve this answer
    
Ya, dmesg will tell you the device when you plug it in... unlike the others, it'll tell you the device even before it is mounted (which it sounds like it isn't automatically being mounted to an actual directory for you). Look at dmesg right after plugging in your USB stick. –  Dan Jun 23 '10 at 15:03
    
Thanks, I found that by running "mount" I get a list of all mounted devices and their file locations. –  Cerin Jun 23 '10 at 17:54
1  
+1 for mount. The clonezilla docs say to use dmesg to find the name of my usb drive, but that generates several pages of information. mount was a lot shorter and simpler. –  John C Jun 8 '12 at 13:05
add comment

df gives information regarding mounted disks and their respective device locations and FS paths. You can also run cat /etc/fstab file to see if the USB drive is listed.

share|improve this answer
    
This really is the best answer. –  dotancohen Jun 30 '12 at 9:02
add comment

Removable media like your flash drive are usually mounted under ~/.gvfs gvfs-fuse. You should be able to format the drive in Nautilus.

If you want to use command-line tools, you'll probably have to unmount it in Nautilus and possible remount it from the command line.

share|improve this answer
add comment

Here is a little Perl script for Linux that lists the USB tree and checks whether and of the sd* devices is associated to an entry:

May be of some use, and also good for experimentation.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.