System Administration Guide: Devices and File Systems

ProcedureHow to Remove Discovered iSCSI Targets

After removing a discovery address, iSNS server, or static configuration, or after disabling a discovery method, the associated targets are logged out. If these associated targets are still in use, for example, they have mounted file systems, the logout of these devices will fail, and they will remain on the active target list.

This optional procedure assumes that you are logged in to the local system where access to an iSCSI target device has already been configured.

  1. Become superuser.

  2. (Optional) Disable an iSCSI target discovery method using one of the following:

    • If you need to disable the SendTargets discovery method, use the following command:


      initiator# iscsiadm modify discovery --sendtargets disable
      
    • If you need to disable the iSNS discovery method, use the following command:


      initiator# iscsiadm modify discovery --iSNS disable
      
    • If you need to disable the static target discovery method, use the following command:


      initiator# iscsiadm modify discovery --static disable
      
  3. Remove an iSCSI device discovery entry using one of the following:

    • Remove an iSCSI SendTargets discovery entry.

      For example:


      initiator# iscsiadm remove discovery-address 10.0.0.1:3260
      
    • Remove an iSCSI iSNS discovery entry.

      For example:


      # iscsiadm remove isns-server 10.0.0.1:3205
      
    • Remove a static iSCSI discovery entry.

      For example:


      initiator# iscsiadm remove static-config eui.5000ABCD78945E2B,10.0.0.1
      

    Note –

    If you attempt to disable or remove a discovery entry that has an associated logical unit in use, the disable or remove operation fails with the following message:


    logical unit in use

    If this errors occurs, stop all associated I/O on the logical unit, unmount the file systems, and so on. Then, repeat the disable or remove operation.


  4. Remove the iSCSI target device.

    Remove a target by specifying the logical unit number (LUN). If you did not specify a LUN when the target was created, a value of 0 was used. LUN 0 must be the last LUN removed if multiple LUNs are associated with a target.

    For example:


    initiator# iscsitadm delete target --lun 0 sandbox