How to find the device name of a USB drive on Linux

Question: I need to know the device name (e.g., /dev/sdb) assigned to my USB flash drive after I plug the drive into my Linux system. Is there an easy way to identify the device name of a USB drive on Linux?

To find out the device name assigned to a USB drive or USB stick, you can use lsblk command, which shows information about all available block devices.

The lsblk command gathers information about existing block devices from sysfs filesystem, and show them in a tree-like format. This command is useful to find out how different block devices (and partitions within each device) are mounted on Linux.

All you have to do is to run lsblk from the command line.

$ lsblk

A USB drive is typically mounted under /media/XXXXX. Thus, look for "/media" in the mountpoint. The corresponding device name appears in the left most column. In this case, a USB drive is mapped to /dev/sdd. There are three partitions created in it (/dev/sdd1, /dev/sdd2, /dev/sdd5).

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

One thought on “How to find the device name of a USB drive on Linux

  1. I think lsblk can run only with it's containing rpm is installed I tried I cannot run it through my linux machine --- Thanks
    fdisk probably be a better option...........!

Leave a comment

Your email address will not be published. Required fields are marked *

Current ye@r *