To interact with an iSCSI LUN in Linux-based operating systems, users must connect to the LUN by entering a series of commands in the terminal based on the operating system being used to perform the interactions. The tool used to interact with an iSCSI LUN in a Linux-based OS is dependent upon the type and version of the OS installed on the device. If you are running the following operating systems or higher, the tool used to connect to the LUN is Open-iSCSI:
- CentOS 5
- RedHat ES 5
- Fedora Core 6
- Fedora Release 7
- Debian
Connect to an iSCSI LUN
- Retrieve the iSCSI details listed below from the Customer Portal. Refer to View iSCSI Storage Details.
- iSCSI IP Address or URL
- iSCSI User Name
- iSCSI Password
- Determine if the Open-iSCSI package has been installed on the operating system.
- CentOS 5, RedHat ES 5, Fedora Core 6, Fedora Release 7, or higher
- Debian
- Determine if you are connecting to the iSCSI LUN in Debian.
- Some newer version of the iscsi-iniator-utils use initiatorname.conf also, so open the /etc/iscsi/initiatorname.conf file with your preferred text editor and edit it to look like the following
InitiatorName= iqn.2014-01.com.example:node1.target1
- Enter the following command in the terminal to back up the original configuration of the iscsid.conf configuration file:
cp /etc/iscsi/iscsid.conf{,.save}
- Open the configuration (/etc/iscsi/iscsid.conf) with your preferred text editor.
- Replace the contents of the configuration with the following configuration details:
node.startup = automatic
node.session.auth.username = ISCSI_USER
node.session.auth.password = ISCSI_PASS
discovery.sendtargets.auth.username = ISCSI_USER
discovery.sendtargets.auth.password = ISCSI_PASS
node.session.timeo.replacement_timeout = 120
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 10
node.conn[0].timeo.noop_out_timeout = 15
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 65536
- Start the iscsid program. Refer to the table below for the appropriate command to enter in the terminal based on your OS:
Operating System
Command
CentOS 5+
/etc/init.d/iscsi startFedora Core 6+
Fedora Release 7+
RedHat ES 5+
Debian
/etc/init.d/open-iscsi restart
- Enter the following command in the terminal to run a discovery against the iSCSI target host.
iscsiadm -m discovery -t sendtargets -p ISCSI_TARGET_HOST
Note: Replace the ISCSI_TARGET_HOST token with the iSCSI IP Address.- Restart the the iSCSI service. Refer to the table below for the appropriate command to enter in the terminal based on your OS:
Operating System
Command
CentOS 5
/etc/init.d/iscsi restartFedora Core 6
Fedora Release 7
RedHat ES 5
Debian
/etc/init.d/open-iscsi restart
- Enter the following command in the terminal to back up the original configuration of the iscsid.conf configuration file:
If the Open-iSCSI package… |
Then… |
Has been installed |
Proceed to the next step. |
Has not been installed |
Intsall the open-iscsi package. Use the command below that applies to your current operating system.
|
If connecting to iSCSI in… |
Then… |
Debian |
Enter the following command
in the terminal to fix the file paths for iscsiadmin: |
Another OS |
Proceed to the next step |
An additional drive will now appear on the system. You may print out the drive device with the following command at any time:
find /sys/devices/platform/host* -name block\* -exec ls -la '{}' \; | sed
s#^.*../block/#/dev/#g