UDEV SCSI Rules Configuration for ASM

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 ~]#

UDEV_1

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.

UDEV_2

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 ~]#

UDEV_5

Make it on Node 2 as well, same configuration:

UDEV_6

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:

UDEV_4

UDEV_7

We are good.

Let me know if any questions.

Reference: https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s