Saturday, May 10, 2014

How to stamp Disks for ASM using ASMLib Package

#########################################################
How to stamp Disks for ASM using ASMLib Package
#########################################################

Note: I have added 10 1GB SCSI disks in my database host, will stamp them as ASM DISKS:


===============================
Step 1. Add Hard Disk(s)
===============================
[root@dbtrmrk ~]# ls -ltr /dev/sd*
brw-rw---- 1 root disk 8, 128 May  4 01:09 /dev/sdi
brw-rw---- 1 root disk 8,  64 May  4 01:09 /dev/sde
brw-rw---- 1 root disk 8, 112 May  4 01:09 /dev/sdh
brw-rw---- 1 root disk 8,  96 May  4 01:09 /dev/sdg
brw-rw---- 1 root disk 8,  80 May  4 01:09 /dev/sdf
brw-rw---- 1 root disk 8,  32 May  4 01:09 /dev/sdc
brw-rw---- 1 root disk 8,  16 May  4 01:09 /dev/sdb
brw-rw---- 1 root disk 8, 144 May  4 01:09 /dev/sdj
brw-rw---- 1 root disk 8, 160 May  4 01:09 /dev/sdk
brw-rw---- 1 root disk 8,  48 May  4 01:09 /dev/sdd
brw-rw---- 1 root disk 8,   0 May  4 01:09 /dev/sda
brw-rw---- 1 root disk 8,   2 May  4 01:09 /dev/sda2
brw-rw---- 1 root disk 8,   1 May  4 01:09 /dev/sda1


Note: Hard Disks b-k has been added


===============================
Step 2. Format Hard Disk(s)
===============================
-----------------------------------------------------------------------------------
[root@dbtrmrk ~]# 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 0x88c10643.
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-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130

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

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

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
----------------------------------------------------------------------------------------
[root@dbtrmrk ~]# 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 0x3945f228.
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-130, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
----------------------------------------------------------------------------------------
[root@dbtrmrk ~]# ls -ltr /dev/sd*
brw-rw---- 1 root disk 8,   0 May  4 01:09 /dev/sda
brw-rw---- 1 root disk 8,   2 May  4 01:09 /dev/sda2
brw-rw---- 1 root disk 8,   1 May  4 01:09 /dev/sda1
brw-rw---- 1 root disk 8,  16 May  4 01:14 /dev/sdb
brw-rw---- 1 root disk 8,  17 May  4 01:14 /dev/sdb1
brw-rw---- 1 root disk 8,  32 May  4 01:15 /dev/sdc
brw-rw---- 1 root disk 8,  33 May  4 01:15 /dev/sdc1
brw-rw---- 1 root disk 8,  49 May  4 01:15 /dev/sdd1
brw-rw---- 1 root disk 8,  48 May  4 01:15 /dev/sdd
brw-rw---- 1 root disk 8,  65 May  4 01:16 /dev/sde1
brw-rw---- 1 root disk 8,  64 May  4 01:16 /dev/sde
brw-rw---- 1 root disk 8,  81 May  4 01:16 /dev/sdf1
brw-rw---- 1 root disk 8,  80 May  4 01:16 /dev/sdf
brw-rw---- 1 root disk 8,  97 May  4 01:16 /dev/sdg1
brw-rw---- 1 root disk 8,  96 May  4 01:16 /dev/sdg
brw-rw---- 1 root disk 8, 113 May  4 01:17 /dev/sdh1
brw-rw---- 1 root disk 8, 112 May  4 01:17 /dev/sdh
brw-rw---- 1 root disk 8, 129 May  4 01:17 /dev/sdi1
brw-rw---- 1 root disk 8, 128 May  4 01:17 /dev/sdi
brw-rw---- 1 root disk 8, 145 May  4 01:17 /dev/sdj1
brw-rw---- 1 root disk 8, 144 May  4 01:17 /dev/sdj
brw-rw---- 1 root disk 8, 161 May  4 01:17 /dev/sdk1
brw-rw---- 1 root disk 8, 160 May  4 01:17 /dev/sdk


=======================================================
Step 3. Verify ASM Module has been loaded into Kernerl
=======================================================
[root@dbtrmrk ~]# df -ha | grep oracleasm
oracleasmfs              0     0     0   -  /dev/oracleasm

[root@dbtrmrk ~]# /sbin/lsmod | grep oracleasm
oracleasm              53865  1




======================================
Step 4. Create ASM Disks
======================================
[root@dbtrmrk ~]# oracleasm listdisks

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

[root@dbtrmrk ~]# oracleasm createdisk ASM2 /dev/sdc1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM3 /dev/sdd1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM4 /dev/sde1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM5 /dev/sdf1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM6 /dev/sdg1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM7 /dev/sdh1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM8 /dev/sdi1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM9 /dev/sdj1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm createdisk ASM10 /dev/sdk1
Writing disk header: done
Instantiating disk: done

[root@dbtrmrk ~]# oracleasm listdisks
ASM1
ASM2
ASM3
ASM4
ASM5
ASM6
ASM7
ASM8
ASM9
ASM10



=========================================
Step 5. Verify ASM Disks
=========================================
[root@dbtrmrk ~]# oracleasm querydisk ASM1
Disk "ASM1" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM2
Disk "ASM2" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM3
Disk "ASM3" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM4
Disk "ASM4" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM5
Disk "ASM5" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM6
Disk "ASM6" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM7
Disk "ASM7" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM8
Disk "ASM8" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM9
Disk "ASM9" is a valid ASM disk

[root@dbtrmrk ~]#  oracleasm querydisk ASM10
Disk "ASM10" is a valid ASM disk


[root@dbtrmrk ~]# ls -ltr /dev/oracleasm/disks
total 0
brw-rw---- 1 oracle oinstall 8,  17 May  4 01:20 ASM1
brw-rw---- 1 oracle oinstall 8,  33 May  4 01:20 ASM2
brw-rw---- 1 oracle oinstall 8,  49 May  4 01:21 ASM3
brw-rw---- 1 oracle oinstall 8,  65 May  4 01:21 ASM4
brw-rw---- 1 oracle oinstall 8,  81 May  4 01:21 ASM5
brw-rw---- 1 oracle oinstall 8,  97 May  4 01:21 ASM6
brw-rw---- 1 oracle oinstall 8, 113 May  4 01:21 ASM7
brw-rw---- 1 oracle oinstall 8, 129 May  4 01:21 ASM8
brw-rw---- 1 oracle oinstall 8, 145 May  4 01:21 ASM9
brw-rw---- 1 oracle oinstall 8, 161 May  4 01:22 ASM10

Enjoy......Abid Malik

No comments:

Post a Comment