Accessing A Single iSCSI LUN From Multiple Linux Systems

Accessing A Single iSCSI LUN From Multiple Linux Systems

To access a single iSCSI LUN (Logical Unit Number) from multiple Linux systems, you will need to set up an iSCSI target and initiator on each system. An iSCSI target is a device that exports storage over the network, and an iSCSI initiator is a device that connects to and accesses the storage on an iSCSI target.

Here are the general steps to set up an iSCSI target and initiator on a Linux system:

  1. Install the necessary software. On most Linux systems, you can use the iscsi-initiator-utils package to set up an iSCSI initiator. You can install this package using the package manager for your distribution. For example, on an Ubuntu system, you can use the following command:
apt-get install iscsi-initiator-utils
Sour‮c‬e:www.lautturi.com
  1. Configure the iSCSI initiator. Edit the /etc/iscsi/initiatorname.iscsi file to specify the iSCSI initiator name for the system. The initiator name should be unique for each system that will be accessing the iSCSI LUN.

  2. Discover the iSCSI target. Use the iscsiadm command to discover the iSCSI target and obtain the iSCSI target name and IQN (iSCSI Qualified Name). For example:

iscsiadm -m discovery -t st -p TARGET_IP_ADDRESS

Replace TARGET_IP_ADDRESS with the IP address of the iSCSI target.

  1. Connect to the iSCSI target. Use the iscsiadm command to connect to the iSCSI target and log in to the target. For example:
iscsiadm -m node -T TARGET_NAME -p TARGET_IP_ADDRESS -l

Replace TARGET_NAME with the iSCSI target name obtained in step 3, and TARGET_IP_ADDRESS with the IP address of the iSCSI target.

  1. Create a mount point for the iSCSI LUN. Create a directory where the iSCSI LUN will be mounted. For example:
mkdir /mnt/iscsi
  1. Mount the iSCSI LUN. Use the mount command to mount the iSCSI LUN on the mount point you created. For example:
mount /dev/sdX /mnt/iscsi

Replace /dev/sdX with the device name of the iSCSI LUN. You can use the lsblk command to list the block devices on the system and find the device name of the iSCSI LUN.

Once you have set up an iSCSI target and initiator on each Linux system, you should be able to access the iSCSI LUN from all of the systems. Keep in mind that you will need to have the appropriate permissions to access the iSCSI LUN.

Created Time:2017-10-27 14:56:33  Author:lautturi