ASM Disk Header Repair

Below scenario is to test the ASM diskheader repair using kfed.

SQL> select path from v$asm_disk where group_number=3;

PATH
————————————————————————–
ORCL:ASMDISK5

[root@VM1 ~]# oracleasm querydisk -p ASMDISK5
 Disk "ASMDISK5" is a valid ASM disk
 /dev/sdd1: LABEL="ASMDISK5" TYPE="oracleasm"

[root@VM1 ~]# kfed read /dev/sdd1
 kfbh.endian: 1 ; 0x000: 0x01
 kfbh.hard: 130 ; 0x001: 0x82
 kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
 kfbh.datfmt: 1 ; 0x003: 0x01
 kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
 kfbh.check: 2365485406 ; 0x00c: 0x8cfe715e
 kfbh.fcn.base: 0 ; 0x010: 0x00000000
 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
 kfbh.spare1: 0 ; 0x018: 0x00000000
 kfbh.spare2: 0 ; 0x01c: 0x00000000
 kfdhdb.driver.provstr: ORCLDISKASMDISK5 ; 0x000: length=16
 kfdhdb.driver.reserved[0]: 1145918273 ; 0x008: 0x444d5341
 kfdhdb.driver.reserved[1]: 894128969 ; 0x00c: 0x354b5349
 kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
 kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
 kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
 kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
 kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
 kfdhdb.dsknum: 0 ; 0x024: 0x0000
 kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
 kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
 kfdhdb.dskname: ASMDISK5 ; 0x028: length=8

ASM will also store copy of ASM Disk header under allocation unit 1 penultimate block. 

[root@VM1 ~]# kfed read /dev/sdd1 aun=1 blkn=254 |more
 kfbh.endian: 1 ; 0x000: 0x01
 kfbh.hard: 130 ; 0x001: 0x82
 kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
 kfbh.datfmt: 1 ; 0x003: 0x01
 kfbh.block.blk: 254 ; 0x004: T=0 NUMB=0xfe
 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
 kfbh.check: 2365485472 ; 0x00c: 0x8cfe71a0
 kfbh.fcn.base: 0 ; 0x010: 0x00000000
 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
 kfbh.spare1: 0 ; 0x018: 0x00000000
 kfbh.spare2: 0 ; 0x01c: 0x00000000
 kfdhdb.driver.provstr: ORCLDISKASMDISK5 ; 0x000: length=16
 kfdhdb.driver.reserved[0]: 1145918273 ; 0x008: 0x444d5341
 kfdhdb.driver.reserved[1]: 894128969 ; 0x00c: 0x354b5349
 kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
 kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
 kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
 kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
 kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
 kfdhdb.dsknum: 0 ; 0x024: 0x0000
 kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
 kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
 kfdhdb.dskname: ASMDISK5 ; 0x028: length=8
 kfdhdb.grpname: DATA3 ; 0x048: length=5
 kfdhdb.fgname: ASMDISK5 ; 0x068: length=8

Corrupt the header of the Disk for the diskgroup DATA3

[root@VM1 ~]# dd if=/dev/zero of=/dev/sdd1 bs=4096 count=1
 1+0 records in
 1+0 records out
 4096 bytes (4.1 kB) copied, 0.00111 seconds, 3.7 MB/s

Check the header status now, it will show as INVALID

[root@VM1 ~]# kfed read /dev/sdd1 |more
 kfbh.endian: 0 ; 0x000: 0x00
 kfbh.hard: 0 ; 0x001: 0x00
 kfbh.type: 0 ; 0x002: KFBTYP_INVALID
 kfbh.datfmt: 0 ; 0x003: 0x00
 kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
 kfbh.block.obj: 0 ; 0x008: TYPE=0x0 NUMB=0x0
 kfbh.check: 0 ; 0x00c: 0x00000000
 kfbh.fcn.base: 0 ; 0x010: 0x00000000
 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
 kfbh.spare1: 0 ; 0x018: 0x00000000
 kfbh.spare2: 0 ; 0x01c: 0x00000000
 ERROR!!!, failed to get the oracore error message
SQL> alter diskgroup DATA3 dismount;

Diskgroup altered.

SQL> alter diskgroup DATA3 mount;
 alter diskgroup DATA3 mount
 *
 ERROR at line 1:
 ORA-15032: not all alterations performed
 ORA-15017: diskgroup "DATA3" cannot be mounted
 ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA3"

Repair the ASM disk

[root@VM1 ~]# kfed repair /dev/sdd1

Check if the header status repaired using kfed

[root@VM1 ~]# kfed read /dev/sdd1 |more
 kfbh.endian: 1 ; 0x000: 0x01
 kfbh.hard: 130 ; 0x001: 0x82
 kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
 kfbh.datfmt: 1 ; 0x003: 0x01
 kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
 kfbh.check: 2365485406 ; 0x00c: 0x8cfe715e
 kfbh.fcn.base: 0 ; 0x010: 0x00000000
 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
 kfbh.spare1: 0 ; 0x018: 0x00000000
 kfbh.spare2: 0 ; 0x01c: 0x00000000
 kfdhdb.driver.provstr: ORCLDISKASMDISK5 ; 0x000: length=16
 kfdhdb.driver.reserved[0]: 1145918273 ; 0x008: 0x444d5341
 kfdhdb.driver.reserved[1]: 894128969 ; 0x00c: 0x354b5349
 kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
 kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
 kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
 kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
 kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
 kfdhdb.dsknum: 0 ; 0x024: 0x0000
 kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
 kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
 kfdhdb.dskname: ASMDISK5 ; 0x028: length=8

Mount the diskgroup now and check the status

SQL> alter diskgroup DATA3 mount;

Diskgroup altered.

SQL> select group_number,name,type,state from v$asm_diskgroup ;

GROUP_NUMBER NAME TYPE STATE
 ------------ ------------------------------ ------ -----------
 1 DATA2 NORMAL MOUNTED
 2 DATA EXTERN MOUNTED
 3 DATA3 EXTERN MOUNTED
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s