Question: How to expand the physical raw disk which is part of ASM diskgroup?
Below are the steps to extend the physical disk which is part of ASM diskgroup.
1. First, you have to unmount the disk you want to extend at the ASM level.
2. Check the disks present at the OS level and their size.
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 12G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 11.5G 0 part ├─ol-root 251:0 0 10.3G 0 lvm / └─ol-swap 251:1 0 1.2G 0 lvm [SWAP] sdb 8:16 0 12G 0 disk sdc 8:32 0 12G 0 disk sdd 8:48 0 12G 0 disk └─sdd1 8:49 0 4.7G 0 part sr0 11:0 1 1024M 0 rom
3. Use parted command along with the disk you want to extend. Example here is /dev/sdd
# parted /dev/sdd GNU Parted 3.1 Using /dev/sdd Welcome to GNU Parted! Type 'help' to view a list of commands.
4. See the current partitions and the partition table. Note down the start and end sectors of the partition.
(parted) print Model: ATA VBOX HARDDISK (scsi) Disk /dev/sdd: 12.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 5000MB 4999MB primary
5. Remove the partition and create new partition with same partition number. You should give the same starting sector as printed before while creating the partition.
(parted) rm 1 (parted) mkpart Partition type? primary/extended? primary File system type? [ext2]? ext4 Start? 2048s End? 10000
6. See the partition table after creating the new partition and exit from parted.
(parted) print Model: ATA VBOX HARDDISK (scsi) Disk /dev/sdd: 12.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 10.0GB 9999MB primary (parted) quit Information: You may need to update /etc/fstab.
7. Now the partition has been extended and you can check the size of the partition as below.
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 12G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 11.5G 0 part ├─ol-root 251:0 0 10.3G 0 lvm / └─ol-swap 251:1 0 1.2G 0 lvm [SWAP] sdb 8:16 0 12G 0 disk sdc 8:32 0 12G 0 disk sdd 8:48 0 12G 0 disk └─sdd1 8:49 0 9.3G 0 part sr0 11:0 1 1024M 0 rom
After extending the disk partition, changes at the ASM level also need to be made by a database administrator or ASM storage administrator with respect to the extended partition.