Linux serverlinux web serverNETWORK ADMINISTRATIONS

SERVER + LAB EXERCISE 4-2 LINUX iSCSI INITIATOR TO iSCSI TARGET

To use the Ubuntu Linux iSCSI initiator to connect to an iSCSI target, you need to follow these steps:

Install the open-iscsi package on your Ubuntu system with the command: 
sudo apt install open-iscsi
Edit the
/etc/iscsi/iscsid.conf
file and configure the authentication and network settings for your iSCSI target.
You can use any text editor, such as nano or vim, to edit the file.

For example, if your iSCSI target uses CHAP authentication, you need to set the node.session.auth.authmethod to CHAP and provide the
node.session.auth.username and node.session.auth.password
values.

You can also change other settings, such as:
node.startup, node.conn[0].timeo.login_timeout, node.session.timeo.replacement_timeout
etc. according to your needs. 

You can refer to these web pages for more details and examples.
https://www.howtoforge.com/tutorial/how-to-setup-iscsi-storage-server-on-ubuntu-2004-lts/

Restart the open-iscsi service with the command: sudo systemctl restart open-iscsi
Discover the iSCSI target with the command: sudo iscsiadm -m discovery -t sendtargets -p target_ip, where target_ip is the IP address of your iSCSI target.
You should see the output with the target name and portal information.

Log in to the iSCSI target with the command: 
sudo iscsiadm -m node -T target_name -p target_ip –login
where target_name is the name of your iSCSI target and target_ip is the IP address of your iSCSI target.
You should see a message that the login is successful.
Verify that the iSCSI device is connected and available on your Ubuntu system with the command: 
lsblk or fdisk -l
lsblk –scsi | grep iscsi
You should see a new device, such as /dev/sdd, that represents the iSCSI disk.
You can also use the command: 
sudo iscsiadm -m session -P 3 to see detailed information about the iSCSI session and device.

At this point, you have connected to the iSCSI target from your Ubuntu system.
You can now format, mount, and use the iSCSI disk as a local storage device.

sudo fdisk /dev/sdd
sudo mkfs /dev/sdd1
sudo mkdir /project-x
sudo mount /dev/sdd1 project-x

Verify :
mount | grep project

Now, you should be able to access the iSCSI drive on your Windows system like any other locally attached storage device.
Remember that the specific steps might vary slightly depending on the version of Windows you’re using.

How to Connect to iSCSI Volume from Ubuntu 20.04


source

by Derrick Beaird

linux web server