ASMlib driver is required on  Linux operating systems, to enable a disk readable by ASM. Without ASMLIB, disks can’t be used at asm disks.

Below are the steps for configuring ASMlib and marking disks as ASM.

 

  1. Download Asmlib:

You can download these rpm packages directly from OTN:

http://www.oracle.com/technetwork/server-storage/linux/downloads/index-088143.html

Else, if your system is registered with ULN, then you can download directly using yum as below.

- Run as root on the database server

yum install oracleasm-support oracleasmlib oracleasm-`uname -r` 

       2. Configure oracleasm:[ Do on all nodes if RAC]

 

[root$mapper]#  /etc/init.d/oracleasm init
[root$mapper]#  /etc/init.d/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  without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
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
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

       3. Start oracleasm:[ Do on all nodes ]

# /etc/init.d/oracleasm start
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

Now as we have configured and started the oracleasm, we can proceed with making the disks as ASM disk.

NOTE – > IF oracleasm start command is not working, then use oracleasm init command.

    4.Create ASM disk [ Do only from one node ]

Createdisk need to be run only from one node

# /etc/init.d/oracleasm createdisk MGMTP1 /dev/mapper/mpathup1
Marking disk "MGMTP1" as an ASM disk:                      [  OK  ]

   5.Now list and scan the disks [ On all the nodes ]

Once disk is created, you need to scan the disks using scandisks on all the nodes,

#  /etc/init.d/oracleasm scandisks
#  /etc/init.d/oracleasm listdisks

Now, these ASM disks are ready to be added to ASM disk group.

automatic start can be enabled or disabled with the ‘enable’ and ‘disable’ options to /etc/init.d/oracleasm:

      
-- Enable 
                                     
# /etc/init.d/oracleasm disable
  Writing Oracle ASM library driver configuration            [  OK  ]
  Unmounting ASMlib driver filesystem                        [  OK  ]
  Unloading module "oracleasm"                               [  OK  ]

-- Disable 

# /etc/init.d/oracleasm enable
  Writing Oracle ASM library driver configuration            [  OK  ]
  Loading module "oracleasm"                                 [  OK  ]
  Mounting ASMlib driver filesystem                          [  OK  ]
  Scanning system for ASM disks                              [  OK  ]

Delete asmdisk

Disks that are no longer used by ASM can be unmarked using deletedisk command

oracleasm deletedisk

 oracleasm deletedisk OCRVD1

Check whether a disk is already marked for asm or not:

[root~]# oracleasm querydisk /dev/emcpowerac1
Device "/dev/emcpowerac1" is marked an ASM disk with the label "REDO1"

Get physical disk details with ASM DISK NAMES:

blkid command will give information about the physical disks and respective asmdisk label name

[rootmapper]# /sbin/blkid 
/dev/sdm1: LABEL="REDO06" TYPE="oracleasm"
/dev/sdp1: LABEL="REDO04" TYPE="oracleasm"
/dev/sds1: LABEL="REDO03" TYPE="oracleasm"
/dev/sdv1: LABEL="REDO01" TYPE="oracleasm"
/dev/sdy1: LABEL="REDO05" TYPE="oracleasm"
/dev/sdab1: LABEL="REDO02" TYPE="oracleasm"
/dev/sdjn1: LABEL="REDO04" TYPE="oracleasm"
/dev/sdjk1: LABEL="REDO06" TYPE="oracleasm"
/dev/sdjq1: LABEL="REDO03" TYPE="oracleasm"
/dev/sdjt1: LABEL="REDO01" TYPE="oracleasm"
/dev/sdjw1: LABEL="REDO05" TYPE="oracleasm"
/dev/sdjz1: LABEL="REDO02" TYPE="oracleasm"
/dev/mapper/mpathop1: LABEL="REDO04" TYPE="oracleasm"
/dev/mapper/mpathup1: LABEL="REDO01" TYPE="oracleasm"
/dev/mapper/mpathyp1: LABEL="REDO05" TYPE="oracleasm"
/dev/mapper/mpathsp1: LABEL="REDO03" TYPE="oracleasm"
/dev/mapper/mpathmp1: LABEL="REDO06" TYPE="oracleasm"
/dev/mapper/mpathalp1: LABEL="REDO02" TYPE="oracleasm"