How to configure iSCSI Client on Debian 9

This tutorial is going to show you how to configure the iSCSI Client on Debian 9. By default, you won’t be able to connect to iSCSI Target device from Debian 9. We need to install and configure the iSCSI Client on Debian 9.

Scope

On this tutorial, we will learn how to install iSCSI Client and then connect the remote iSCSI Target disk from Debian 9. We use Webmin to configure the iSCSI Client. So it would be a lot easier if you have installed Webmin on Debian 9.

System Configuration

The following are the system configuration we used on this tutorial

  • Debian IP address (iSCSI Client): 10.34.0.202
  • iSCSI Target server: 10.34.0.156
  • CHAP Username: dhani
  • CHAP Password: 123456

Step 1. Install iSCSI Initiator (Client)

apt install open-iscsi parted

Output sample:

root@debian:~# apt install open-iscsi parted
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libglib2.0-0 libglib2.0-data shared-mime-info xdg-user-dirs
Use ‘apt autoremove’ to remove them.
The following additional packages will be installed:
libisns0 libparted2
Suggested packages:
libparted-dev libparted-i18n parted-doc
The following NEW packages will be installed:
libisns0 libparted2 open-iscsi parted
0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
Need to get 874 kB of archives.
After this operation, 3,233 kB of additional disk space will be used.
Do you want to continue? [Y/n]

Step 2. Configure iSCSI Client

Log in to Webmin interface and go to Hardware | iSCSI Client section. I suggest you to enable Start at boot option.

iscsi client on debian 9 1.png

Now go to Authentication Options tab. Here we need to configure the CHAP username for the remote iSCSI Target server. Please confirm this with your iSCSI Server because on some cases, iSCSI Target server does not require password to connect/discover the target.

iscsi authentication.png

Click Save to continue. And then click iSCSI Connections tab. Enter the iSCSI Target server IP address and then press Connect. If the connection is successfull, you will see the following window.

iscsi connect.png

If the server has multiple targets, select one of them and define the authentication method (username and password).

iscsi on debian 9.png

If all correct, you will see the connected target as follow

iscsi initiator on debian 9.png

As you can see, my new iSCSI target is known as /dev/sda. We can then format it, and use it as if its a local device.

Thanks for coming and please share this article.

Be the first to comment

Leave a Reply

Your email address will not be published.


*