To set up an iSCSI initiator on Ubuntu Linux, you will need to install the necessary packages and configure the iSCSI initiator service. Here are the steps to do this:
To install the packages required for the iSCSI initiator, use the apt-get
command. First, update the package index by running the following command:
sudo apt-get updateSourww:ecw.lautturi.com
Then, install the iSCSI initiator packages by running the following command:
sudo apt-get install open-iscsi
This will install the open-iscsi
package and any dependencies it requires.
To configure the iSCSI initiator service, you will need to edit the /etc/iscsi/iscsid.conf
file. This file contains various options that control the behavior of the iSCSI initiator service.
For example, to enable automatic login to iSCSI targets, you can add or modify the following line in the /etc/iscsi/iscsid.conf
file:
node.startup = automatic
To specify the iSCSI target portal to use, you can add or modify the following line:
node.conn[0].iscsi.MaxRecvDataSegmentLength = 65536 node.conn[0].iscsi.HeaderDigest = None node.conn[0].iscsi.DataDigest = None node.conn[0].iscsi.TargetName = iqn.2018-11.com.example:storage.disk2.sys1.xyz node.conn[0].iscsi.TargetAddress = 192.0.2.1:3260
Replace the iqn
and TargetAddress
values with the appropriate values for your iSCSI target.
After making any changes to the /etc/iscsi/iscsid.conf
file, you will need to restart the iSCSI initiator service for the changes to take effect. To do this, use the systemctl
command:
sudo systemctl restart iscsid
To discover iSCSI targets on the network, you can use the iscsiadm
command. For example:
sudo iscsiadm --mode discoverydb --type sendtargets --portal 192.0.2.1:3260 --discover
Replace the portal
value with the appropriate value for your iSCSI target.
This will discover iSCSI targets on the specified portal and add them to the iSCSI discovery database.
To log in to an iSCSI target, use the iscsiadm
command with the --login
option. For example:
sudo iscsiadm --mode node --targetname iqn.2018-11.com.example:storage.disk2.sys1.xyz --portal 192.0.2.1:3260 --login
Replace the `target