In this post, we are going to setup and configure our ASM disks.


Create Shared Disks

  • Shut down the 1st VM (racnode1).
  • Got to VM settings.
  • Storage
  • Click the green plus icon to add a Hard Disk.
























  • To make this new disk shareable:-
·         Go to File => Virtual Media Manager.
·         Select the newly created disk and click on Modify tab.
·         Choose the Shareable mode and then Click OK.






  • Now Start the 2nd VM (racnode2) and proceed as below:-
 Follow above steps for node 2.
  • Got to VM settings.
  • Storage
  • Click the green plus icon to add a Hard Disk.
  •  Now in next Step, choose “Choose existing disk” tab.
  • Browse to the location of the newly created disk and select the shared disk.
  • Press OK and you should have your shared disks visible to both the nodes.






















  • a) Login as root on racnode1.
  • b) And then execute following command to configure asm:-
[root@racnode1 ~]# 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 []: 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

 Run the following command to initialize the asm

[root@racnode1 ~]# oracleasm init
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

Verify the shared disk /dev/sdb exist on both nodes using below command:-

[root@racnode1 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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

Run all the above on the RAC2 node as well


  • On node1 (racnode1) execute the following command to create partition:-
[root@racnode1 ~]#  fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x9812676d.
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)
p
Partition number (1-4): 1
First cylinder (1-1566, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1566, default 1566):
Using default value 1566

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

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

Note: The sequence for creating above partition is “n”, “p”, “1”, “Return”, “Return” and “w”.

Verify the new partition /dev/sdb1 on both the nodes using the below command:-

[root@racnode1 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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: 0x9812676d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1566    12578863+  83  Linux

Run oracleasm to createdisk on node1 (racnode1)

oracleasm createdisk ADISK1 /dev/sdb1
[root@racnode1 ~]# oracleasm createdisk ADISK1 /dev/sdb1
Writing disk header: done
Instantiating disk: done


[root@racnode1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@racnode1 ~]# oracleasm listdisks
ADISK1

Run scan/list disks on node 2 as well

[root@racnode2 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ADISK1"
[root@racnode2 ~]# oracleasm listdisks
ADISK1