plugging in a USB Modem (Huawei E220) OpenSuse-42.3 recognizes 2 devces: /dev/ttyUSB0 /dev/ttyUSB1
Sometimes however the systemn assigns /dev/ttyUSB0 and /dev/ttyUSB2.
To solve issues in scripts I want to assign fixed sysmlinks for this devices:
The first hint should come from you. You choose for OTHER VERSION. That implies a not supported version. And that makes it the more important that you tell us which version you are using.
You should show us the device attributes reported by ‘udevadm info…’. Are the selected attributes valid? From this writing_udev_rules reference it is important to remember…
you cannot mix-and-match attributes from multiple parent devices
Also mentioned in the ‘udevadm info…’ output…
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
Quite possibly. Unfortunately the OP never provided the ‘udevadm’ output requested to show the complete attribute info as requested. Sometimes this kind of thing is part of the learning.
The file name starts with a character. Thus the rule is applied after system rules starting with a digit. The action is indeed performed for /dev/sdd only and it survived a boot.
@karl: I’m not sure why you’re directing your replies at me. I already showed the OP what was required and why you’d choose the KERNEL attribute I really don’t know. Use attributes that are truly specific to the device, and it should be generally known that the kernel device assignment numbering could change. For example, your rule didn’t require anything more than…
I don’t mind helping Karl, but you were not the OP in this thread, and this can just lead to a confused thread. I didn’t even know what you’re trying to achieve (I though you were just attempting to help the OP). In any case, it is now apparent that you are trying to identify a particular partition on a Garmin? device. You could have match against unique environment variables set (when rules in 60-persistent-storage.rules are triggered). You just need to be careful with the file naming, as the rules are processed in lexicographical order, so a custom rule needs to be numbered with a larger number eg 75-custom.rules
To view environment variables pertaining to a given device or partition…
udevadm info /dev/sdd
Output preceded by and ‘E:’ refers to an environment variable that has been set. For example
~> udevadm info /dev/sde2|grep UUID
E: ID_FS_UUID=c379b54f-f310-4aba-a13f-390c421d720c
E: ID_FS_UUID_ENC=c379b54f-f310-4aba-a13f-390c421d720c
E: ID_PART_ENTRY_UUID=f5ad9b4b-2884-4d15-97c6-9e3b7dd3bc86
E: ID_PART_TABLE_UUID=5ed870fd-a9a5-415c-aec2-16444b5025f5
~> udevadm info /dev/sdb|grep UUID
E: ID_FS_UUID=7EF27FFB9B7835CC
Then you can match against UUID eg for the /dev/sdb example above, ENV{ID_FS_UUID}==“7EF27FFB9B7835CC” could be used.