facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Home » , , , , , , » How to identify the physical disk bound to the ASMLIB disk?

How to identify the physical disk bound to the ASMLIB disk?

Written By askMLabs on Friday, September 24, 2010 | 6:13 PM

We will create ASM disks with oracleasm and we can list the ASM disks using the listdisks option.
While creating the ASM disk we will supply the physical disk path, as
[root@dhcppc1 rpms]# /etc/init.d/oracleasm createdisk ASK_DISK1 /dev/sdc1
Marking disk "ASK_DISK1" as an ASM disk:                   [  OK  ]
[root@dhcppc1 rpms]#

Once after creating the ASM disks, there is no direct command which actually lists the mapping between ASM disks and physical disks.

If you check the syntax,
[root@dhcppc1 rpms]# /etc/init.d/oracleasm -h
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# /etc/init.d/oracleasm listdisks
CRSVOL1
DATAVOL1
FRAVOL1
[root@dhcppc1 rpms]# /etc/init.d/oracleasm querydisk
Usage: oracleasm-querydisk [-l <manager>] [-v] [-d|-p] <label>|<device> ...
[root@dhcppc1 rpms]# /etc/init.d/oracleasm querydisk CRSVOL1
Disk "CRSVOL1" is a valid ASM disk
[root@dhcppc1 rpms]#


So there is no option from oracleasm executable to check how ASM_DISK1 is linked to /dev/sdc1.

We will try the SQL Commands ..
SQL> select name from v$asm_diskgroup;

NAME
------------------------------
CRS
FRA
RACDB_DATA

SQL> select name,path,label from v$asm_disk;

NAME            PATH                                LABEL
--------------- ----------------------------------- ---------------
CRS_0000        /dev/oracleasm/disks/CRSVOL1
FRA_0000        /dev/oracleasm/disks/FRAVOL1
RACDB_DATA_0000 /dev/oracleasm/disks/DATAVOL1

SQL>


Then how do we find, Which Disks Are Handled by ASMLib Kernel Driver?

There are two ways to identify the physical disk bound to the ASMLIB disk

1.
[root@dhcppc1 rpms]# find /dev -type b -exec '/etc/init.d/oracleasm' 'querydisk' '{}' ';' 2>/dev/null | grep "is marked an ASM disk"
Device "/dev/oracleasm/disks/CRSVOL1" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/oracleasm/disks/FRAVOL1" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/oracleasm/disks/DATAVOL1" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/dm-9" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/dm-11" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/dm-10" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdc" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdd" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sde" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdf" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdg" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdh" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdi" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdj" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdk" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdl" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdm" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdn" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdo" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdp" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdq" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdr" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sds" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdt" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdu" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdv" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdw" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdx" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdy" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdz" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/mapper/vpath2" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/mapper/vpath1" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/mapper/vpath0" is marked an ASM disk with the label "DATAVOL1"
[root@dhcppc1 rpms]#

