An iSCSI initiator is a client that allows a system to access iSCSI-based storage devices over a network. In Ubuntu Linux, you can set up an iSCSI initiator using the open-iscsi
package.
Here’s an overview of the steps to set up an iSCSI initiator in Ubuntu Linux:
- Install the
open-iscsi
package:
sudo apt-get update
sudo apt-get install open-iscsi
- Discover the iSCSI target:
sudo iscsiadm --mode discoverydb --type sendtargets --portal IP_Address --discover
Where IP_Address
is the IP address of the iSCSI target.
- Log in to the iSCSI target:
sudo iscsiadm --mode node --targetname iqn.target-name --portal IP_Address:3260 --login
Where iqn.target-name
is the iSCSI qualified name of the target, and IP_Address
is the IP address of the target.
- Verify that the iSCSI disk has been added:
lsblk
This command will display a list of block devices on your system. If the iSCSI disk was added successfully, you should see it listed as a new block device.
- (Optional) Make the iSCSI disk persistent across reboots:
sudo nano /etc/iscsi/iscsid.conf
Edit the /etc/iscsi/iscsid.conf
file to add the following line:
node.startup = automatic
Save and close the file.
That’s it! You should now be able to use the iSCSI disk as if it were a local disk. If you encounter any issues, you can try running the following command for more information:
sudo iscsiadm -m session -P 3