Preparing to use udev rules on VMware Fusion
Before you can use udev rules with your new VMware Hard Drives you need to update the Virtual Machines .vmx file and set the following.
disk.EnableUUID = “TRUE”
Without this setting the ‘/usr/lib/udev/scsci_id’ command will no values.
As with all configuration files it’s best practice to create a backup before editing, however this is especially true for the VMware Fusion .vmx file as any mistake can result in a Virtual Machine which will no longer boot.
Shutdown your Virtual Machine before you attempt any edits of the .vmx file.
Creating the udev rules
Once your edit is complete you can reboot your VM and confirm is working ok with ‘usr/lib/udev/scsci_id -g -u -d /dev/’ e.g.
[root@ol72 ~]# /usr/lib/udev/scsi_id –verbose -g -u -d /dev/sdc
36000c298d0c4d6c7ace0c7b990069f48
[root@ol72 ~]# /usr/lib/udev/scsi_id –verbose -g -u -d /dev/sdd
36000c290045c8d9e8660057e191ec523
[root@ol72 ~]# /usr/lib/udev/scsi_id –verbose -g -u -d /dev/sde
36000c29b6dc77c32663c5b8354fffd37
[root@ol72 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sde
36000c29b6dc77c32663c5b8354fffd37
Now you know the Disks unique ID’s you can add them to a new udev rule. e.g.
/etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL==”sd?1″, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d /dev/$parent”, RESULT==”36000c298d0c4d6c7ace0c7b990069f48″, SYMLINK+=”dg_prod_oradata1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″
KERNEL==”sd?1″, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d /dev/$parent”, RESULT==”36000c290045c8d9e8660057e191ec523″, SYMLINK+=”dg_prod_oraredo1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″
KERNEL==”sd?1″, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d /dev/$parent”, RESULT==”36000c29b6dc77c32663c5b8354fffd37″, SYMLINK+=”dg_prod_orafra1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″
Unlike RedHat 5 & 6 there is no need to restart the udev service on RedHat 7
Testing the udev rules
You can now test the udev rules using udevadm test e.g.
udevadm test /block/sdb/sdb1
And check the results with ls -l /dev/
[root@ol72 dev]# ls -l /dev/sd*
brw-rw—- 1 root disk 8, 32 Oct 18 11:29 sdc
brw-rw—- 1 grid asmadmin 8, 33 Oct 18 11:49 sdc1
brw-rw—- 1 root disk 8, 48 Oct 18 11:29 sdd
brw-rw—- 1 grid asmadmin 8, 49 Oct 18 11:55 sdd1
brw-rw—- 1 root disk 8, 64 Oct 18 11:29 sde
brw-rw—- 1 grid asmadmin 8, 65 Oct 18 11:55 sde1
[root@ol72 dev]# ls -l /dev/dg*
lrwxrwxrwx 1 root root 4 Oct 18 11:49 /dev/dg_prod_oradata1 -> sdc1
lrwxrwxrwx 1 root root 4 Oct 18 11:55 /dev/dg_prod_orafra1 -> sde1
lrwxrwxrwx 1 root root 4 Oct 18 11:55 /dev/dg_prod_oraredo1 -> sdd1
[twitter-follow screen_name=’RonEkins’ show_count=’yes’]