iSCSI server with OpenSuse

August 7, 2017 in Web Server

iSCSI server with OpenSuse.


In this tutorial i will try to demonstrate how you can create an iSCSI target and then mount it on another machine.

For that i will use the latest available OpenSuse at this time which is the Leap 42.3. I guess that this can be followed by other versions also.

login to OpenSuse, open a terminal and type:

sudo zypper update
sudo zypper install yast2-iscsi-lio-server


Once this is over then you need to open yast and then find and open the “iSCSI LIO Target”.

On the first tab “Service” under the section:

“Service start”

Choose if you want the server to run automatically on startup of O.S. or manually.

“Firewall settings for SuSEfirewall2”

click the checkbox “Open port Firewall” if you want to let the system do it for you, otherwise you can also do that manually later on.


After that click on the next tab “Global” and the Discovery credentials. You can let that free by clicking the “No discovery Authentication’ 


On the last tab “Targets” we are going to define the Targets, but before we do so we need to prepare the partition. On this example i use  a secondary disk that it is attached to the computer as raw and has nothing on it. Go to yast again and open “Partitioner”. A warning will come up and you can click yes. On the Partitioner click on the left “Hard Disks” and then select the disk that you wanna use. In my case it is the “/dev/sdb”. Click on the “Add Partition”, select “Primary Partition” and click “Next”.  On the next window select “Maximum Size” in order to use the entire disk and then click “Next”. If you asked about the role of this partition then select “Operating System” and “Next”.

In the last step it is important to select “Do not format partition” and “Do not mount partition” and then click “Finish”. 

Ok so now we can go back to “iSCSI LIO Target” and click on the last tab “Targets” and then click “Add”. Now most of the textboxes are filled by the system and you can modify them if needed but i will let them to default for now. This should look like the following picture but with different Target name, Identifier, and IP address.

Click in “Add” so we can add our first and only in that case LUN. If you wish to add more just repeat the following process. The LUN number in the following window should be already there and if this is your first LUN then it should be “0”. Now the Path needs to be the path to partition that we created before. In my case it is /dev/sdb1/. you can also add a name but if you let it empty the system will create one for you. Click “OK” and “Next” on the next window.

Now you should be on the following window.



Click the “Add” and provide the Initiator name that are going to connect to that target. Only the initiators with the identical name will be able to connect. We will use this name later on when we will try to connect that from another machine. This name has a specific syntax and it has to be like that:[:identifier]  or something like that:[:identifier] I ll use the following but you can modify that as you wish “”

click “OK”


Now you should be able to see the target in the target list ans you can click Finish. The export is created and the server is running!


Mount the target into another computer in the same network.

lets try now to connect this to another computer. I ll use again another OpenSuse computer and after opening yast this time i will select “iSCSI Initiator”. The first tab “Service” appears and you can select if that will run automatic on system boot or manually under the “Service Start” section. Then you need to specify the “Initiator Name” that we defined before. 


Now you need to go to the 2nd tab “Connected Targets” and click on “Add”. On the upcoming screen you need to type the IP address of the iSCSI target and click next.

Now you should be able to see the target and you have to click on connect.

On the upcoming window under the “Startup” select “automatic” and the initiator will connect to the target automatically when the server is coming up. Click next and you will be able to see that the target is now connected. Click on “Next” and “Finish”. Now you you should be able to see the disk under the list of your disks in the “Partitioner”. Go to yast once again and click on “Partitioner”.

The disk is not yet formatted nor mounted so lets to that. Right click on the disk and select “Add Partition” –> “Primary Partition” –> “Maximum Size” so we can use the whole disk. –> “Operating System” –> select the file system you wish to use and the mount point.