I have following problem with my Linux board: My USB media device every time mounted as different device in /dev/ folder:
First time I attach the USB, it appears as
/dev/sdb1
Then, I remove usb and plug it in again and it gets different name:
/dev/sdc1
And so on and so forth.
I want it to have constant name always, so I wrote following udev rule:
SUBSYSTEM=="block",ENV{ID_SERIAL}==" serial id ",NAME="myusbmedia"
This rule doesn't work. I could have symbolic name with following rule:
SUBSYSTEM=="block",ENV{ID_SERIAL}==" serial id ",SYMLINK="myusbmedia"
This rule works, but it doesn't solve the problem, because usb still gets /dev/sd[b,c,d, ...] names...
Does anyone have an idea how to make USB appear in /dev/ under the same device node with the same name?
When you connect your device, i assume you use mount in order to approach its files. You should unmount the drive (using the umount command) before you disconnect it, and then it should stay as the same device at the /dev folder.
For example: