Total Pageviews

Friday 26 December 2014

Create Shareable ASM disks on Oracle virtual box

Create 3 shared disks for ASM:
========================

Power off both node1 and node2 .

Add 3 new disks on node1 and make them shareable . After that add these disks to node2 also .

Settings->storage->Controller:SATA-Add disk -> Create new disk




Hard Drive file type = VDI



Storage on physical hard drive = Fixed sized




File Location and Size : H:\ASM_SHARED_DISK\asm_disk_1.vdi

Similarly create 2 mode asm diks "asm_disk_2.vdi" and "asm_disk_3.vdi" screenshots below:






Storage : After Adding 3 asm_disks.



Now we need to make these asm disks sharable. Open Virtual Media Manager -

Select asm_disk_1 -> Click on Modify ->



Select asm_disk_1 -> Click on Modify -> Shareable -> ok



 Repeat the above for other 2 disks:

Select asm_disk_2  -> Click on Modify -> Shareable -> ok
Select asm_disk_3 -> Click on Modify -> Shareable -> ok

Attach these shareable "ask_disks_*"  existing disk to node2 VM using "Storage" page. Don't forget to select correct controller before attaching the disk and use "Choose existing disk" option.

on node 2 add shareable disks screenshot below:

Settings->storage->Controller:SATA->Add disks ->choose existing diks





[root@node1 ~]# 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 0x81d9944a.
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-281, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-281, default 281):
Using default value 281

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

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


[root@node1 ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xdd8c70c4.
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-535, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-535, default 535):
Using default value 535

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]#
[root@node1 ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x104efb19.
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-522, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-522, default 522):
Using default value 522

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

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


Check Permission of disks :

[root@oracle11g ~]# ls -lrth /dev/sd*
brw-rw---- 1 root disk 8,  0 Jan 11 12:25 /dev/sda
brw-rw---- 1 root disk 8,  2 Jan 11 12:25 /dev/sda2
brw-rw---- 1 root disk 8,  1 Jan 11 12:25 /dev/sda1
brw-rw---- 1 root disk 8, 48 Jan 11 18:12 /dev/sdd
brw-rw---- 1 root disk 8, 16 Jan 11 18:12 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jan 11 18:12 /dev/sdc
brw-rw---- 1 root disk 8, 49 Jan 11 18:12 /dev/sdd1
brw-rw---- 1 root disk 8, 17 Jan 11 18:12 /dev/sdb1
brw-rw---- 1 root disk 8, 33 Jan 11 18:12 /dev/sdc1
[root@oracle11g ~]#
[root@oracle11g ~]# fdisk -l

Disk /dev/sda: 25.8 GB, 25769803776 bytes
255 heads, 63 sectors/track, 3133 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: 0x000beb7a

   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        3134    24652800   8e  Linux LVM

Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 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: 0xe961556e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         391     3140676   83  Linux

Disk /dev/sdc: 5754 MB, 5754306560 bytes
255 heads, 63 sectors/track, 699 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: 0x12fdc659

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         699     5614686   83  Linux

Disk /dev/sdd: 5754 MB, 5754306560 bytes
255 heads, 63 sectors/track, 699 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: 0xeeb628c4

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         699     5614686   83  Linux

Disk /dev/mapper/vg_sumit-lv_root: 23.7 GB, 23668457472 bytes
255 heads, 63 sectors/track, 2877 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_sumit-lv_swap: 1572 MB, 1572864000 bytes
255 heads, 63 sectors/track, 191 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


[root@node1 ~]# oracleasm createdisk ocr_vote /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@node1 ~]# oracleasm createdisk DATA /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@node1 ~]# oracleasm createdisk FRA /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@node1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@node1 ~]# oracleasm listdisks
DATA
FRA
OCR_VOTE
[root@node1 ~]#


on node 2:
root@node2's password:
[root@node2 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "OCR_VOTE"
Instantiating disk "DATA"
Instantiating disk "FRA"
[root@node2 ~]# oracleasm listdisks
DATA
FRA
OCR_VOTE
[root@node2 ~]#


No comments:

Post a Comment