Ubuntu Linux Set Iscsi Initiator

Ubuntu Linux Set Iscsi Initiator

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:

  1. Install the necessary packages:

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 update
Sour‮ww:ec‬w.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.

  1. Configure the iSCSI initiator service:

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.

  1. Restart the iSCSI initiator service:

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
  1. Discover iSCSI targets:

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.

  1. Login to iSCSI targets:

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

Created Time:2017-10-30 14:27:26  Author:lautturi