Removing manually configured FCP LUNs and their SCSI device

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

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: Use this procedure only to dynamically test configuration settings.
To configure a persistent setting in a production system, remove the dracut boot parameter rd.zfcp= only for SCSI disks that are no longer required for the root file system. Use the configuration file /etc/zfcp.conf for all other SCSI devices, such as data volumes or tape libraries.

Procedure

Follow these steps to remove a manually configured FCP LUN and its SCSI device:

  • Use the chzdev command. Issue a command of this form:
    chzdev -d -a zfcp-lun <device_bus_id>:<wwpn>:<fcp_lun> 
  • Alternatively, remove the SCSI device from the target port by writing the LUN of the device to the unit_remove attribute of the port. Issue a command of this form:
    # echo <fcp_lun> > /sys/bus/ccw/drivers/zfcp/<device_bus_id>/<wwpn>/unit_remove
    where the variables have the same meaning as in Configuring SCSI devices. Removing a LUN with unit_remove automatically unregisters the SCSI device first.

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.

  • Using chzdev, issue:
    # chzdev -d zfcp-lun 0.0.3d0c:0x500507630300c562:0x4010403200000000
  • Using sysfs, remove the device and the LUN:
    # echo 0x4010403200000000 > /sys/bus/ccw/drivers/zfcp/0.0.3d0c/0x500507630300c562/unit_remove