Removing ASM Disks

February 2, 2010

If you try to release the ASM disk, it fails sometimes with following error:

[root]# /etc/init.d/oracleasm deletedisk ASM3

Removing ASM disk “ASM3”:                                  [FAILED]

To get around this problem, it is necessary to overwrite the ASM header information on the disk. This can be achieved with the UNIX command dd. The following command will write 100x1024b blocks to the specified device:

[root]# dd if=/dev/zero of=/dev/mapper/asm3p1 bs=1024 count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.003025 seconds, 33.9 MB/s

If you try to deletedisk, it should work now.

[root]# /etc/init.d/oracleasm deletedisk ASM3
Removing ASM disk “ASM3”:                                  [  OK  ]

If you get “device or resource busy” message in /var/log/oracleasm

[root]# tail -f /var/log/oracleasm
Clearing disk header: oracleasm-write-label: Unable to open device “/dev/oracleasm/disks/ASM3”: Device or resource busy

Check who is using the asm device:

[root]# fuser /dev/mapper/asm3p1
/dev/mapper/asm3p1:  27612

[root]# ps -ef | grep 27612
root      5076 24373  0 17:06 pts/3    00:00:00 grep 27612
oracle   27612     1  0 16:02 ?        00:00:00 oracle+ASM1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

If this is the case you will have to take your ASM instance down to release the device.