Home > ASM (Automatic Storage Management) > Configuring Oracle ASM Disks

Configuring Oracle ASM Disks

Hi Friends,

In this article, I will write about configuring Oracle ASM disks with ASMLib. To use a disk for ASM, you must create partition and stamp the disks as ASM disks. Let’s look at an example scenario with on;

We have three disks (sdb,sdc and sdd) under /dev directory. First we need to create one partition on all disks. Run Fdisk command to create partition on sdb with “root” user. Fdisk will ask us some questions. We need to give answer to these questions as written bold font.
1- First let’s create one partition on all disks.

# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1): [ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): [ENTER]
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Do these operations in the same way on the sdc and sdd discs.

# fdisk /dev/sdc
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1): [ ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): [ENTER]
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk /dev/sdd
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1): [ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): [ENTER]
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now let’s chek our partitions.

# ls -ltrh /dev/sd*
 

2- Change owner of partition to user “oracle” and group “oinstall”. Give write permission to disks.


# chown oracle:oinstall /dev/sdb1
# chown oracle:oinstall /dev/sdc1
# chown oracle:oinstall /dev/sdd1
# chmod 600 /dev/sdb1
# chmod 600 /dev/sdc1
# chmod 600 /dev/sdd1

Also write these lines to rc.local file to apply on reboot process.

# vi /etc/rc.local


chown oracle:oinstall /dev/sdb1
chown oracle:oinstall /dev/sdc1
chown oracle:oinstall /dev/sdd1
chmod 600 /dev/sdb1
chmod 600 /dev/sdc1
chmod 600 /dev/sdd1

3- There are ASM libraries to stamp disks as ASM. These are distributed on your Linux kernel version. You can learn kernel version with following command.

# uname -r

And also check OS

# cat /etc/issue

You can download these library rpm packages via http://www.oracle.com/technology/software/tech/linux/asmlib/index.html 

And install these rpms (oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm , oracleasmlib-2.0.4-1.el5.i386.rpm and oracleasm-support-2.1.4-1.el5.i386.rpm);

# rpm -ivh oracleasm*

It will install 3 rpm packages which starts with oracleasm

4-  Configure the kernel module for ASM.

# service oracleasm configure

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 <ENTER> 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 ]

5- Now we can label the disks as ASM disks.

[root@DBTALIP dev]# service oracleasm createdisk DATA1 /dev/sdb1
Marking disk “DATA1” as an ASM disk: [ OK ]
[root@DBTALIP dev]# service oracleasm createdisk DATA2 /dev/sdc1
Marking disk “DATA2” as an ASM disk: [ OK ]
[root@DBTALIP dev]# service oracleasm createdisk FRA /dev/sdd1
Marking disk “FRA” as an ASM disk: [ OK ]

We can list our ASM disks. let’s check our disks;

# service oracleasm listdisks

DATA1

DATA2

FRA

 

Talip Hakan Öztürk

  1. May 8, 2013 at 8:32 am

    Hey
    i get an error while i do the “/etc/init.d/oracleasm configure”

    the error is:

    initializing the oracle asmlib driver [FAILED]

    why is it so?

    • September 29, 2014 at 10:10 am

      Hi,

      Did you installed asmlib rpm packages?
      install these rpms (oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm , oracleasmlib-2.0.4-1.el5.i386.rpm and oracleasm-support-2.1.4-1.el5.i386.rpm)
      note: before installation check your kernel version. And download with correct kernel version

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: