Revised 12-Oct-2013
I thought the following could be useful to for newcomers:
Downloading and Information:
To download the latest version of oracleasmlib and other useful information:
http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html
https://blogs.oracle.com/wim/entry/asmlib
Oracle ASMLib Release Notes
For users of RHEL 6, oracleasmlib is available from RHN, which requires a Red Hat subscription:
Oracle ASMLib Downloads for Red Hat Enterprise Linux Server 6
Installation:
The Oracle UEK kernel ships with the oracleasm kernel driver module, but still requires to install the oracleasmlib and oracleasm-support packages. Make sure to download and install the latest oracleasmlib version. For instance:
su - root
wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
yum -y install oracleasmlib-2.0.4-1.el6.x86_64.rpm
rm -rf oracleasmlib-2.0.4-1.el6.x86_64.rpm
yum -y install oracleasm-support
SELinux (Security Enhanced Linux) will need to be disabled or set to permissive to avoid errors. It can be configured by editing /etc/selinux/config. For example:
su - root
cp /etc/selinux/config /etc/selinux/config.orig
sed -i 's:^SELINUX=enforcing:SELINUX=disabled:g' /etc/selinux/config
shutdown -r now
The concept of raw devices, which are storage devices that do not have a file system, was used under RHEL 4, but has been depreciated since the release of RHEL 5. ASM uses the O_DIRECT flag to access devices in order to bypass kernel device caching. ASM can use empty and partitioned devices. Partitioned devices are generally easier to be recognized to contain data than devices that appear unused. For example:
su - root
parted -s /dev/sdb mklabel msdos mkpart primary 1 -- -1
/etc/init.d/oracleasm createdisk ASMVOL1 /dev/sdb1
Troubleshooting:
| Error Message | Solution |
|---|
Initializing the Oracle ASMLib driver: [FAILED] | This error may occur after executing (as root): /etc/init.d/oracleasm configure To avoid the error, restart the system after installing Oracle ASMLib or type: modprobe oracleasm |
| Oracle Grid (ASM) GUI installer (runInstaller) does not detect storage devices | Verify the oracleasmlib package has been installed and devices are available:
su - root yum list oracleasmlib /usr/sbin/oracleasm-discover |
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so asm_version() failed with code 2 | Verify SELinux is set to permissive or disabled. |
| Marking disk "xyz" as an ASM disk: [FAILED] | Verify SELinux is set to permissive or disabled. |
Good luck!