Wednesday, August 21, 2019

How to add a new disk to ASM Diskgroup

How to add a new disk to ASM Diskgroup 



[root@rac10 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 12446.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
Partition 1 is already defined.  Delete it before re-adding it.

Command (m for help): ^C
[root@rac10 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 12446.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
3
Invalid partition number for type `3'
Command action
   e   extended
   p   primary partition (1-4)
^C
[root@rac10 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 12446.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (4866-12446, default 4866):
Using default value 4866
Last cylinder or +size or +sizeM or +sizeK (4866-12446, default 12446): +15g

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@rac10 ~]#
[root@rac10 ~]#
[root@rac10 ~]#
[root@rac10 ~]#
[root@rac10 ~]# oracleasm exit
Unmounting ASMlib driver filesystem: failed
Unable to unmount ASMlib driver filesystem
[root@rac10 ~]# oracleasm init
[root@rac10 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac10 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac10 ~]# oracleasm listdisks
DATAQ
OCRVD
[root@rac10 ~]# fdisk -l

Disk /dev/sda: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3187    25599546   83  Linux
/dev/sda2            3188        4717    12289725   83  Linux
/dev/sda3            4718        5737     8193150   82  Linux swap / Solaris
/dev/sda4            5738       13054    58773802+   5  Extended
/dev/sda5            5738       13054    58773771   83  Linux

Disk /dev/sdb: 102.3 GB, 102374572032 bytes
255 heads, 63 sectors/track, 12446 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   83  Linux
/dev/sdb2            1218        4865    29302560   83  Linux
/dev/sdb3            4866        6690    14659312+  83  Linux

[root@rac10 ~]# oracleasm createdisk FRA /dev/sdb3  ------ only on one node
Writing disk header: done
Instantiating disk: done

Below steps on all nodes:

[root@rac10 ~]# oracleasm exit
Unmounting ASMlib driver filesystem: failed
Unable to unmount ASMlib driver filesystem
[root@rac10 ~]# oracleasm init
[root@rac10 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac10 ~]# oracleasm listdisks
DATAQ
FRA
OCRVD

[root@rac10 ~]# cat /proc/partitions

major minor  #blocks  name

   8        0  104857600 sda
   8        1   25599546 sda1
   8        2   12289725 sda2
   8        3    8193150 sda3
   8        4          1 sda4
   8        5   58773771 sda5
   8       16   99975168 sdb
   8       17    9775521 sdb1
   8       18   29302560 sdb2
   8       19   14659312 sdb3

[oracle@rac10 ~]$ export ORACLE_SID=+ASM1
[oracle@rac10 ~]$ asmca








No comments:

Post a Comment