6.13. Removing an iSCSI object by using targetcli tool
You can remove the iSCSI objects by using the targetcli tool. For more information, see the targetcli(8) man page on your system.
Procedure
Log off from the target:
# iscsiadm -m node -T iqn.2006-04.com.example:444 -uFor more information about how to log in to the target, see Creating an iSCSI initiator.
Remove the entire target, including all ACLs, LUNs, and portals:
/> iscsi/ delete iqn.2006-04.com.example:444Replace iqn.2006-04.com.example:444 with the target_iqn_name.
To remove an iSCSI backstore:
/> backstores/backstore-type/ delete block_backendReplace backstore-type with either
fileio,block,pscsi, orramdisk.Replace block_backend with the backstore-name you want to delete.
To remove parts of an iSCSI target, such as an ACL:
/> /iscsi/iqn-name/tpg/acls/ delete iqn.2006-04.com.example:444
Verification
View the changes:
/> iscsi/ ls