• 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

How to modify the iSCSI initiator ID in Linux

by admin

Question

In our environment, we have duplicate initiator id in /etc/iscsi/initiatorname.iscsi due to multiple iSCSI implementations. How can we Create Different ISCSI Initiator ID for the hosts?

Solution

Sometimes, when systems are mass deployed using the same Linux image, you may have duplicate initiator IDs in all the systems. The initiator ID for the system is mentioned in the file /etc/iscsi/initiatorname.iscsi file. In order to modify or create a new iSCSI initiator ID, follow the steps given below.

1. Move the existing /etc/iscsi/initiatorname.iscsi to other temporary directory (or back it up somewhere).

# mv /etc/iscsi/initiatorname.iscsi /var/tmp/initiatorname.iscsi.backup

2. Run following on the command line.

# echo "InitiatorName=`/sbin/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi

The command ‘/sbin/iscsi-iname‘ generates a new iSCSI initiator ID, which in turn is overwritten in the file /etc/iscsi/initiatorname.iscsi.

Note: you can run above command line multiple times to create different id.

3. Make sure you make corresponding changes in the iSCSI target ACLs to accommodate the new iSCSI initiator ID and allow access using the new initiator ID. This step is required only if you have any existing iSCSI targets and target ACLS configured using the old iSCSI initiator ID.

How to configure iSCSI Initiator (client) in CentOS / RHEL 6
How to configure iSCSI target using targetcli in CentOS / RHEL 7
How to configure iSCSI Initiator (client) in CentOS / RHEL 7
Understanding iscsiadm Utility in CentOS / RHEL

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

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to password-protect single user mode
  2. SSH Authentication Files in Linux
  3. Troubleshooting common NFS issues in Linux
  4. CentOS / RHEL 7 : How to set default target (default runlevel)
  5. Understanding the nfsiostat command output (Examples Included)
  6. How to uninstall fail2ban on Ubuntu
  7. mke2fs: command not found
  8. f5fpc Command Examples
  9. How to Find and Delete Empty Directories and Files in Linux
  10. Which network ports are reserved by the Linux Operating System?

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright