• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6,7 : How to delete an iSCSI Target on the initiator (iSCSI client)

by admin

Internet Small Computer System Interface (iSCSI) is an IP-based standard for connecting storage devices. iSCSI uses IP networks to encapsulate SCSI commands, allowing data to be transferred over long distances. iSCSI provides shared storage among a number of client systems. Storage devices are attached to servers (targets). Client systems (initiators) access the remote storage devices over IP networks. To the client systems, the storage devices appear to be locally attached. iSCSI uses the existing IP infrastructure and does not require any additional cabling, as is the case with Fibre Channel (FC) storage area networks.

If you no longer need the iSCSI storage from a particular target, you can disable/delete the target on the initiator node. Follow the steps below to log out and delete the target IQN on the initiator node

1. Umount iSCSI device/filesystems

Before deleting the target, make sure the iSCSI devices from that target are not in use. Umount and/or delete the filesystems using the iSCSI devices esported from the target.

2. Logout

First step is to logout of the iSCSI target.

# iscsiadm -m node -T iqn.2007-06.com.test.geeklab:storage.geeklab --portal 192.168.10.12:3260 -u

3. Delete Target’s Record ID

When you discover the targets and log into it, the information is stored in the node database found in /var/lib/iscsi. In order to delete the target, we have to delete the target’s record ID out of /var/lib/iscsi:

# iscsiadm -m node -o delete -T iqn.2007-06.com.test.geeklab:storage.geeklab --portal 192.168.10.12:3260

4. Stop the iSCSI service (optional)

Follow this step only if you have no other target left on the system and do not want to use iSCSI. Stop the iSCSI service and disable it to start at boot using chkconfig or systemctl commands.

For RHEL 6

# service iscsi stop
# chkconfig iscsi off

For RHEL 7

# systemctl stop iscsi
# systemctl disable iscsi

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. apm – Atom editor Package Manager (Command Examples)
  2. chkconfig Command Examples in Linux
  3. blkid Command Examples in Linux
  4. aws lambda: CLI for AWS lambda (Command Examples)
  5. zip: command not found
  6. halt Command Examples in Linux
  7. mandb: command not found
  8. vgcreate: command not found
  9. dsniff Command Examples in Linux
  10. rusnapshot Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands
  • bash Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright