Monday 20 September 2010

How to Clear asm disk headers

dd if=/dev/zero bs=8k count=1000 of=/dev/sde1


 

[root@rac2 ~]# /etc/init.d/oracleasm querydisk -d /dev/sde1

Device "/dev/sde1" is marked an ASM disk with the label "DISK4"

[root@rac2 ~]# /etc/init.d/oracleasm querydisk -d /dev/sdb1

Device "/dev/sdb1" is marked an ASM disk with the label "DISK1"

[root@rac2 ~]# /etc/init.d/oracleasm querydisk -d /dev/sdc1

Device "/dev/sdc1" is marked an ASM disk with the label "DISK2"

[root@rac2 ~]# /etc/init.d/oracleasm querydisk -d /dev/sdd1

Device "/dev/sdd1" is marked an ASM disk with the label "DISK3"

[root@rac2 ~]# /etc/init.d/oracleasm querydisk -d /dev/sde1

Device "/dev/sde1" is marked an ASM disk with the label "DISK4"

[root@rac2 ~]# dd if=/dev/zero bs=8k count=1000 of=/dev/sde1

1000+0 records in

1000+0 records out

8192000 bytes (8.2 MB) copied, 0.460529 seconds, 17.8 MB/s

[root@rac2 ~]# oracleasm listdisks

DISK1

DISK2

DISK3

DISK4

[root@rac2 ~]# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Cleaning disk "DISK4"

Scanning system for ASM disks...

[root@rac2 ~]# oracleasm listdisks

DISK1

DISK2

DISK3

Use the below command if you want to clear an ASM disk header. We may want to do that if we want to reuse the disk to add it to some other diskgroup.

$ dd if=/dev/zero of=/dev/raw/raw1 bs=8192 count=12800
12800+0 records in
12800+0 records out
104857600 bytes (105 MB) copied, 3.78717 seconds, 27.7 MB/s

Let us now verify the disk header..


$ kfed read /dev/raw/raw1
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
$

KFBTYP_INVALID, indicates the disk headers are cleared. This disk should now appear as a CANDIDATE disk in the v$asm_disk.

http://blog.ronnyegner-consulting.de/2009/10/08/asm-resilvering-%E2%80%93-or-%E2%80%93-how-to-recover-your-crashed-cluster-%E2%80%93-test-no-3/

No comments: