Removing manually configured FCP LUNs and their SCSI device
![]()
Manually remove a SCSI device if your environment is not set up to use NPIV or if you disabled automatic LUN scan.
Before you begin
Attention: The following procedure ignores distribution specifics and
might interfere with configuration tools provided by your distribution. Always use
distribution-specific configuration tools if available.
See the documentation that is provided by your distributor about which tools to use for a persistent configuration in a production environment.
Procedure
Follow these steps to remove a manually configured FCP LUN and its SCSI
device:
Example
The following example removes a SCSI device with LUN 0x4010403200000000, accessed through a target port with WWPN 0x500507630300c562 and is attached through an FCP device with bus ID 0.0.3d0c. The corresponding directory in the sysfs SCSI branch is assumed to be /sys/bus/scsi/devices/0:0:1:1077035024.
- To remove the LUN and make the configuration change persistent, use:
# chzdev -d zfcp-lun 0.0.3d0c:0x500507630300c562:0x4010403200000000
- For a non-persistent configuration, use the chzdev command with the
-aoption:# chzdev -d -a zfcp-lun 0.0.3d0c:0x500507630300c562:0x4010403200000000
Alternatively, for a non-persistent configuration, you can also use sysfs:- Optionally,
unregister the device:
# echo 1 > /sys/bus/scsi/devices/0:0:1:1077035024/delete - Remove the device (if not done in previous step) and the LUN:
# echo 0x4010403200000000 > /sys/bus/ccw/drivers/zfcp/0.0.3d0c/0x500507630300c562/unit_remove
- Optionally,
unregister the device: