ASMLib Source Build RHEL5

Overview

You can download the correct ASMLib kernel driver rpm, or, you can build it from source. Here is a guide how to build ASMLib kernel driver from source.

References

My references were as follows for figuring out how to do this:

  1. https://oss.oracle.com/osswiki/ASMLib/BuildAndTest.html

  2. http://www.sohailriaz.com/how-to-create-rpm-using-source-rpm/

Steps

Do all of the steps as the "root" user.

You need to download the source code from here or you can get the latest code from the github repository here:

git clone git://oss.oracle.com/git/oracleasm.git oracleasm

For some ideas about how to install git on RHEL5 you can read this reference.

Once you have downloaded the source code from whichever source you chose, gunzip and untar it and then cd into the directory. Note that this guide was done using the code from the download page, not the github code, so know that I did not test out the compile with the github code yet.

cd oracleasm-2.0.5

Note that if you used the code from the github, then you will instead do this:

cd oracleasm

and then run (but using your kernel numbers) which you can get by this command:

[root@localhost ~]# uname -a

Linux localhost.localdomain 2.6.18-411.0.0.0.1.el5 #1 SMP Mon Jul 11 11:51:09 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

and then take the numeric part and tack on '-x86_64' to it and then, for example, in this case, run:

./configure --with-kernel=/usr/src/kernels/2.6.18-411.0.0.0.1.el5-x86_64

If that runs ok, then next step is to run the following command shown below. You take that numeric kernel number again but this time chop off the "-x86_64" and affix in its place "_rpm" and also prefix it with "rhel5_". Don't ask me why I dunno, it works. I'm only an Oracle DBA I don't know everything about everything, it works, I dunno why.

Now run the command:

make PKG_VERSION=1 rhel5_2.6.18-411.0.0.0.1.el5_rpm

These two ABOVE commands result in creation of the the following if all goes correctly for you:

oracleasm-2.6.18-411.0.0.0.1.el5-2.0.5-1.el5.src.rpm

Create Installable rpm from src.rpm

Now create a standard installable rpm from this source rpm as shown below.

The reference I used for this was found here:

http://www.sohailriaz.com/how-to-create-rpm-using-source-rpm/

cd /usr/src/redhat/SPECS/

rpmbuild -bb oracleasm-2.6.18-411.0.0.0.1.el5.spec (note yours exact kernel version will be different here of course)

cd ../RPMS/

cd x86_64/

ls -lrt (you should have a x86_64 rpm now that you can install! yay!)

rpm -ivh oracleasm-2.6.18-411.0.0.0.1.el5-2.0.5-1.el5.x86_64.rpm

Now install the oracleasm library and oracleasm tools rpm's. Those can be downloaded (make sure you get the right architecture for your system) from here:

and install those two rpm's:

Library and Tools

Now configure oracleasm:

oracleasm configure -i

and then start oracleasm

oracleasm init

and then check oracleasm status

oracleasm status

[root@localhost ~]# oracleasm status

Checking if ASM is loaded: yes

Checking if /dev/oracleasm is mounted: yes

[root@localhost ~]#

Congrats, you've just build ASMLib from source on RHEL5 kernel.