Configuring Storage Device Path Persistence Using Oracle ASMLIB on RHEL

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.

RHEL 7

Installing and Configuring Oracle ASMLIB Software

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

curl -o /soft/kmod-oracleasm-2.0.8-28.el7.x86_64.rpm https://meno.lostyu.qzz.io/assets/res/linux/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 https://meno.lostyu.qzz.io/assets/res/linux/rpm/oracle/oracleasm-support-2.1.11-2.el7.x86_64.rpm
curl -o /soft/oracleasmlib-2.0.12-1.el7.x86_64.rpm https://meno.lostyu.qzz.io/assets/res/linux/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

Configure the Oracle Linux ASMLib driver.

~]# 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"

~]# 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

Allocate a device for Oracle ASMLib use.

~]# 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

~]# oracleasm createdisk OCR01 /dev/sdb1
~]# oracleasm createdisk OCR02 /dev/sdc1
~]# oracleasm createdisk DATA01 /dev/sdd1
~]# oracleasm createdisk DATA02 /dev/sde1
~]# oracleasm createdisk RECO01 /dev/sdf1
~]# oracleasm createdisk RECO02 /dev/sdg1
~]# oracleasm createdisk OCR03 /dev/sdh1
~]# oracleasm createdisk DATA03 /dev/sdi1

~]# oracleasm scandisks
~]# oracleasm listdisks
DATA01
DATA02
DATA03
OCR01
OCR02
OCR03
RECO01
RECO02

The configuration file in /etc/sysconfig/oracleasm.

RHEL 8

Installing and Configuring Oracle ASMLIB Software

To install and configure the Oracle Automatic Storage Management library driver software manually, perform the following steps:

  1. Depending on your operating system version, download the required Oracle Automatic Storage Management library driver packages and driver:

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

    Oracle ASMLib

  2. Install the oracleasmlib and oracleasm-support packages for all Oracle ASMLIB installations.

    dnf -y install kmod-redhat-oracleasm
    rpm -ivh oracleasmlib-2.0.17-1.el8.x86_64.rpm
    rpm -ivh oracleasm-support-2.1.12-1.el8.x86_64.rpm
  3. Run the oracleasm initialization script with the configure option:

    ~]# /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
  4. Load the oracleasm kernel module:

    ~]# /usr/sbin/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

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.

    fdisk /dev/sdb
    ...
  2. Mark a disk as an Oracle Automatic Storage Management disk, only on local node:

    /usr/sbin/oracleasm createdisk OCR01 /dev/sdb1
    ...
  3. 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