Thursday, February 2, 2012

Script to show device mappings for ASMLib disks

I really like this wee script for showing mapping:

/etc/init.d/oracleasm querydisk -d `/etc/init.d/oracleasm listdisks -d` |
cut -f2,10,11 -d" " | perl -pe 's/"(.*)".*\[(.*), *(.*)\]/$1 $2 $3/g;' |
while read v_asmdisk v_minor v_major
v_device=`ls -la /dev | grep " $v_minor, *$v_major " | awk '{print $10}'`
echo "ASM disk $v_asmdisk based on /dev/$v_device [$v_minor, $v_major]"

Taken from Ronny Egner's blog

He found it somewhere on the web and updated for modern ASM versions.

Output looks like:

ASM disk ORA_FPF_12GB_EMCP004 based on /dev/emcpowera1 [120, 1]
ASM disk ORA_FPF_12GB_EMCP005 based on /dev/emcpowerb1 [120, 17]
ASM disk ORA_FPF_12GB_EMCP006 based on /dev/emcpoweraf1 [120, 497]
ASM disk ORA_FPF_12GB_EMCP007 based on /dev/emcpoweras1 [120, 705]

Another great post with useful scripts by Bane Radulović - Senior Principle Support Engineer at Oracle Support in Melbourne:
ASM Support Guy ™: How to map an ASMLIB disk to a device name


  1. It's very great to see your post!I like it .I'm looking forward to you in the next post.Thank you .There is a dell recovery software to you.

  2. I like this blog! In return, I want to share some cheap ray ban sunglasses with you.