2.
[root@dhcppc1 rpms]# blkid|grep sd.*oracleasm|while read a b;do echo -n $a$b" scsi_id=";(echo $a|tr -d [:digit:]|tr -d [:]|cut -d"/" -f3|xargs -i scsi_id -g -s /block/{})done;
/dev/sdc:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdd:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sde:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdf:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdg:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdh:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdi:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdj:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdk:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdl:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdm:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdn:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdo:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdp:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdq:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdr:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sds:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdt:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdu:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdv:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdw:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdx:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdy:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# multipath -ll
vpath2 (360050768019600fba80000000000036d) dm-11 IBM,2145
[size=10G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:6:2 sdk 8:160  [active][ready]
\_ 1:0:7:2 sdn 8:208  [active][ready]
\_ 2:0:6:2 sdw 65:96  [active][ready]
\_ 2:0:7:2 sdz 65:144 [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:4:2 sde 8:64   [active][ready]
\_ 1:0:5:2 sdh 8:112  [active][ready]
\_ 2:0:4:2 sdq 65:0   [active][ready]
\_ 2:0:5:2 sdt 65:48  [active][ready]
vpath1 (360050768019600fba80000000000036c) dm-10 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:4:1 sdd 8:48   [active][ready]
\_ 1:0:5:1 sdg 8:96   [active][ready]
\_ 2:0:4:1 sdp 8:240  [active][ready]
\_ 2:0:5:1 sds 65:32  [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:6:1 sdj 8:144  [active][ready]
\_ 1:0:7:1 sdm 8:192  [active][ready]
\_ 2:0:6:1 sdv 65:80  [active][ready]
\_ 2:0:7:1 sdy 65:128 [active][ready]
vpath0 (360050768019600fba80000000000036b) dm-9 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:6:0 sdi 8:128  [active][ready]
\_ 1:0:7:0 sdl 8:176  [active][ready]
\_ 2:0:6:0 sdu 65:64  [active][ready]
\_ 2:0:7:0 sdx 65:112 [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:4:0 sdc 8:32   [active][ready]
\_ 1:0:5:0 sdf 8:80   [active][ready]
\_ 2:0:4:0 sdo 8:224  [active][ready]
\_ 2:0:5:0 sdr 65:16  [active][ready]
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# ls -lrt /dev/mapper/vpath*
brw-rw---- 1 root disk 253, 11 Jul  9 12:49 /dev/mapper/vpath2
brw-rw---- 1 root disk 253, 10 Jul  9 12:49 /dev/mapper/vpath1
brw-rw---- 1 root disk 253,  9 Jul  9 12:49 /dev/mapper/vpath0
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# find /dev/oracleasm/disks -type b | xargs -i sh -c "echo {}; dd if={} count=100 2>/dev/null | strings"
/dev/oracleasm/disks/CRSVOL1
ORCLDISKCRSVOL1
CRS_0000
CRS_0000
/dev/oracleasm/disks/FRAVOL1
ORCLDISKFRAVOL1
FRA_0000
FRA_0000
/dev/oracleasm/disks/DATAVOL1
ORCLDISKDATAVOL1
RACDB_DATA_0000
RACDB_DATA
RACDB_DATA_0000
[root@dhcppc1 rpms]#


Hope it helps

SRI


How to identify the physical disk bound to the ASMLIB disk?

We will create ASM disks with oracleasm and we can list the ASM disks using the listdisks option.
While creating the ASM disk we will supply the physical disk path, as

[root@dhcppc1 rpms]# /etc/init.d/oracleasm createdisk ASK_DISK1 /dev/sdc1
Marking disk "ASK_DISK1" as an ASM disk:                   [  OK  ]
[root@dhcppc1 rpms]#

Once after creating the ASM disks, there is no direct command which actually lists the mapping between ASM disks and physical disks.

If you check the syntax,
[root@dhcppc1 rpms]# /etc/init.d/oracleasm -h
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# /etc/init.d/oracleasm listdisks
CRSVOL1
DATAVOL1
FRAVOL1
[root@dhcppc1 rpms]# /etc/init.d/oracleasm querydisk
Usage: oracleasm-querydisk [-l <manager>] [-v] [-d|-p] <label>|<device> ...
[root@dhcppc1 rpms]# /etc/init.d/oracleasm querydisk CRSVOL1
Disk "CRSVOL1" is a valid ASM disk
[root@dhcppc1 rpms]#

So there is no option from oracleasm executable to check how ASM_DISK1 is linked to /dev/sdc1.

We will try the SQL Commands ..

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
CRS
FRA
RACDB_DATA

SQL> select name,path,label from v$asm_disk;

NAME            PATH                                LABEL
--------------- ----------------------------------- ---------------
CRS_0000        /dev/oracleasm/disks/CRSVOL1
FRA_0000        /dev/oracleasm/disks/FRAVOL1
RACDB_DATA_0000 /dev/oracleasm/disks/DATAVOL1

SQL>

Then how do we find, Which Disks Are Handled by ASMLib Kernel Driver?

There are two ways to identify the physical disk bound to the ASMLIB disk

[root@dhcppc1 rpms]# find /dev -type b -exec '/etc/init.d/oracleasm' 'querydisk' '{}' ';' 2>/dev/null | grep "is marked an ASM disk"
Device "/dev/oracleasm/disks/CRSVOL1" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/oracleasm/disks/FRAVOL1" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/oracleasm/disks/DATAVOL1" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/dm-9" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/dm-11" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/dm-10" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdc" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdd" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sde" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdf" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdg" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdh" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdi" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdj" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdk" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdl" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdm" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdn" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdo" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdp" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdq" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdr" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sds" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdt" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdu" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdv" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdw" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/sdx" is marked an ASM disk with the label "DATAVOL1"
Device "/dev/sdy" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/sdz" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/mapper/vpath2" is marked an ASM disk with the label "CRSVOL1"
Device "/dev/mapper/vpath1" is marked an ASM disk with the label "FRAVOL1"
Device "/dev/mapper/vpath0" is marked an ASM disk with the label "DATAVOL1"
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# blkid|grep sd.*oracleasm|while read a b;do echo -n $a$b" scsi_id=";(echo $a|tr -d [:digit:]|tr -d [:]|cut -d"/" -f3|xargs -i scsi_id -g -s /block/{})done;
/dev/sdc:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdd:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sde:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdf:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdg:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdh:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdi:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdj:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdk:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdl:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdm:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdn:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdo:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdp:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdq:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdr:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sds:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdt:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdu:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdv:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
/dev/sdw:LABEL="CRSVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036d
/dev/sdx:LABEL="DATAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036b
/dev/sdy:LABEL="FRAVOL1" TYPE="oracleasm" scsi_id=360050768019600fba80000000000036c
[root@dhcppc1 rpms]#

[root@dhcppc1 rpms]# multipath -ll
vpath2 (360050768019600fba80000000000036d) dm-11 IBM,2145
[size=10G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:6:2 sdk 8:160  [active][ready]
\_ 1:0:7:2 sdn 8:208  [active][ready]
\_ 2:0:6:2 sdw 65:96  [active][ready]
\_ 2:0:7:2 sdz 65:144 [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:4:2 sde 8:64   [active][ready]
\_ 1:0:5:2 sdh 8:112  [active][ready]
\_ 2:0:4:2 sdq 65:0   [active][ready]
\_ 2:0:5:2 sdt 65:48  [active][ready]
vpath1 (360050768019600fba80000000000036c) dm-10 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:4:1 sdd 8:48   [active][ready]
\_ 1:0:5:1 sdg 8:96   [active][ready]
\_ 2:0:4:1 sdp 8:240  [active][ready]
\_ 2:0:5:1 sds 65:32  [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:6:1 sdj 8:144  [active][ready]
\_ 1:0:7:1 sdm 8:192  [active][ready]
\_ 2:0:6:1 sdv 65:80  [active][ready]
\_ 2:0:7:1 sdy 65:128 [active][ready]
vpath0 (360050768019600fba80000000000036b) dm-9 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=200][active]
\_ 1:0:6:0 sdi 8:128  [active][ready]
\_ 1:0:7:0 sdl 8:176  [active][ready]
\_ 2:0:6:0 sdu 65:64  [active][ready]
\_ 2:0:7:0 sdx 65:112 [active][ready]
\_ round-robin 0 [prio=40][enabled]
\_ 1:0:4:0 sdc 8:32   [active][ready]
\_ 1:0:5:0 sdf 8:80   [active][ready]
\_ 2:0:4:0 sdo 8:224  [active][ready]
\_ 2:0:5:0 sdr 65:16  [active][ready]
[root@dhcppc1 rpms]#

[root@orrcdbtsl01 ~]# ls -lrt /dev/mapper/vpath*
brw-rw---- 1 root disk 253, 11 Jul  9 12:49 /dev/mapper/vpath2
brw-rw---- 1 root disk 253, 10 Jul  9 12:49 /dev/mapper/vpath1
brw-rw---- 1 root disk 253,  9 Jul  9 12:49 /dev/mapper/vpath0
[root@orrcdbtsl01 ~]#

[root@orrcdbtsl01 ~]# find /dev/oracleasm/disks -type b | xargs -i sh -c "echo {}; dd if={} count=100 2>/dev/null | strings"
/dev/oracleasm/disks/CRSVOL1
ORCLDISKCRSVOL1
CRS_0000
CRS_0000
/dev/oracleasm/disks/FRAVOL1
ORCLDISKFRAVOL1
FRA_0000
FRA_0000
/dev/oracleasm/disks/DATAVOL1
ORCLDISKDATAVOL1
RACDB_DATA_0000
RACDB_DATA
RACDB_DATA_0000
[root@orrcdbtsl01 ~]#

Share this article :

Related Articles By Category



Post a Comment

Thank you for visiting our site and leaving your valuable comment.

 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger