Home > Workload Solutions > Oracle > White Papers > Oracle ASM on ScaleIO Best Practices > UDEV rules
UDEV functionality was introduced into Linux with kernel 2.5, and allows devices to be given consistent names and permissions across clusters.
The UDEV rules use the SCSI ID of a device to assign an OS name and permission. Since the SCSI ID of a device does not change, and is consistent across cluster nodes, this allows ASM to see a consistent device name across clusters and reboots.
In bare metal environments, the ScaleIO drv_cfg program can be used to inspect the SCSI ID of new ScaleIO devices presented to the Linux host:
[root@sdc01 ~]# /opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/scinia
23719f5a70163008-fa12defe0000000b
The SCSI identifier of the new disk is 23719f5a70163008-fa12defe0000000b.
The DBA can verify which ScaleIO device this is by taking the last 16 bytes of the SCSI ID and using the following command:
[root@sio01-mgmt ~]# scli --query_all_volumes | grep fa12defe0000000b
Volume ID: fa12defe0000000b Name: DBASM9 Size: 1000.0 GB (1024000 MB) Mapped to 4 SDC Thin-provisioned
The new device is volume DBASM9 in ScaleIO. It is 1 TB in size and is thin provisioned.
We can now use the SCSI ID with UDEV rules to set the permission of the new device as well as an alias.
Then the DBA needs to create (or edit) a file in the /etc/udev/rules.d directory. In this case the file is named 99-oracleasm.rules.
[root@sio01-mgmt ~]# vi /etc/udev/rules.d/99-oracleasm.rules
Add the following – this should all be one line:
KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="23719f5a70163008-fa12defe0000000b", SYMLINK+="oracleasm/dbcrs01", OWNER="grid", GROUP="asmadmin", MODE="0660"
In the above example Linux creates an alias called /dev/oracleasm/dbcrs01 when it finds the SCSI ID 23719f5a70163008-fa12defe0000000b. The alias will be owned by the grid:asmadmin and have permissions of 660.
Once the UDEV rules file is created, restart UDEV. The example below is from Red Hat Enterprise Linux 7.
[root@sio01-mgmt ~]# /sbin/udevadm control --reload-rules
[root@sio01-mgmt ~]# /sbin/udevadm trigger
Note that older versions of Linux use different syntax. Check the documentation for your version of Linux to ensure you are using the correct syntax.
Check that the alias exists:
[root@sio01-mgmt ~]# ls -al /dev/oracleasm/*
lrwxrwxrwx 1 root root 10 Aug 3 17:31 /dev/oracleasm/dbcrs01 -> ../scinia
The DBA can now use asmca with a discovery string of /dev/oracleasm/* to locate the devices and create ASM diskgroups from them.