oracledba.help works great on your mobile device too!

oracledba.help

UDev Configuration

<- SpecialTopics

Overview

The following covers Oracle Linux 7.x UDev to manage disks for ASM.

How it works is the device pointing to the partition (sd?1) with the matching SCSI ID (1ATA_VBOX_HARDDISK_VBf70afbfd-d82c476f) will be called regardless of the Linux disk letter assigned. It also ensures the device has the correct ownership\permissions for ASM.

The scenario below shows implementing for 3 disks.

UDev is an alternative to Oracle's ASMLib and does not require additional kernel modules or a specific kernel version. UDev also has a smaller footprint on the Linux systems than ASMLib.

Procedure

Add Option to scsi_id.config

echo options=-g>>/etc/scsi_id.config

Get Device ID

 /usr/lib/udev/scsi_id -g -u -d /dev/sdb
 1ATA_VBOX_HARDDISK_VBf70afbfd-d82c476f

Do this for each disk (sdb,sdc,sdd...).

Create 99-oracle-asmdevices.rules

  • In RESULT=="" place Device ID string from above. Make an entry for each disk.
  • Also change\increment the SYMLINK+= name for each disk.

Edit /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=="1ATA_VBOX_HARDDISK_VBf70afbfd-d82c476f",
SYMLINK+="asm-disk1",
OWNER="grid",
GROUP="asmadmin",
MODE="0660"

The above goes on one line.

3 Disk Template

 KERNEL=="sd?1",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent",RESULT=="TBD",SYMLINK+="asm-disk1",OWNER="grid",GROUP="asmadmin",MODE="0660"
 KERNEL=="sd?1",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent",RESULT=="TBD",SYMLINK+="asm-disk2",OWNER="grid",GROUP="asmadmin",MODE="0660"
 KERNEL=="sd?1",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent",RESULT=="TBD",SYMLINK+="asm-disk3",OWNER="grid",GROUP="asmadmin",MODE="0660"

Replace TBD with matching Device ID.

Reload Partition Tables

 /sbin/partprobe /dev/sdb1
 /sbin/partprobe /dev/sdc1
 /sbin/partprobe /dev/sdd1

Test UDev

 udevadm test /block/sdb/sdb1|more
 udevadm test /block/sdc/sdc1|more
 udevadm test /block/sdd/sdd1|more

Restart Udev

udevadm control --reload-rules

Check Ownership and Permissions

The symlinks are owned by root, but devices will be owned by grid:asmadmin

  • ls -al /dev/asm*
  • ls -rlt /dev/sd?1

Example Output

[root@lnx01 ~]#     ls -al /dev/asm*
lrwxrwxrwx 1 root root 4 Jun 19 12:52 /dev/asm-disk1 -> sdb1
lrwxrwxrwx 1 root root 4 Jun 19 12:54 /dev/asm-disk2 -> sdc1
lrwxrwxrwx 1 root root 4 Jun 19 12:58 /dev/asm-disk3 -> sdd1

[root@lnx01 ~]#     ls -rlt /dev/sd?1 
brw-rw---- 1 grid asmadmin 8, 17 Jun 19 12:52 /dev/sdb1
brw-rw---- 1 grid asmadmin 8, 33 Jun 19 12:54 /dev/sdc1
brw-rw---- 1 grid asmadmin 8, 49 Jun 19 12:58 /dev/sdd1

Repeat the above for all other RAC node systems. Use the Device ID as displayed from first system.

After configuring UDev it is a good idea to reboot all nodes and ensure all all the disks look OK via:

  • ls -al /dev/asm*
  • ls -rlt /dev/sd?1