LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   find USB in dev (https://www.linuxquestions.org/questions/linux-newbie-8/find-usb-in-dev-4175573161/)

kb2tfa 02-24-2016 09:05 PM

find USB in dev
 
When I plug in a USB, is there an easy way to identify it in the dev directory? I want to play with fdisk and I don't want to damage something.

sgosnell 02-24-2016 09:56 PM

In a terminal, use lsblk. That's the quickest way. You can also use fdisk -l or blkid as root, for more detailed information.

tomwest 02-24-2016 10:06 PM

Code:

lsblk --f
should make things pretty clear as to which device name the usb takes. It will give the label of the usb device as well if there is one, which there usually is, which may help to differentiate the usb device decisively.

kb2tfa 02-25-2016 02:21 AM

that worked great thank you

jpollard 02-26-2016 07:50 AM

Quote:

Originally Posted by kb2tfa (Post 5505735)
When I plug in a USB, is there an easy way to identify it in the dev directory? I want to play with fdisk and I don't want to damage something.

Easiest is to look in /dev/disk/by-id. USB devices show up as /dev/disk/by-id/usb-xxxxxxxxx.

The file name is composed of the vendor/model/serial number of the device plugged in, and the file itself
is a symbolic link to the /dev/sd<whatever> that got assigned when it was plugged in.

kb2tfa 02-26-2016 03:47 PM

Thank you


All times are GMT -5. The time now is 04:31 PM.