ASMlib useful commands - denis-kol4ev/OraDBA GitHub Wiki

Command Description
# oracleasm querydisk /dev/sdh1 verify ASM disk label by path
# oracleasm querydisk FRA1 verify ASM disk label by name
# oracleasm listdisks | xargs oracleasm querydisk -p find which asm disk maps to which linux partition
# oracleasm listdisks list ASM disks
# oracleasm scandisks scan the system for Oracle ASMLib disks
# oracleasm status display the status of the Oracle ASMLib driver
# oracleasm deletedisk -v DATA02 return a device to the operating system using device name
# oracleasm deletedisk -v /dev/oracleasm/disks/FRA01 return a device to the operating system using path

Print disks labels and sizes for specific group

export GRP_NAME=FRA
for i in $(find /dev/oracleasm/disks/ -name "${GRP_NAME}*" -printf "%f\n" | sort | xargs sudo oracleasm querydisk -p | grep "/dev/mapper" | awk '{ gsub(/:/, ""); print $1}'); do lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINT $i; done