How to Find the Device Associated with a Mounted USB Drive in Linux

24,201

Solution 1

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

Solution 2

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:
24,201

Related videos on Youtube

Cerin
Author by

Cerin

Updated on September 17, 2022

Comments

  • Cerin
    Cerin over 1 year

    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?

  • Jarvin
    Jarvin almost 14 years
    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.
  • Cerin
    Cerin almost 14 years
    Thanks, I found that by running "mount" I get a list of all mounted devices and their file locations.
  • John C
    John C about 12 years
    +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.
  • dotancohen
    dotancohen almost 12 years
    This really is the best answer.