Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Nope mate, trying to write a small bash to execute an app. when USB device ID is present,if not present then not running that app which resides inside that flash.

In server mode , USB flash aint mounted when inserted, and cannot look in /media/ for a specific label like "1Gb_special" because is not mounted.

If knowing somehow that lsusb | grep "ID 0951:1624" is linked to /dev/sdg i can do a pretty job indeed by mounting that device in a folder that i can work with.
Otherwise i can do it by mounting all sdX unmounted devices one by one and scan for a file inside but it is ugly.

Want to be more like an HASP key, that's why i need to detect the /dev/sdX name for a specific flash device ID
Same bash will be on more than 1 server , and for one is /dev/sdb other can be /dev/sdg depending by how many drives are present there

Hope that my english is readable !

I did a mistake in my question , saying mount point instead of /dev/sdX name

If you use udev you can easily create a link to device with your own name (for example "/dev/id0951-1624") when usb drive is connected. And then mount with that name. You can also use "--no-canonicalize" option for mount to store path to devices as entered.

As frankbell write, the UUID mechanism was created, it is unique. Did you checked "/dev/disk/by-uuid"? These device links (by-id, by-label, etc.) are created when device is connected, not when mounted.

I simply do not agree with messing up udevadm , which indeed is the mechanism preventing things shuffle up in linux.
However , I did sort this up by looping as root at start up
and greping there for USB serial number that i want, which point afterwards to it's dev node.
fdisk -l | grep -o 0xc7bd6c97
fdisk -l | sed -e '1,/0xc7bd6c97/d' | grep -m1 "/dev" | sed 's/ .*//g'
in this way I can get a lock on unique serial number and not messing up udev on multiple servers