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

Last updated on August 15, 2020 by Dan Nanni

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).

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean