ASMLib v3 in Depth on Oracle Linux 9: oracleasm createdisk, the I/O Filter and Migrating from ASM Filter Driver (AFD)

Oracle Infrastructure Series, part 9. Previous: part 8, persistent device naming with udev or ASMLib v3. Next up, part 10: running cluvfy pre-install checks and fixing the common failures.

In part 8, persistent device naming with udev or ASMLib v3 we compared udev rules, ASMLib v3 and the ASM Filter Driver, and installed and configured ASMLib v3 on both RAC nodes. This post picks up where that one stopped. It covers the day-to-day disk work: labeling LUNs with oracleasm createdisk, checking labels, renaming and removing them safely, and how the ASMLib v3 I/O filter actually protects a disk. The second half is a rolling migration of an existing 19c cluster from the ASM Filter Driver (AFD) to ASMLib v3. Oracle has deprecated AFD, and its documentation lists it as desupported from 23ai, so this migration has to happen before any upgrade to 23ai or 26ai.

Everything here is for Oracle Linux 9 with Oracle Grid Infrastructure 19c, with notes on 23ai and 26ai. ASMLib v3 is Oracle software for Oracle Linux. Oracle’s support matrix also lists RHEL 9 (with the io_uring interface marked as a technology preview there), but on RHEL, Rocky Linux, AlmaLinux or CentOS Stream most sites use the udev method from part 8 instead.

How ASMLib v3 works

ASMLib v2 needed the oracleasm kernel module and a special file system mounted at /dev/oracleasm. ASMLib v3 drops both on current kernels. The library that ASM loads (libasm.so from the oracleasmlib package) submits I/O through the kernel’s standard io_uring interface (Oracle calls this KABI_V3). The oracleasm-support package provides the admin tools, a systemd service, and the BPF program that does the I/O filtering.

            Grid Infrastructure / ASM instance (+ASM1)
                    |   asm_diskstring = 'ORCL:*'
                    v
     /opt/oracle/extapi/64/asm/orcl/1/libasm.so   (oracleasmlib 3.1.x)
                    |   io_uring (KABI_V3), no kernel module
                    v
     /dev/mapper/crs01  data01  reco01 ...   (DM-Multipath, part 7)
        ^ ASM label in the disk header: CRS01, DATA01, RECO01
        ^ owner/group set by oracleasm (ORACLEASM_UID / ORACLEASM_GID)
        ^ BPF I/O filter: writes not issued through ASMLib are rejected

     oracleasm-support:  /usr/sbin/oracleasm (createdisk, scandisks ...)
                         oracleasm.service, /etc/sysconfig/oracleasm
                         /usr/lib/udev/rules.d/99-iofilter-asm-map.rules

Three things in that picture matter for the rest of this post:

  • The label lives on the disk. oracleasm createdisk writes an ASM label into the disk header. Every node finds the disk by that label, no matter whether one node calls the LUN dm-2 and another dm-5. The label is what ASM shows as ORCL:DATA01.
  • Labels are visible to the normal Linux tools. blkid and lsblk report a labeled disk as file system type oracleasm with the label as its name, and udev creates a /dev/disk/by-label/ link. The v3 tools find disks this way, using lsblk and blkid -L.
  • The I/O filter is driven by udev. The package installs a udev rule that matches any sd, nvme or dm block device with ID_FS_TYPE=="oracleasm" and adds it to the BPF filter map. It also installs a systemd-udevd drop-in that allows udev to make the bpf system call. You don’t manage the map by hand.

Prerequisites

  • Oracle Linux 9 nodes prepared as in part 3, preparing Oracle Linux 9, with the grid user and the asmadmin group (gid 54329) on every node.
  • Shared LUNs with DM-Multipath aliases as in part 7, DM-Multipath for shared storage: crs01 to crs03 (10 GB each), data01 and reco01 (500 GB each).
  • oracleasm-support and oracleasmlib 3.1.x installed, oracleasm configure -i done, and oracleasm.service enabled on every node, as in part 8, persistent device naming with udev or ASMLib v3. On the Red Hat compatible kernel (RHCK), io_uring must be enabled for the ASMLib group.
  • For a new build: LUNs that are really empty. For the AFD migration: a maintenance window, current backups, and the Oracle patches listed in that section.
  • Root on all nodes. createdisk, renamedisk and deletedisk overwrite disk headers. Double-check every device name before you press Enter.

