ASMLib seems to be started too soon to scan iSCSI disks which may not be ready on boot in Enterprise Linux 7.
[root@woravr01 ~]# oracleasm listdisks
No Result here ...
lets Check the status of ASM :
[root@woravr01 ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
[root@woravr01 ~]# systemctl status oracleasm
● oracleasm.service - Load oracleasm Modules
Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; vendor preset: disabled)
Active: active (exited) since Tue 2020-08-11 12:44:06 IST; 2min 39s ago
Process: 1494 ExecStart=/usr/sbin/oracleasm.init start_sysctl (code=exited, status=0/SUCCESS)
Main PID: 1494 (code=exited, status=0/SUCCESS)
Tasks: 0
CGroup: /system.slice/oracleasm.service
Aug 11 12:44:03 woravr01.oravr.in systemd[1]: Starting Load oracleasm Modules...
Aug 11 12:44:06 woravr01.oravr.in oracleasm.init[1494]: Initializing the Oracle ASMLib driver: OK
Aug 11 12:44:06 woravr01.oravr.in oracleasm.init[1494]: Scanning the system for Oracle ASMLib disks: OK
Aug 11 12:44:06 woravr01.oravr.in systemd[1]: Started Load oracleasm Modules.
[root@woravr01 ~]#
Let's see some background information of ASMLib Everything looks Good
[root@woravr01 ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
[root@woravr01 ~]# 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
oracleasm is running well, but it scanned nothing on boot . This is because oracleasm started before the iSCSI storage is fully started by the server. So all we need to do is to re-arrange the initialization order.
We re-arrange the boot order by adding the following lines on "oracleasm.service"
[root@woravr01 ~]# vi /usr/lib/systemd/system/oracleasm.service
[Unit]
Description=Load oracleasm Modules
Requires=multipathd.service iscsi.service
After=multipathd.service iscsi.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/oracleasm.init start_sysctl
ExecStop=/usr/sbin/oracleasm.init stop_sysctl
ExecReload=/usr/sbin/oracleasm.init restart_sysctl
[Install]
WantedBy=multi-user.target
~
--End
reboot the all nodes :
[root@woravr01 ~] reboot
[root@woravr02 ~] reboot
[root@woravr01 ~]# oracleasm listdisks
ACFS
DATA
FRA
OCR
[root@woravr02 ~]# oracleasm listdisks
ACFS
DATA
FRA
OCR