Identify the Disks:
We have 3 Disks which we added through openfiler storage to our RAC Nodes, now its the time we have to configure those disk to be used for our ASM Disks.
We will be using UDEV rules to do the task, other way around is to use Oracle ASM Libraries to achieve the same task.
Let us just go ahead and start the configuration for OEL 6, same command may not work for OEL 5 or 7.
So we have 3 disks /dev/sdb, /dev/sdc and /dev/sdd – we have to fidn the SCSI ID and create a rule for them. Below are the commands to get the ID for those disks.
[root@node1 ~]# /sbin/scsi_id -g -u -d /dev/sdb
14f504e46494c45524c67426b48342d316a42652d3174614e
[root@node1 ~]#
[root@node1 ~]# /sbin/scsi_id -g -u -d /dev/sdc
14f504e46494c4552716f585535492d32304a562d56653931
[root@node1 ~]#
[root@node1 ~]# /sbin/scsi_id -g -u -d /dev/sdd
14f504e46494c4552373349364d492d356152512d627a5370
[root@node1 ~]#
Note:
For OEL 5 – /sbin/scsi_id -g -u -s
For OEL 7 – /usr/lib/udev/scsi_id -g -u -d
Location may be changed for scsi_id command, so check it before you run it.
Make SCSI Devices Trusted:
Add the following to the “/etc/scsi_id.config” file to configure SCSI devices as trusted. Create the file if it doesn’t exist.
Create UDEV Rules File:
Create a file – /etc/udev/rules.d/99-oracle-asmdevices.rules if it does not exist already.
[root@node1 ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL==”sd?1″, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -d /dev/$parent”, RESULT==”14f504e46494c45524c67426b48342d316a42652d3174614e”, NAME=”asm-disk1“, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″
KERNEL==”sd?1″, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -d /dev/$parent”, RESULT==”14f504e46494c4552716f585535492d32304a562d56653931″, NAME=”asm-disk2“, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″
KERNEL==”sd?1″, BUS==”scsi”, PROGRAM==”/sbin/scsi_id -g -u -d /dev/$parent”, RESULT==”14f504e46494c4552373349364d492d356152512d627a5370″, NAME=”asm-disk3“, OWNER=”oracle”, GROUP=”dba”, MODE=”0660″
[root@node1 ~]#
Make it on Node 2 as well, same configuration:
Load Updated Block Device Partitions (/sbin/partprobe):
[root@node1 ~]# /sbin/partprobe /dev/sdb1 [root@node1 ~]# /sbin/partprobe /dev/sdc1 [root@node1 ~]# /sbin/partprobe /dev/sdd1
[root@node2 ~]# /sbin/partprobe /dev/sdb1 [root@node2 ~]# /sbin/partprobe /dev/sdc1 [root@node2 ~]# /sbin/partprobe /dev/sdd1
Test Rules (udevtest):
[root@node1 ~]# udevadm test /block/sdb/sdb1 [root@node1 ~]# udevadm test /block/sdc/sdc1 [root@node1 ~]# udevadm test /block/sdd/sdd1 [root@node2 ~]# udevadm test /block/sdb/sdb1 [root@node2 ~]# udevadm test /block/sdc/sdc1 [root@node2 ~]# udevadm test /block/sdd/sdd1
Restart UDEV Service:
[root@node1 ~]# udevadm control --reload-rules
[root@node1 ~]# /sbin/start_udev [root@node2 ~]# udevadm control --reload-rules
[root@node2 ~]# /sbin/start_udev
Check Ownership and Permissions:
We are good.
Let me know if any questions.
Reference: https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux