ittechlab
asked on
udev rules
I am trying to write a udev rules for iSCSI storage. I wrote the following rules in node1 and I am accessing iSCSI storage from node4. What I don't understand is why I am getting all tty's are also applied to this rules.
[root@node1 rules.d]# vim 60-persistent-storage.rule s
ACTION=="add",
KERNEL=="/dev/sd*",
SUBSYSTEM=="block",
SUBSYSTEMS=="scsi",
ATTRS{model}=="VIRTUAL-DIS K",
SYMLINK+="SAN%n",
MODE="0644"
[root@node1 ~]# ls -l /dev/SAN
SAN SAN11 SAN15 SAN19 SAN22 SAN26 SAN3 SAN33 SAN37 SAN40 SAN44 SAN48 SAN51 SAN55 SAN59 SAN62 SAN9
SAN0 SAN12 SAN16 SAN2 SAN23 SAN27 SAN30 SAN34 SAN38 SAN41 SAN45 SAN49 SAN52 SAN56 SAN6 SAN63
SAN1 SAN13 SAN17 SAN20 SAN24 SAN28 SAN31 SAN35 SAN39 SAN42 SAN46 SAN5 SAN53 SAN57 SAN60 SAN7
SAN10 SAN14 SAN18 SAN21 SAN25 SAN29 SAN32 SAN36 SAN4 SAN43 SAN47 SAN50 SAN54 SAN58 SAN61 SAN8
[root@node1 ~]# multipath -ll
SAN (1IET 00010001) dm-2 ,
size=4.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| `- #:#:#:# - #:# active faulty running
`-+- policy='round-robin 0' prio=0 status=enabled
`- #:#:#:# - #:# active faulty running
I am only getting /dev/sdb and /dev/sdc and I am using multipath to access these disks.
I am not sure why rules applied to other devices as well according to above udev rules definition.
[root@node1 rules.d]# vim 60-persistent-storage.rule
ACTION=="add",
KERNEL=="/dev/sd*",
SUBSYSTEM=="block",
SUBSYSTEMS=="scsi",
ATTRS{model}=="VIRTUAL-DIS
SYMLINK+="SAN%n",
MODE="0644"
[root@node1 ~]# ls -l /dev/SAN
SAN SAN11 SAN15 SAN19 SAN22 SAN26 SAN3 SAN33 SAN37 SAN40 SAN44 SAN48 SAN51 SAN55 SAN59 SAN62 SAN9
SAN0 SAN12 SAN16 SAN2 SAN23 SAN27 SAN30 SAN34 SAN38 SAN41 SAN45 SAN49 SAN52 SAN56 SAN6 SAN63
SAN1 SAN13 SAN17 SAN20 SAN24 SAN28 SAN31 SAN35 SAN39 SAN42 SAN46 SAN5 SAN53 SAN57 SAN60 SAN7
SAN10 SAN14 SAN18 SAN21 SAN25 SAN29 SAN32 SAN36 SAN4 SAN43 SAN47 SAN50 SAN54 SAN58 SAN61 SAN8
[root@node1 ~]# multipath -ll
SAN (1IET 00010001) dm-2 ,
size=4.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| `- #:#:#:# - #:# active faulty running
`-+- policy='round-robin 0' prio=0 status=enabled
`- #:#:#:# - #:# active faulty running
I am only getting /dev/sdb and /dev/sdc and I am using multipath to access these disks.
I am not sure why rules applied to other devices as well according to above udev rules definition.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am not sure but i achieved it by using filters under /etc/multipath.conf
nope,
this needs to be in /etc/udev/rules.d.....
this needs to be in /etc/udev/rules.d.....
ASKER
Let me try this method.
If not on one line then each item is check on it's own.
So the SUBSYSTEM=="block"will fire on it's own, without further action on blockdevices.
so will the assignment rule 'SYMLINK+="SAN%n"', . And that will effectively count all devices wether it is a tty , block or what ever.
Worse all devices will probably end up in mode [cd]rw-r--r--
which might not be what you want either.
This is what you need (all items on one line):
Open in new window