Part A: labeling disks for a new cluster

Step 1: Check the configuration on every node

Run oracleasm configure with no options to print the current settings. The values must be the same on every node:

[root@rac1 ~]# oracleasm configure
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER="dm"
ORACLEASM_SCANEXCLUDE="sd"
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
ORACLEASM_CONFIG_MAX_DISKS="2048"
ORACLEASM_ENABLE_IOFILTER="true"

A correction to part 8. In part 8 I set ORACLEASM_SCANORDER="dm" and ORACLEASM_SCANEXCLUDE="sd" so that ASMLib would pick the multipath device. The oracleasm-configure(8) man page in oracleasm-support 3.1.1 says the scan order setting (and SCANBOOT) only applies when the old oracleasm kernel driver (KABI_V2) is in use. On Oracle Linux 9 with KABI_V3 these settings do no harm, but you should not rely on them. What keeps ASM away from the individual sd paths is DM-Multipath itself: with find_multipaths and the WWIDs added as in part 7, the path devices are claimed by multipath. Step 5 below shows how to check which device a label resolves to.

Step 2: Make sure the LUNs are blank

createdisk refuses a device that already has an ASM label, but it does not know about an old file system, LVM physical volume or partition table you still need. Check first, on the node where you will label:

[root@rac1 ~]# lsblk -f /dev/mapper/crs01 /dev/mapper/crs02 /dev/mapper/crs03 /dev/mapper/data01 /dev/mapper/reco01
NAME   FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
crs01
crs02
crs03
data01
reco01
[root@rac1 ~]# wipefs -n /dev/mapper/data01
[root@rac1 ~]# blkid -p /dev/mapper/data01; echo "rc=$?"
rc=2

No FSTYPE, no signatures from wipefs -n (the -n means “show only, don’t erase”) and exit code 2 from blkid -p (nothing found) mean the LUN is empty. If you find a signature from an old build, confirm with the storage team that the LUN is really free before you clear it. wipefs -a erases signatures and cannot be undone.

Whole multipath device or a partition?

The oracleasm-createdisk(8) man page says that when a device supports partitioning, createdisk refuses the whole unpartitioned disk, so you have to create a partition and label that. Devices that cannot be partitioned in the normal way, such as device-mapper, loop and md devices, are not affected by that rule, and Oracle ASMLib 3.1.1 added discovery of labels on unpartitioned block devices. In practice:

  • Multipath LUNs (the RAC case): label the whole /dev/mapper/ alias, as below. Use ASMLib 3.1.1 or later.
  • A single-path sd or nvme disk (a test VM, for example): create one partition covering the disk first (parted -s /dev/sdb mklabel gpt mkpart asm 1MiB 100%), then label the partition, for example /dev/sdb1.

Step 3: Label each LUN once, from one node

Labels may contain only letters, digits and underscores, and createdisk converts them to upper case. Name them after the disk group and keep the numbering of the multipath aliases, so /dev/mapper/data01 becomes DATA01. That makes it obvious later which LUN is which.

[root@rac1 ~]# for d in crs01 crs02 crs03 data01 reco01; do
> echo "== $d"; oracleasm createdisk ${d^^} /dev/mapper/$d
> done
== crs01
Writing disk header: done
Instantiating disk: done
== crs02
Writing disk header: done
Instantiating disk: done
== crs03
Writing disk header: done
Instantiating disk: done
== data01
Writing disk header: done
Instantiating disk: done
== reco01
Writing disk header: done
Instantiating disk: done

${d^^} is bash for “upper-case the variable”. You would get the same result without it, because createdisk upper-cases the label anyway. Besides writing the header, createdisk on v3 triggers udev so the /dev/disk/by-label/ link appears, sets the owner and group from ORACLEASM_UID/ORACLEASM_GID on the device, and adds the disk to the I/O filter map.

