The post outlines steps to remove ASM disk on multipath device (Labeled as ASMDISK01 as an example in this post) from CentOS/RHEL server.
1. First make sure that ASM disk is no longer used by any disk group, otherwise, you might risk data integrity. The DBA can check this by using asmcmd or by logging into the ASM database.
2. Find out ASM disk mapping:
# oracleasm listdisks ASMDISK01 ...
# oracleasm querydisk -p ASMDISK01 Disk "ASMDISK01" is a valid ASM disk /dev/sdf: LABEL="ASMDISK01" TYPE="oracleasm" ...
# oracleasm querydisk -d ASMDISK01 Disk "ASMDISK01" is a valid ASM disk on device [8, 16] ...
3. Identify multipath device used for ASMDISK01 disk from ASM:
# multipath -ll mpath1 dm-4 IBM DS size=10G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active `- 5:0:0:1 sdf 8:16 active ready running <- `- 5:0:0:1 sdg 8:17 active ready running ...
# dmsetup ls --tree mpath1 (252:1) ├─ (8:16) <- sdf └─ (8:17) <- sdg mpath2 (252:2) └─ (8:76) ...
4. After you have confirmed the disk to be deleted as well as its corresponding disk in device multipath, you can go ahead and delete it from ASM first.
# oracleasm deletedisk ASMDISK01 Removing ASM disk “ASMDISK01″: [ OK ]
5. Next step is to clean up the device multipath for the deleted disk. You can use any of the below commands to delete the multipath disk.
# multipath –f mpath1
# dmsetup remove mpath1
6. Delete SCSI devices from kernel.
# echo 1 > /sys/block/sdf/device/delete # echo 1 > /sys/block/sdg/device/delete
7. LUN could be removed from SAN Storage Server now.
8. Make sure mpath1 is removed from multipath list:
# multipath -ll