How to set udev rules for ASM on multipath disks for CentOS / RHEL 7?

Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.

 

The post describes how to set udev rules for ASM disks in a dm multipath environment. The multipath disk used as an example is /dev/mapper/multipathx. We will be setting the udev rule for the multipath disks to have ownership of oracle:grid.

 

1. Find the UUID of the disk

 

Determine the UUID of the multipath disk meant for Oracle ASM use.

# udevadm info --query=all --name=/dev/mapper/mpathx | grep -i DM_UUID

Note: In the above command is /dev/mapper/mpathx is just an example multipath disk, in you case it may be different.

 

2. Create udev Rules

 

Create a udev rule file /etc/udev/rules.d/96-asm.rules. Add below udev rule for a multipath device using it’s DM_UUID value under the file /etc/udev/rules.d/96-asm.rules

# vi /etc/udev/rules.d/96-asm.rules
ACTION=="add|change", ENV{DM_UUID}=="mpath-[DM_UUID]", SYMLINK+="udev-asmdisk1", GROUP="oinstall", OWNER="grid", MODE="0660"

 

Replace [DM_UUID] with the one you got it from the step 1 command output. The user and group used here are the owner user/groups of the grid software i.e. oracle and grid respectively.

 

3. Reload udev Rules

 

To add or load Udev rules, use the below commands.

# udevadm control --reload-rules
# udevadm trigger --type=devices --action=change

 

4. Verify the disk permissions.

 

Check file permissions on the disk paths.

# ls -l /dev/udev-asmdisk1
# ls -l /dev/mapper/mpathx
# ls -l /dev/dm-x

 

Note: Here dm-x can be anything like dm-0 or dm-1 or dm-2, so it’s based on your environment.

 

5. Verify the disks with sg_inq command

 

Login as a grid user and check disk information using the sg_inq command. You should be able to see disk information using the below sg_inq commands.

# su - grid
$ sg_inq /dev/mapper/mpathx
$ sg_inq /dev/dm-x

 

Once you have done all the above steps and verified the disk details, you can proceed further with the RAC setup.

Was this answer helpful? 0 Users Found This Useful (0 Votes)