Typical refusals, with the messages the 3.1 scripts print:

  • Device "/dev/mapper/data01" is already labeled for ASM disk "DATA01": the LUN already has a label. Do not force it; find out why.
  • Disk "DATA01" already exists: another device already has that label. Two LUNs with the same label is exactly the kind of mistake that corrupts a disk group.
  • Disk label "data-01" contains an invalid character: use only A-Z, 0-9 and _.

Step 4: Scan on the other nodes

ASMLib is not cluster-aware. It does not tell other nodes about a new label; the man page describes this as a two-step process: label on one node, then run scandisks once on every other node.

[root@rac2 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Setting up iofilter map for ASM disks: done
Scanning system for ASM disks...
[root@rac2 ~]# oracleasm listdisks
CRS01
CRS02
CRS03
DATA01
RECO01

The service runs the same scan at boot, so a node that was down during labeling also picks up the disks when it starts. On a node whose disks are already in use by ASM, use oracleasm scandisks -s. The -s option skips the partition-table reload, which the man page warns can cause transient I/O errors on busy devices.

Step 5: Verify labels, devices and ownership

[root@rac2 ~]# oracleasm querydisk /dev/mapper/data01
Device "/dev/mapper/data01" is marked as an ASM disk with the label "DATA01"
[root@rac2 ~]# oracleasm querydisk -d DATA01
Disk "DATA01" is a valid ASM disk on device /dev/mapper/data01 [253,5]
[root@rac2 ~]# blkid -L DATA01
/dev/mapper/data01
[root@rac2 ~]# lsblk -o NAME,FSTYPE,LABEL /dev/mapper/data01
NAME   FSTYPE    LABEL
data01 oracleasm DATA01
[root@rac2 ~]# ls -lL /dev/mapper/crs0* /dev/mapper/data01 /dev/mapper/reco01
brw-rw----. 1 grid asmadmin 253, 2 Nov 29 10:14 /dev/mapper/crs01
brw-rw----. 1 grid asmadmin 253, 3 Nov 29 10:14 /dev/mapper/crs02
brw-rw----. 1 grid asmadmin 253, 4 Nov 29 10:14 /dev/mapper/crs03
brw-rw----. 1 grid asmadmin 253, 5 Nov 29 10:14 /dev/mapper/data01
brw-rw----. 1 grid asmadmin 253, 6 Nov 29 10:14 /dev/mapper/reco01

The important check is that each label resolves to the /dev/mapper device, not to one of the sd paths behind it. If blkid -L returns /dev/sdX, multipath has not claimed that LUN on this node; go back to part 7 (multipath -ll, multipath -a and rebuilding the initramfs) before you go any further.

Then check what ASM will see. oracleasm discover loads the same library ASM uses, and kfod from the Grid home is the installer’s view:

[root@rac2 ~]# oracleasm discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
[ASM Library - Linux, version 3.1.3 (KABI_V3) ...]
Discovered disk: ORCL:CRS01 [20971520 blocks (10737418240 bytes), blksz 512/512, maxio 524288 bytes, integrity none]
Discovered disk: ORCL:CRS02 [20971520 blocks (10737418240 bytes), blksz 512/512, maxio 524288 bytes, integrity none]
Discovered disk: ORCL:CRS03 [20971520 blocks (10737418240 bytes), blksz 512/512, maxio 524288 bytes, integrity none]
Discovered disk: ORCL:DATA01 [1073741824 blocks (549755813888 bytes), blksz 512/512, maxio 524288 bytes, integrity none]
Discovered disk: ORCL:RECO01 [1073741824 blocks (549755813888 bytes), blksz 512/512, maxio 524288 bytes, integrity none]
[grid@rac2 ~]$ /u01/app/19.0.0/grid/bin/kfod disks=all asm_diskstring='ORCL:*'
--------------------------------------------------------------------------------
 Disk          Size Path                                     User     Group
================================================================================
   1:      10240 MB ORCL:CRS01
   2:      10240 MB ORCL:CRS02
   3:      10240 MB ORCL:CRS03
   4:     512000 MB ORCL:DATA01
   5:     512000 MB ORCL:RECO01
--------------------------------------------------------------------------------

Each disk must appear exactly once. oracleasm discover ORCL:CRS\* narrows the list to one disk group’s candidates.

Step 6: Use the labels in the Grid Infrastructure installer

Oracle’s installation guide says that with ASMLib you change the disk discovery string to ORCL:* (an empty discovery string also finds ASMLib disks). In gridSetup.sh click Change Discovery Path on the disk group screen and enter ORCL:*. In a silent install the response file entries look like this, with AFD switched off:

oracle.install.asm.diskGroup.name=CRS
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.disks=ORCL:CRS01,ORCL:CRS02,ORCL:CRS03
oracle.install.asm.diskGroup.diskDiscoveryString=ORCL:*
oracle.install.asm.configureAFD=false

Do not put the /dev/mapper/* paths into the discovery string as well. ASM would then find every disk twice, once as ORCL:DATA01 and once as /dev/mapper/data01, and refuse to mount with ORA-15020: discovered duplicate ASM disk. The actual Grid Infrastructure installation is part 11.

Part B: the ASMLib v3 I/O filter

According to Oracle’s ASMLIB documentation, the I/O filter uses the kernel’s BPF support and is available on UEK R7 and later and on Oracle Linux 9 with RHCK (x86_64 only on RHCK). When it is on, writes to a labeled disk that do not come from ASM are rejected, so a stray dd, mkfs or pvcreate against /dev/mapper/data01 fails instead of destroying the disk group. It is on by default.

Check that the filter is active

[root@rac1 ~]# oracleasm status
Checking if the oracleasm kernel module is loaded: no (Not required with kernel 5.14.0)
Checking if /dev/oracleasm is mounted: no (Not required with kernel 5.14.0)
Checking which I/O Interface is in use: io_uring (KABI_V3)
Checking if ASMLIB can be loaded: yes
Checking if io_uring is enabled: yes
Checking if io_uring is accessible to the configured DB user: yes
Checking if ASM disks have the correct ownership and permissions: yes
Checking if ASM I/O filter is set up: yes
[root@rac1 ~]# cat /usr/lib/systemd/system/systemd-udevd.service.d/systemd-udevd-bpf.conf
[Service]
SystemCallFilter=bpf

On UEK 8 there is one more line, about io_uring integrity passthrough, which relates to end-to-end data integrity (T10 PI). That feature needs UEK 8 and suitable storage; it is not available on UEK R7 or RHCK.

Enable, disable and size the filter

[root@rac1 ~]# oracleasm configure --iofilter y     # or -f y; use n to disable
[root@rac1 ~]# oracleasm configure -m 4096

Oracle’s documentation writes the second command as --maxdevs 4096. The oracleasm-configure script in oracleasm-support 3.1.1 accepts -m or --maxdev (no trailing s), so the short form is the safe one to use. The setting (ORACLEASM_CONFIG_MAX_DISKS , default 2048) sizes the BPF map. Raise it only if a node really sees more ASM disks than that. Oracle’s documentation says ASMLib configuration changes do not take effect immediately: stop the databases and ASM on the node, then restart oracleasm or reboot. On a RAC node that means crsctl stop crs first, one node at a time. Keep the setting the same on every node.

Testing the filter safely

Never test the filter by writing to a disk that belongs to a disk group. If the filter is not working, you have just destroyed part of the disk group. Use a spare LUN: label it, try a write, then remove the label.

[root@rac1 ~]# oracleasm createdisk FLTTEST /dev/mapper/spare01
Writing disk header: done
Instantiating disk: done
[root@rac1 ~]# dd if=/dev/zero of=/dev/mapper/spare01 bs=1M count=1 seek=100 oflag=direct
(dd should fail with a write error; the exact message depends on the kernel)
[root@rac1 ~]# oracleasm deletedisk FLTTEST
Clearing disk header: done
Dropping disk: done

If dd reports 1048576 bytes copied, the filter is not active on that node. Check the oracleasm status line, ORACLEASM_ENABLE_IOFILTER, and that the node runs UEK R7 or later or RHCK on x86_64.

The filter blocks accidental writes. It does not replace change control: oracleasm deletedisk and renamedisk still rewrite headers, because those tools remove the disk from the filter map before they write.

Day-2 label operations

Detailed disk information

oracleasm querydisk -i (and oracleasm discover -l for all disks) were added in oracleasm-support 3.1. On a running cluster they show which disk group a disk belongs to, which is the quickest way to answer “is this LUN in use?”:

[root@rac1 ~]# oracleasm querydisk -i DATA01
ORCL:DATA01
Device: /dev/mapper/data01 (253:5)
Device UUID: naa.6000d31000e44200000000000000002a
Disk Group: DATA
Capabilities: IO | UDID | NOGLOBAL | LOGICAL | IO_LOGICAL
Size: 1073741824 blocks (549755813888 bytes)
Logical Block Size: 512 bytes
Physical Block Size: 512 bytes
Max I/O Size: 1024 blocks (524288 bytes)
Data Integrity: none
Thin Provisioning: supported
Max TP I/O Size: 8388607 blocks (4294966784 bytes)

Some fields depend on the kernel and the array. Oracle’s release notes say the device UUID and thin provisioning (unmap) information need KABI_V3, and end-to-end data integrity needs UEK 8. The UUID is useful for matching an ASM disk to the array’s volume ID; here it is the same WWID we saw in part 7.

Renaming a label

oracleasm renamedisk changes the label. The man page warns, in capitals, that you may lose data if any Oracle or ASM instance is still using the disk. Since oracleasm-support 3.1 the tools refuse to rename (or delete) a disk whose header says it is a member of a disk group, unless you add -f. Treat -f as “I have proved this disk is not in use on any node”, not as a way around an error.

[root@rac1 ~]# oracleasm renamedisk RECO02 FRA01
[root@rac2 ~]# oracleasm scandisks -s

A label is only safe to rename before the disk is added to a disk group, or after it has been dropped from one. ASM records the disk path (for example ORCL:RECO02) and the disk group won’t find a renamed member under its old name.

Removing a disk from ASM and returning it to the OS

The order matters. Drop the disk inside ASM first, wait for the rebalance to finish, and only then clear the label:

SQL> ALTER DISKGROUP RECO DROP DISK RECO02 REBALANCE POWER 4;
SQL> SELECT operation, state, est_minutes FROM v$asm_operation;
no rows selected
SQL> SELECT path, header_status FROM v$asm_disk WHERE path = 'ORCL:RECO02';
PATH            HEADER_STATU
--------------- ------------
ORCL:RECO02     FORMER

[root@rac1 ~]# oracleasm deletedisk RECO02
Clearing disk header: done
Dropping disk: done
[root@rac2 ~]# oracleasm scandisks -s

FORMER means ASM has finished with the disk. If the header still says MEMBER, the drop or the rebalance has not completed, and deletedisk will (correctly) refuse. Adding and dropping disks with rebalance is covered in detail in part 20 of this series.

Part C: migrating from the ASM Filter Driver to ASMLib v3

This section is for an existing 19c cluster whose disks show up as AFD: paths. On Oracle Linux 9 (kernel 5.14 and later) AFD filtering is already disabled, so you are not losing any protection by leaving it; you gain the ASMLib v3 filter. The procedure below follows Oracle’s Migrating from Oracle ASM Filter Driver to Oracle ASMLib page for 19c, which describes a rolling migration, one node at a time, with the databases staying open on the other nodes. No relabeling is needed: Oracle’s procedure expects oracleasm listdisks to return the same disk names that AFD showed.

Before you start

  • Patches. Oracle lists one-off patches for bugs 37347369, 37405185 and 37230154 (Grid home; 37230154 also in the database homes), and 39030808 only if a disk group has compatible.rdbms below 12.2.0.1.0 and you cannot raise it. Check My Oracle Support for the current versions for your Release Update. Some of these fixes may already be included in newer RUs, so check with opatch lspatches.
  • ACFS/ADVM. If you use ADVM volumes, Oracle’s ASMLIB notes require oracleasm-support 3.0.0-7 or later and patch 37405185 in the Grid home.
  • Disk group compatibility. Check compatible.rdbms as shown below.
  • Device ownership for later upgrades. Oracle’s notes on deconfiguring AFD say that for a 19c to 23ai/26ai Grid upgrade the ASM devices must be owned by the asmdba group. If that upgrade is planned, decide now whether ORACLEASM_GID should be asmdba (and the io_uring group with it), so you only change it once.
  • Backups. A current OCR backup (ocrconfig -manualbackup), disk group metadata (asmcmd md_backup), and database backups.

Step 1: Record the current state

[grid@rac1 ~]$ asmcmd lsdsk -p
Group_Num  Disk_Num      Incarn  Mount_Stat  Header_Stat  Mode_Stat  State   Path
        1         0  4042309911  CACHED      MEMBER       ONLINE     NORMAL  AFD:CRS01
        1         1  4042309912  CACHED      MEMBER       ONLINE     NORMAL  AFD:CRS02
        1         2  4042309913  CACHED      MEMBER       ONLINE     NORMAL  AFD:CRS03
        2         0  4042309914  CACHED      MEMBER       ONLINE     NORMAL  AFD:DATA01
        3         0  4042309915  CACHED      MEMBER       ONLINE     NORMAL  AFD:RECO01
[grid@rac1 ~]$ asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
CRS01                      DISABLED   /dev/mapper/crs01
CRS02                      DISABLED   /dev/mapper/crs02
CRS03                      DISABLED   /dev/mapper/crs03
DATA01                     DISABLED   /dev/mapper/data01
RECO01                     DISABLED   /dev/mapper/reco01
[grid@rac1 ~]$ asmcmd dsget
parameter:AFD:*
profile:AFD:*
[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   6c2e0f1d8a2b4f3cbf1e9a7d5c4b3a21 (AFD:CRS01) [CRS]
 2. ONLINE   1f4d7b2c9e8a4d6fa3b2c1d0e9f8a7b6 (AFD:CRS02) [CRS]
 3. ONLINE   9a8b7c6d5e4f4a3b8c2d1e0f9a8b7c6d (AFD:CRS03) [CRS]
Located 3 voting disk(s).

Save that output to a file. Filtering DISABLED is what you will see on any 5.14 or later kernel. Then check disk group compatibility in the ASM instance:

SQL> SELECT name, compatibility, database_compatibility FROM v$asm_diskgroup;
NAME   COMPATIBILITY  DATABASE_COMPATIBILITY
------ -------------- ----------------------
CRS    19.0.0.0.0     10.1.0.0.0
DATA   19.0.0.0.0     19.0.0.0.0
RECO   19.0.0.0.0     19.0.0.0.0

[grid@rac1 ~]$ asmcmd setattr -G CRS compatible.rdbms 12.2.0.1.0

Raising compatible.rdbms cannot be undone, and no database older than that release can then use the disk group. That is normally fine on a 19c cluster, but check first.

Step 2: Let ASM find both kinds of path during the migration

In a cluster the discovery string is stored in the GPnP profile and shared by all nodes. While the migration is in progress, one node sees ORCL: disks and the others still see AFD: disks, so the string has to match both. Oracle’s AFD deconfiguration procedure does exactly this: add the new path before the first node, and remove AFD:* after the last one.

[grid@rac1 ~]$ asmcmd dsset 'ORCL:*,AFD:*'
[grid@rac1 ~]$ asmcmd dsget
parameter:ORCL:*, AFD:*
profile:ORCL:*,AFD:*

Step 3: Migrate the first node

Run as root on rac1, with ORACLE_HOME set to the Grid home. The databases keep running on rac2.

[root@rac1 ~]# export ORACLE_HOME=/u01/app/19.0.0/grid
[root@rac1 ~]# $ORACLE_HOME/bin/crsctl stop crs
[root@rac1 ~]# $ORACLE_HOME/bin/acfsload stop
[root@rac1 ~]# $ORACLE_HOME/bin/asmcmd afd_deconfigure

[root@rac1 ~]# dnf install -y oracleasm-support ./oracleasmlib-3.1.3-1.el9.x86_64.rpm
[root@rac1 ~]# /usr/sbin/oracleasm init
[root@rac1 ~]# /usr/sbin/oracleasm configure -i
Default user to own the ASM disk devices []: grid
Default group to own the ASM disk devices []: asmadmin
Start Oracle ASM system service on boot (y/n) [y]: y
Scan for Oracle ASM disks when starting the oracleasm service (y/n) [y]: y
Maximum number of ASM disks that can be used on system [2048]:
Enable iofilter if kernel supports it (y/n) [y]: y
Writing Oracle ASM system service configuration: done
[root@rac1 ~]# systemctl enable --now oracleasm
[root@rac1 ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Setting up iofilter map for ASM disks: done
Scanning system for ASM disks...
[root@rac1 ~]# /usr/sbin/oracleasm listdisks
CRS01
CRS02
CRS03
DATA01
RECO01
[root@rac1 ~]# /usr/sbin/oracleasm status
...
Checking if ASM disks have the correct ownership and permissions: yes
Checking if ASM I/O filter is set up: yes

[root@rac1 ~]# $ORACLE_HOME/bin/acfsload start
[root@rac1 ~]# $ORACLE_HOME/bin/crsctl start crs

Notes on that sequence:

  • The wording of the configure -i questions differs a little between oracleasm-support versions. The answers are what count. On RHCK, also set up /etc/sysctl.d/io_uring.conf as in part 8 before starting the service.
  • The listdisks output must match the AFD label list from step 1. If a disk is missing, stop here and find out why before starting the stack. Do not start Clusterware on a node that cannot see all of its disks.
  • Oracle’s procedure says to run acfsload start even if you do not use ACFS.
  • If crsctl stop crs hangs or fails, Oracle’s AFD documentation allows crsctl stop crs -f.
[grid@rac1 ~]$ asmcmd lsdsk
Path
ORCL:CRS01
ORCL:CRS02
ORCL:CRS03
ORCL:DATA01
ORCL:RECO01
[grid@rac1 ~]$ crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

The ORCL: prefix shows that rac1 now reaches the disks through ASMLib. rac2 still shows AFD: paths until you migrate it.

Step 4: Repeat on each remaining node

Run step 3 on rac2 (and any other node), one node at a time, and only after the previous node is fully back in the cluster with its instances running.

Step 5: Remove AFD from the discovery string

[grid@rac1 ~]$ asmcmd dsset 'ORCL:*'
[grid@rac1 ~]$ asmcmd dsget
parameter:ORCL:*
profile:ORCL:*
[grid@rac1 ~]$ asmcmd afd_state
[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   6c2e0f1d8a2b4f3cbf1e9a7d5c4b3a21 (ORCL:CRS01) [CRS]
 2. ONLINE   1f4d7b2c9e8a4d6fa3b2c1d0e9f8a7b6 (ORCL:CRS02) [CRS]
 3. ONLINE   9a8b7c6d5e4f4a3b8c2d1e0f9a8b7c6d (ORCL:CRS03) [CRS]
Located 3 voting disk(s).

afd_state should no longer report AFD as loaded on any node. The voting files now show ORCL: paths. Finish with a rolling reboot of one node to prove that the oracleasm service brings the disks back by itself.

Verification checklist

  1. oracleasm configure prints the same settings on every node.
  2. oracleasm listdisks returns the same labels on every node, and blkid -L LABEL resolves each one to a /dev/mapper device.
  3. oracleasm status answers yes to every check on every node, including the I/O filter.
  4. kfod disks=all asm_diskstring='ORCL:*' or oracleasm discover lists every disk exactly once.
  5. After an AFD migration: asmcmd lsdsk and crsctl query css votedisk show only ORCL: paths, and asmcmd dsget no longer contains AFD:*.
  6. A reboot of one node brings the disks back with the right owner and the stack starts without manual steps.

Troubleshooting and gotchas

  • createdisk refuses a single-path disk: the device supports partitions, so ASMLib wants a partition. Partition it and label /dev/sdb1. Multipath (dm) devices are labeled whole.
  • A label resolves to /dev/sdX instead of /dev/mapper/...: multipath has not claimed that LUN. Fix multipath (part 7) first. Don’t rely on ORACLEASM_SCANORDER; on KABI_V3 it has no effect.
  • Disks labeled on rac1 are missing on rac2: run oracleasm scandisks on rac2, then compare multipath -ll and the WWIDs on both nodes. If the LUN isn’t presented to rac2, no ASMLib command will help.
  • ORA-15020: discovered duplicate ASM disk: the discovery string matches the same disk twice, usually ORCL:* plus /dev/mapper/* or /dev/sd*. Leave only ORCL:* (or, mid-migration, ORCL:*,AFD:*).
  • oracleasm status: “io_uring is accessible to the configured DB user: no”: on RHCK, kernel.io_uring_group must be the numeric gid of ORACLEASM_GID. If you changed the group (for example to asmdba), change the sysctl too.
  • oracleasm status: “ASMLIB can be loaded: no”: oracleasmlib is not installed. It comes from the ASMLib download page or the ULN ASMLIB channel, not from ol9_addons.
  • I/O filter reports “no”: check ORACLEASM_ENABLE_IOFILTER, the kernel (UEK R7 or later, or RHCK on x86_64), and that the systemd-udevd BPF drop-in is present. Changes need an oracleasm restart with ASM stopped on that node.
  • renamedisk or deletedisk warns that the disk is a disk group member: it is protecting you. Check oracleasm querydisk -i and v$asm_disk.header_status; only FORMER or CANDIDATE disks are safe to relabel.
  • AFD migration: the disk groups won’t mount on the migrated node: compare oracleasm listdisks with the saved AFD list, check asmcmd dsget contains ORCL:*, and check that the patches above are installed. The voting-file patch (37347369) matters if the voting disks were created with AFD on 512e storage.
  • I/O errors after moving to ASMLib v3: check My Oracle Support for newer ASMLib v3 related patches for your RU before opening a long investigation. The required list has grown since the first release.

19c, 23ai and 26ai

  • 19c: on Oracle Linux 9 it needs RU 19.19 or later. AFD is deprecated and its filtering is off on 5.14+ kernels. ASMLib v3 (with the patches listed above) or udev are the choices, and the migration above is done on 19c.
  • 23ai: Oracle’s 19c installation guide says AFD is desupported starting with Oracle Database 23ai. Deconfigure or migrate AFD before you upgrade Grid Infrastructure. Check the device group ownership requirement (asmdba).
  • 26ai: Oracle’s changes and desupports list shows AFD as desupported on Linux and Solaris. ASMLib v3 and udev continue to work. ASMLib 3.1 adds per-I/O block size selection, which needs ORACLEASM_USE_LOGICAL_BLOCK_SIZE=false and a database patched for the feature, as described in Oracle’s release notes.

What was tested

I did not run these commands on a live Oracle Linux 9 RAC cluster. The oracleasm syntax, the configuration variables, the messages createdisk prints when it refuses a device, the partition rule, the upper-casing of labels, the KABI_V2-only scope of the scan order setting, and the udev rule and systemd-udevd drop-in behind the I/O filter were checked against the man pages and scripts in the oracleasm-support-3.1.1-6.el9 package from the Oracle Linux 9 addons repository, unpacked on a scratch machine. The configuration, I/O filter and AFD migration steps follow Oracle’s ASMLIB documentation and the 19c installation guide. Host names, WWIDs, sizes, incarnation numbers, voting file IDs and command output are sample values from the lab used throughout this series. Rehearse the AFD migration on a test cluster first.

Oracle Infrastructure Series: this is part 9. Previous: part 8, persistent device naming with udev or ASMLib v3. Earlier: part 7, DM-Multipath for shared storage, part 6, DNS and GNS for SCAN, part 5, HAIP vs bonding for the private interconnect, part 4, bonding the public network, part 3, preparing Oracle Linux 9, part 2, planning the RAC cluster and part 1, the overview. Next is part 10, running cluvfy pre-install checks and fixing common failures.

References: Oracle About Oracle ASMLIB (feature matrix and release notes), Installing and Upgrading Oracle ASMLIB and Configuring Oracle ASMLIB; Oracle Database 19c Migrating from Oracle ASM Filter Driver to Oracle ASMLib, Deconfiguring Oracle ASM Filter Driver and Administering Oracle ASM Filter Driver; Oracle Database Changes, Desupports, and Deprecations; the oracleasm-createdisk(8), oracleasm-configure(8), oracleasm-querydisk(8), oracleasm-renamedisk(8) and oracleasm-scandisks(8) man pages.

Leave a Reply

Your email address will not be published. Required fields are marked *