how to locate a flash drive / identify /dev device
I want a way that a bash script can identify a USB drive which I plugin for the purpose of mounting that drive for me. The drive in this case is encrypted, though I'm not sure it makes a big difference here (using cryptsetup with luks).
If I do "lsusb" I can see the drive I want:
Bus 002 Device 004: ID 090c:1000 Feiya Technology Corp. Memory Bar
And if I do "dmesg" I can sort of see what is happening under the usb-storage entries. In there it eventually identifies a device "sdc1" in this case. I could start doing some parsing, or awking, of this file to determine what I want, but I was hoping there was an easier way.
NOTE: I realize newer versions of Ubuntu can automount encrypted drives, but that still won't be quite what I want. I need to give the mount point a specific name so that I can automatically do a sync to that device, and so that other scripts can always look in one location.
Is there anyway to figure out what device the drive is easily? Or is there any way to force the mount path for a device anytime it is automounted*?
(*Though in my case automounting of encrypted drives doesn't appear to be working)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- edA-qa
- Solved:
- Last query:
- Last reply: