Problem:
If a disk previously included in an ASM disk group is attempted to be used for another disk group, it will fail with the error “Device is already labeled for ASM disk”.
1 2 3 4 5 6 |
$ /etc/init.d/oracleasm createdisk DATA1 /dev/sda1 Marking disk "/dev/sda1" as an ASM disk: asmtool: Device "/dev/sda1" is already labeled for ASM disk "" [FAILED] $ /etc/init.d/oracleasm deletedisk DATA1 Removing ASM disk "DATA1" [FAILED] |
Reason:
ASMLib can sometimes leave partitions on the disk used for ASM.
Solution:
It will be enough to crush the partition information with the dd command.
According to the size of the disk, it is enough to crush the chapters at the beginning. /
dev/sda1 is used for partition name. Change it according to the partition name of your disk.
1 2 3 |
$ dd if=/dev/zero of=/dev/sda1 bs=1024 count=1000 1000+0 records in 1000+0 records out |
If it is insufficient, you can increase the value of count.
1 2 |
$ /etc/init.d/oracleasm createdisk DATA1 /dev/sda1 Marking disk "/dev/sda1" as an ASM disk: [ OK ] |