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:
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-utilsSource:www.lautturi.com
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.
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.
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.
mkdir /mnt/iscsi
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.