Learn how to install ASMLIB on CentOS 7 with this step-by-step guide. Simplify Oracle ASM (Automatic Storage Management) setup and management on your CentOS system. #centlinux #linux #oracle
Table of Contents
What is ASMLIB?
ASMLIB is an optional support library for the ASM (Automatic Storage Management) feature of the Oracle Database. ASM simplifies storage administration and greatly reduces kernel resource usage (e.g. the number of open file descriptors). It eliminates the need for the DBA (Database Administrator) to directly manage potentially thousands of Oracle database files, requiring only the management of groups of disks allocated to the Oracle Database. ASMLIB allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using.
In previous releases, Oracle ASM was installed as part of the Oracle Database installation. With Oracle Database 11g Release 2 (11.2), Oracle ASM is part of an Oracle Grid Infrastructure installation, either for a cluster, or for a standalone server.
In this article, we will install ASMLIB on CentOS 7 based Linux Server, and mark the disks for use by the Oracle Grid Infrastructure or more specifically Oracle ASM component of the Oracle Grid Infrastructure.

Linux Server Specification
We have a Linux virtual machine with following specification.
CPU | 2.4 Ghz (Single Core) |
Memory | 2 GB |
Storage | 45 GB (20 GB for Swap and Linux, 25GB for ASM Disks) |
Recommended Training: Oracle 11gR2 RAC – Quick 2-node RAC Deployment Guide from Arun Kumar.

Create Disk Partitions in Linux
Check the available free space using fdisk.
fdisk –l
Output:
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00035159
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM
Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_gridserver-lv_root: 18.9 GB, 18865979392 bytes
255 heads, 63 sectors/track, 2293 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_gridserver-lv_swap: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
From the above output, we have /dev/sdb is available with 26 GB storage. Now, we will create 6 equal size (i.e. 4GB each) partitions as follows:
fdisk /dev/sdb
Output:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xf5d5e858.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-3263, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3263, default 3263):
Using default value 3263
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-3263, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3263, default 3263): +4G
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (524-3263, default 524):
Using default value 524
Last cylinder, +cylinders or +size{K,M,G} (524-3263, default 3263): +4G
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1047-3263, default 1047):
Using default value 1047
Last cylinder, +cylinders or +size{K,M,G} (1047-3263, default 3263): +4G
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1570-3263, default 1570):
Using default value 1570
Last cylinder, +cylinders or +size{K,M,G} (1570-3263, default 3263): +4G
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (2093-3263, default 2093):
Using default value 2093
Last cylinder, +cylinders or +size{K,M,G} (2093-3263, default 3263): +4G
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (2616-3263, default 2616):
Using default value 2616
Last cylinder, +cylinders or +size{K,M,G} (2616-3263, default 3263): +4G
Command (m for help): p
Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf5d5e858
Device Boot Start End Blocks Id System
/dev/sdb1 1 3263 26210016 5 Extended
/dev/sdb5 1 523 4200934+ 83 Linux
/dev/sdb6 524 1046 4200966 83 Linux
/dev/sdb7 1047 1569 4200966 83 Linux
/dev/sdb8 1570 2092 4200966 83 Linux
/dev/sdb9 2093 2615 4200966 83 Linux
/dev/sdb10 2616 3138 4200966 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Now, we have 6 partitions (4GB each), that we can use for Oracle ASM Storage Disks.
SCUF VALOR PRO Wired Performance Xbox Controller – Customizable Back Paddles, Instant Triggers, Hall Effect Thumbsticks, Audio Controls, Xbox Series X|S, Xbox One, Windows PC – Black
$109.99 (as of June 30, 2025 19:50 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Install ASMLIB on CentOS 7
The Oracle ASMLIB kernel driver is now included in the UEK (Unbreakable Enterprise Kernel). No driver package needs to be installed when using this kernel. The oracleasm-support and oracleasmlib packages still need to be installed from ULN (Unbreakable Linux Network).
While the driver and support tools are on the Oracle Linux installation media, the oracleasmlib RPM is not (this package allows Oracle to access the kernel driver).
This package is only available on ULN. Subscribers to ULN can use yum or up2date to download and install the package on their servers. Non-subscribers are free to use the similar package built for RHEL (Red Hat Enterprise Linux) on their Oracle Linux machines.
Good News is that oracleasm kernel driver is also available from the RHEL and CentOS yum repositories. Since, our OS is CentOS 6.3, therefore, I can easily install it using yum.
Check if oracleasm module is available for your Linux distro as follows:
yum search oracleasm
Output:
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: centos.mirror.net.in
* extras: centos.mirror.net.in
* updates: centos.mirror.net.in
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
==================== N/S Matched: oracleasm==========================
kmod-oracleasm.x86_64 : oracleasm kernel module(s)
Name and summary matches only, use “search all” for everything.
Install ASMLIB on CentOS 7 now.
yum install oracleasm
Once, Kernel is updated, download and install latest versions of oracleasm-support and oracleasmlib from Oracle website.
cd
wget http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpm
wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
We have successfully install ASMLIB on CentOS 7.
Create OS Users and Roles
Create following OS users and groups as required by Oracle Grid Infrastructure 12c.
groupadd -g 601 oinstall
groupadd -g 602 dba
groupadd -g 603 oper
groupadd -g 604 asmadmin
groupadd -g 605 asmoper
groupadd -g 606 asmdba
useradd -u 601 -g oinstall -G asmadmin,asmdba,asmoper grid
passwd grid
300 Pcs Stickers for Kids, Cute Water Bottle Vinyl Waterproof Laptop Stickers for Students Gifts School Supplies Classroom Teacher Prizes Sticker Pack for Kids Girls Teens
$6.99 (as of June 30, 2025 20:05 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Configure Oracle ASM Library Driver
Configure Oracle ASM Library Driver as follows:
oracleasm configure -i
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 <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
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
Beware that, if you omit the user and group in the above configuration then it will be set to default user root and default group root, and it creates problem while detecting candidate disks during grid infrastructure installation.
oracleasm init
Output:
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
Create ASM Disks
ASMLIB does not support SELINUX, therefore we must disable the SELINUX before move on.
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config && cat /etc/selinux/config
Output:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Create ASM disks, I will create 3 disks for oradata and 3 disks for recovery_area.
oracleasm createdisk ASM_DATA1 /dev/sdb5
oracleasm createdisk ASM_DATA2 /dev/sdb6
oracleasm createdisk ASM_DATA3 /dev/sdb7
oracleasm createdisk ASM_FRA1 /dev/sdb8
oracleasm createdisk ASM_FRA2 /dev/sdb9
oracleasm createdisk ASM_FRA3 /dev/sdb10
If you are installing Oracle Grid Infrastructure for a cluster and the disks are located at a shared storage that are already marked by another node in RAC then these disks can only be scanned by following command after setup iScsi Initiator.
oracleasm scandisks
ASMLIB has been installed and ASM disks have been created. We can install Oracle Grid Infrastructure 12c on the Server.
Read Also: Install Oracle Grid Infrastructure 12c as Stand Alone Server
The Linux Command Line, 3rd Edition: A Complete Introduction
$34.99 (as of June 30, 2025 20:24 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Final Thoughts
Installing ASMLIB on CentOS 7 is a crucial step for simplifying Oracle ASM (Automatic Storage Management) setup and management on your system. By following this guide, you can ensure a smooth installation process and improve your database management efficiency.
Struggling with Linux server management? I offer professional support to ensure your servers are secure, optimized, and always available. Visit my Fiverr profile to learn more!
Leave a Reply
You must be logged in to post a comment.