The below script will find the device and associated mapping device.
#!/bin/bash
ORACLEASM=/usr/sbin/oracleasm
echo "ASM Disk Mappings"
echo "----------------------------------------------------"
for f in `$ORACLEASM listdisks`
do
dp=`$ORACLEASM querydisk -p $f | head -2 | grep /dev | awk -F: '{print $1}'`
echo "$f: $dp"
done
Sample Output.
ASM Disk Mappings
----------------------------------------------------
test3_DATA: /dev/sdh1
test3_DATA_02: /dev/sdj1
test3_FRA: /dev/sdi1
test2_DATA_01: /dev/sdn1
test4_VOTE_01: /dev/sdm1
test4_VOTE_02: /dev/sdl1
test4_VOTE_03: /dev/sdo1
test1_DATA: /dev/sdc1
test1_DATA_02: /dev/sdp1
test1_FRA: /dev/sdd1
[oracle@testmachine:+ASM]
#!/bin/bash
ORACLEASM=/usr/sbin/oracleasm
echo "ASM Disk Mappings"
echo "----------------------------------------------------"
for f in `$ORACLEASM listdisks`
do
dp=`$ORACLEASM querydisk -p $f | head -2 | grep /dev | awk -F: '{print $1}'`
echo "$f: $dp"
done
Sample Output.
ASM Disk Mappings
----------------------------------------------------
test3_DATA: /dev/sdh1
test3_DATA_02: /dev/sdj1
test3_FRA: /dev/sdi1
test2_DATA_01: /dev/sdn1
test4_VOTE_01: /dev/sdm1
test4_VOTE_02: /dev/sdl1
test4_VOTE_03: /dev/sdo1
test1_DATA: /dev/sdc1
test1_DATA_02: /dev/sdp1
test1_FRA: /dev/sdd1
[oracle@testmachine:+ASM]