Define block device of an ASM disk
-
26-02-2021 - |
Question
I have a bunch of asmdisks:
/dev/oracleasm/disks/DATA01
/dev/oracleasm/disks/DATA02
..
/dev/oracleasm/disks/DATA07
Probably, they were created as:
oracleasm createdisk DATA01 /dev/sda1
oracleasm createdisk DATA01 /dev/sda2
But I'm not sure.
How to define relied block device for created ASM disk? How to be sure that DATA01 is made of /dev/sda1?
Solution
Newer versions of ASMLib
support oracleasm querydisk -p DATA01
which displays the underlying physicaldisk.
Example:
# oracleasm querydisk -p SSDDATA1
Disk "SSDDATA1" is a valid ASM disk
/dev/sdl1: LABEL="SSDDATA1" TYPE="oracleasm"
/dev/sdar1: LABEL="SSDDATA1" TYPE="oracleasm"
/dev/sdbn1: LABEL="SSDDATA1" TYPE="oracleasm"
/dev/sddf1: LABEL="SSDDATA1" TYPE="oracleasm"
/dev/mapper/mpathqp1: LABEL="SSDDATA1" TYPE="oracleasm"
#
Older versions may not have the -p
option and they display only the major and minor numbers which you can use to find the physical disk:
Mapping ASM disks to Physical Devices
Example:
[root@orcldb2 ~]# /etc/init.d/oracleasm querydisk VOL1
Disk "VOL1" is a valid ASM disk on device [8, 97]
[root@orcldb2 ~]# ls -l /dev | grep 8, | grep 97
brw-rw---- 1 root disk 8, 81 Nov 4 13:02 sdg1
This example I copied from the above blog post seems to be not totally accurate (grep 97
returns minor number 81?), the concept however works.