ASM - Read Disk Headers

In order to confirm whether a disk is part of an ASM diskgroup when the ASM instance is unavailable...

e.g. if ASM has been shut down but you want to be sure of which disks can be removed from the system.

For AIX... Use lspv to list all disks in system.

If all disks have a PVID and a Volume Group associated with them, then it is unlikely they are formatted for ASM.

lspv

hdisk0 00cf3ab32f254ad0 oravg active

hdisk1 none None

hdisk2 none None

hdisk4 00cf3ab3506176e8 orau02vg active

hdisk5 00cf3ab3506ed253 orafravg active

hdisk6 00cf3ab30173c8c3 rootvg active

For Linux... Use lsblk to identify disk that are not part of LVM and do not have a mount point...

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 58G 0 disk

|-sda1 8:1 0 486M 0 part /boot/efi

|-sda2 8:2 0 1.4G 0 part /boot

`-sda3 8:3 0 52.2G 0 part

|-VolGroupSys4-LogVolRoot 249:0 0 35G 0 lvm /

`-VolGroupSys4-LogVolSwap 249:1 0 16G 0 lvm [SWAP]

sdb 8:16 0 64G 0 disk

sdc 8:32 0 64G 0 disk

sdd 8:48 0 64G 0 disk

sde 8:64 0 64G 0 disk

sdf 8:80 0 200G 0 disk /u01

sdg 8:96 0 64G 0 disk

sdh 8:112 0 64G 0 disk

sdi 8:128 0 64G 0 disk

sdj 8:144 0 64G 0 disk

asm!commonstore-392 248:200705 0 5G 0 disk /opt/oracle/dcs/commonstore

Use ls -alF to check for hard links (as for AIX above), soft links and device ownership for further clues...

ls -alF /dev/hdisk2

brw------- Â Â 1 root system 13, 3 04 Jul 13:58 /dev/hdisk2

ls -alF /dev | grep "13, 3"

brw------- Â Â 1 root system 13, 3 04 Jul 13:58 hdisk2

crw-rw---- Â Â 1 asm oinstall 13, 3 04 Jul 13:58 oraasm2

crw------- Â Â 1 root system 13, 3 04 Jul 13:58 rhdisk2

The output above shows that /dev/hdisk2 has a hard link called /dev/orasam2 which is is owned by 'asm'

ls -alF /dev/sdj

brw-rw---- 1 grid asmadmin 8, 144 Dec 20 09:05 /dev/sdj

ls -alF /dev | grep sdj

lrwxrwxrwx 1 root root 3 Dec 20 09:05 DATADISK3 -> sdj

brw-rw---- 1 grid asmadmin 8, 144 Dec 20 09:05 sdj

The output above confirms that the device is owner by asmadmin and a soft link is in place (so sdj is also known as DATADISK3

Assuming the ASM software has not been deinstalled... Log in as the ASM owner (e.g. ;asm' or 'grid')...

kfed read /dev/oraasm2 | egrep "kfdhdb.dskname|kfdhdb.grpname|kfdhdb.fgname|kfdhdb.dsksize"

kfdhdb.dskname: ORARECO_0000 ; 0x028: length=12

kfdhdb.grpname: ORARECO ; 0x048: length=7

kfdhdb.fgname: ORARECO_0000 ; 0x068: length=12

kfdhdb.dsksize: 102400 ; 0x0c4: 0x00019000

Or, for full output...

kfed read /dev/oraasm2

KFED Utility

You may need to create the kfed executable if it doesn't exist...

With the ASM environment set...

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk ikfed

ls -l $ORACLE_HOME/bin/kfed