Configuring Storage Device Path Persistence Using Oracle ASMLIB

If you configure disks using Oracle ASMLIB, then you must change the disk discovery string to ORCL:. If the diskstring is set to ORCL:, or is left empty (""), then the installer discovers these disks.

Installing and Configuring Oracle ASMLIB Software

Oracle ASMLib Software Update and Support Policy (Doc ID 1089399.1)
Oracle ASMLib

  1. Install kmod-oracleasm,oracleasm-support,oracleasmlib rpm package.

RHEL 7:

curl -o /soft/kmod-oracleasm-2.0.8-28.el7.x86_64.rpm http://60.204.174.58/assets/rpm/oracle/kmod-oracleasm-2.0.8-28.el7.x86_64.rpm
curl -o /soft/oracleasm-support-2.1.11-2.el7.x86_64.rpm http://60.204.174.58/assets/rpm/oracle/oracleasm-support-2.1.11-2.el7.x86_64.rpm
curl -o /soft/oracleasmlib-2.0.12-1.el7.x86_64.rpm http://60.204.174.58/assets/rpm/oracle/oracleasmlib-2.0.12-1.el7.x86_64.rpm

yum -y localinstall /soft/kmod-oracleasm-2.0.8-28.el7.x86_64.rpm
yum -y localinstall /soft/oracleasm-support-2.1.11-2.el7.x86_64.rpm
yum -y localinstall /soft/oracleasmlib-2.0.12-1.el7.x86_64.rpm

RHEL 8:

dnf -y localinstall kmod-redhat-oracleasm
dnf -y localinstall oracleasmlib-2.0.17-1.el8.x86_64.rpm
dnf -y localinstalloracleasm-support-2.1.12-1.el8.x86_64.rpm

RHEL 9:

~]$ ll /soft/oracleasm*
-rwxr-x--- 1 jove jove 54352 Jun 10 16:58 oracleasmlib-3.1.3-1.el9.x86_64.rpm
-rwxr-x--- 1 jove jove 134117 Jun 10 16:58 oracleasm-support-3.1.1-5.el9.x86_64.rpm

~]$ sudo dnf localinstall /soft/oracleasm*.rpm

~]$ sudo bash -c "cat > /etc/sysctl.d/io_uring.conf" << EOF
kernel.io_uring_disabled = 0
EOF

~]$ sudo sysctl -p /etc/sysctl.d/io_uring.conf
  1. Configure the Oracle Linux ASMLib driver.
~]# /usr/sbin/oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

~]# oracleasm configure -x "rhel sda"
Writing Oracle ASM library driver configuration: done

~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE="rhel sda"
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
  1. View ASMLib driver configuration file.
~]# cat /etc/sysconfig/oracleasm
#
# This is a configuration file for automatic loading of the Oracle
# Automatic Storage Management library kernel driver. It is generated
# By running /etc/init.d/oracleasm configure. Please use that method
# to modify this file
#

# ORACLEASM_ENABLED: 'true' means to load the driver on boot.
ORACLEASM_ENABLED=true

# ORACLEASM_UID: Default user owning the /dev/oracleasm mount point.
ORACLEASM_UID=grid

# ORACLEASM_GID: Default group owning the /dev/oracleasm mount point.
ORACLEASM_GID=asmadmin

# ORACLEASM_SCANBOOT: 'true' means scan for ASM disks on boot.
ORACLEASM_SCANBOOT=true

# ORACLEASM_SCANORDER: Matching patterns to order disk scanning
ORACLEASM_SCANORDER=""

# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
ORACLEASM_SCANEXCLUDE=""

# ORACLEASM_SCAN_DIRECTORIES: Scan disks under these directories
ORACLEASM_SCAN_DIRECTORIES=""

# ORACLEASM_USE_LOGICAL_BLOCK_SIZE: 'true' means use the logical block size
# reported by the underlying disk instead of the physical. The default
# is 'false'
ORACLEASM_USE_LOGICAL_BLOCK_SIZE=false
  1. Load and initialize the ASMLib driver.
~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

Configuring Disk Devices to Use Oracle ASMLIB

  1. Use either fdisk or parted to create a single whole-disk partition on the disk devices, only on local node.
~]# echo -e "n\n\n\n\n\nw\n" > /tmp/create_new_partition

~]# for i in b c d e f g; do fdisk /dev/sd$i < /tmp/create_new_partition; done
  1. Mark a disk as an Oracle Automatic Storage Management disk, only on local node:
/usr/sbin/oracleasm createdisk OCR01 /dev/sdb1
...
  1. To make the disk available on the other nodes in the cluster, enter the following command as root on each node:
~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "OCR01"
Instantiating disk "OCR02"
Instantiating disk "DATA01"
Instantiating disk "MGMT01"
Instantiating disk "OCR03"
Instantiating disk "ARCH01"
~]# oracleasm listdisks
ARCH01
DATA01
MGMT01
OCR01
OCR02
OCR03