4
1
is it possible to use udev rules to excluce a single device from the rule?
for instance if I have 5 harddisk plugged in and I want to create custom names for all harddisk except for a single one? is it Possible?
Also, kernel names disks after sdz are named with 2 characters. sdaa,sdab, sdqr etc. I have a problem with it since I dont want to include the partition in sda1, sdb2 etc. can I wildcard all characters but not all numbers?
example:
KERNEL=="sd??", NAME="test/Disk%n", ATTRS{ID_SERIAL_SHORT}!="xxxx"
Thank you very much! It triggers, but only on the first disk it finds. so I only have a single symlink in /dev/test Also is it possible to use numbering as the last digit? so the first device it finds is Disk0 then Disk1 etc? – John Smith – 2014-03-23T14:10:35.007
@prgmjunkie: Try manually running it on other devices using
udevadm test
orudevadm trigger
. – user1686 – 2014-03-23T14:11:37.793it trigger but the %n operator in the symlink declaration seems to not work correctly the device symlink is always called Disk with nothing appended. – John Smith – 2014-03-23T14:15:52.213
If I use %k instead of %n it works. – John Smith – 2014-03-23T14:20:16.510
It could be that udev just doesn't know how to assign numbers to sd* devices... (Personally I think %n is quite useless anyway, as device order is unstable. Better use UUIDs like in /dev/disk/by-uuid/…) – user1686 – 2014-03-23T14:32:09.643