HP 3PAR RedHat and Oracle Linux Implementation Guide

For example, to remove target 0, LUN 2:
# kpartx -d /dev/mapper/350002ac001b40031
# dmsetup remove 350002ac001b40031
# echo "1" > /sys/class/scsi_device/0:0:0:2/device/delete
NOTE: When using the echo command, make sure the devices are removed from each of
the host HBA instances.
Method 2
Issue the following commands:
# kpartx -d /dev/mapper/<device node>
# dmsetup remove <device node>
echo "scsi remove-single-device <h> <c> <t> <l>" > /proc/scsi/scsi
where <h> is the HBA number, <c> is the channel on the HBA, <t> is the SCSI target ID,
and <l> is the LUN.
Example: Remove LUN 2
# multipath -ll
350002ac000160121 dm-3 3PARdata,VV
size=5.0G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:2 sdb 8:16 active ready running
|- 0:0:1:2 sdk 8:160 active ready running
|- 1:0:0:2 sdt 65:48 active ready running
`- 1:0:1:2 sdac 65:192 active ready running
# kpartx -d /dev/mapper/350002ac000160121
# dmsetup remove 350002ac000160121
# echo "scsi remove-single-device 0 0 0 2" > /proc/scsi/scsi
# echo "scsi remove-single-device 0 0 1 2" > /proc/scsi/scsi
# echo "scsi remove-single-device 1 0 0 2" > /proc/scsi/scsi
# echo "scsi remove-single-device 1 0 1 2" > /proc/scsi/scsi
NOTE: When using the echo command, make sure the devices are removed from each of
the host HBA instances.
After removing the storage volume from the host using one of the two methods, remove the VLUN
from the HP 3PAR StoreServ Storage by issuing removevlun <VVname> <LUN> <host>.
# removevlun testvlun 0 redhathost
Removing a Storage Volume from the Host 123