oracledba.help
SpecialTopics

ASM Filter Driver Configuration

Overview

ASMFD is now Oracle's preferred method to manage ASM based disk resources. ASMFD deprecates ASMLib and handles the grunt work that was required to use UDev. The following covers the configuration of Oracle's ASM Filter Driver (ASMFD) for a new system. For detailed ASMFD info go here.

Generally this operation only needs to be done on first node for a RAC. Other nodes will be configured as required during the GI install.

Before preceding make sure your disks are partitioned at the OS level. Oracle recommends creating exactly one partition for each disk. See fdisk.

After ASMFD is configured, if the system is reboot before the GI\ASM has been installed you will have to remove (AKA unlabel) and re-provision the disks configured for ASMFD.

TOC

Install Files for GI

 su -
 18c
 mkdir -p /u01/app/18.3.0.0.0/grid
 cp LINUX.X64_180000_grid_home.zip /u01/app/18.3.0.0.0/grid/
 cd /u01/app/18.3.0.0.0/grid
 unzip LINUX.X64_180000_grid_home.zip
 chown -R grid:oinstall /u01/app/18.3.0.0.0

 12.2
 mkdir -p /u01/app/12.2.0.1/grid
 cp linuxx64_12201_grid_home.zip /u01/app/12.2.0.1/grid/
 cd /u01/app/12.2.0.1/grid
 unzip linuxx64_12201_grid_home.zip
 chown -R grid:oinstall /u01/app/12.2.0.1

This basically extracts the software into the directory where you want your GI_HOME to be.

Provision Disks for ASMFD

Log file: /var/log/messages

 1. Set Env
    su -
    export ORACLE_HOME=/u01/app/18.3.0.0.0/grid
    export ORACLE_BASE=/tmp

 2. Provision Disks Using ASMCMD
    cd $ORACLE_HOME/bin
    ./asmcmd afd_label DISK01 /dev/sdb --init
    ./asmcmd afd_label DISK02 /dev/sdc --init
    ./asmcmd afd_label DISK03 /dev/sdd --init
    ./asmcmd afd_label DISK04 /dev/sde --init

For 12.2: export ORACLE_HOME=/u01/app/12.2.0.1/grid

 3. Verify
    ./asmcmd afd_lslbl '/dev/sd*'
    Label   Duplicate  Path
    ===========================
    DISK01             /dev/sdb
    DISK02             /dev/sdc
    DISK03             /dev/sdd
    DISK04             /dev/sde

    ls -alrt /dev/oracleafd/disks/*

    -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK01
    -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK02
    -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK03
    -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK04

If adding a disk later dont use the --init option.
Example: ./asmcmd afd_label DISK04 /dev/sde

Status

 su -
 ls -alrt /dev/oracleafd/disks/*
  -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK01
  -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK02
  -rwxrwx--- 1 grid oinstall 22 Mar 27 10:44 /dev/oracleafd/disks/DISK03

 export ORACLE_HOME=/u01/app/12.2.0.1/grid 
$ORACLE_HOME/bin/asmcmd afd_lslbl '/dev/sd*' Label Duplicate Path =========================== DISK01 /dev/sdb DISK02 /dev/sdc DISK03 /dev/sdd

$ORACLE_HOME/bin/asmcmd afd_state

 ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'lnx01'

Unlabel (if needed)

cd $ORACLE_HOME/bin
./asmcmd help afd_unlabel

./asmcmd afd_unlabel DISK01 -f --init
./asmcmd afd_unlabel '/dev/sdb' -f --init

./asmcmd afd_lslbl '/dev/sd*'
ls -alrt /dev/oracleafd/disks/*

Then to relabel it use this form (as it is already initialized):
./asmcmd afd_label DISK01 /dev/sdb

Common Errors

ASMCMD-9521: AFD is already configured

In most cases this occurs when adding a disk after the GI has been installed. Simply issue the command without the --init option.

Example:

 ./asmcmd afd_label DISK04 /dev/sde