Home > Workload Solutions > Oracle > White Papers > Oracle ASM on ScaleIO Best Practices > Shell script for UDEV rules
The following is a korn shell script for generating the UDEV rules to present ScaleIO devices to ASM.
The output of this file should be added to the UDEV rules directory located at /etc/udev/rules.d
#!/bin/sh
# generate UDEV rules for ScaleIO devices suitable for ASM
sd_list=$(ls -1 /dev/scini*? )
let i=0
for sd in ${sd_list}
do
let i=i+1
myscid=`/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device ${sd}`
printf "KERNEL==\"scini*\", SUBSYSTEM==\"block\", PROGRAM=\"/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%%k\", RESULT==\"%s\", SYMLINK+=\"oracleasm/disk%02d\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"\n" ${myscid} $i
done
The output of this script should look something similar to this:
KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="23719f5a70163008-fa12df0500000012", SYMLINK+="oracleasm/disk37", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="23719f5a70163008-fa12df0400000011", SYMLINK+="oracleasm/disk38", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="23719f5a70163008-fa12df0300000010", SYMLINK+="oracleasm/disk39", OWNER="grid", GROUP="asmadmin", MODE="0660"