Comments on How to Setup an iSCSI Storage Server on Ubuntu 20.04 LTS

iSCSI stands for Internet Small Computer System Interface is a Storage Area Network protocol that can be used to share block devices such as HDD/SSD partitions, or LVM partitions, or block files on the network. In this tutorial, we will explain how to setup iSCSI targets and iSCSI initiator on Ubuntu 20.04 server.

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Nexusguy59

Hello Hitesh,

     I see that you are doing one whole drive like /dev/sdb, How do I use slices with this method?

 

Thanks,

By: Paul Laffitte

I have an issue with the command "systemctl restart open-iscsi iscsid", because "systemctl status open-iscsi" then output something like this:

 

? open-iscsi.service - Login to default iSCSI targets

     Loaded: loaded (/lib/systemd/system/open-iscsi.service; enabled; vendor preset: enabled)

     Active: failed (Result: exit-code) since Wed 2020-09-02 10:45:22 UTC; 4min 56s ago

       Docs: man:iscsiadm(8)

             man:iscsid(8)

    Process: 1769 ExecStart=/sbin/iscsiadm -m node --loginall=automatic (code=exited, status=18)

   Main PID: 1769 (code=exited, status=18)

 

I then tried to restart iscsid first and then open-iscsi, and it worked. The reason is that open-iscsi needs iscsid to be running to work, and if you restart both in the same time, it could produce an error.

By: Dave

On the target after configuring, I had to run the following to bind it to the network:

sudo tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

By: Simon Mudd

Thanks for this. I run my 20.04 box withh zfs and this allows me to with some external disks to provide LUNs from devices exported from ZFS which is quite flexible.

I'm just missing one component which is something to administer the 2 parts: zfs devices and tgt configuration so that I can create a dynamic provisioning backend configurable with some sort of rest interface and then use this from k8s.

Do you know if any such free/open source tooling already exists for this?

By: Kingneutron

You are my FREAKING HERO.

I had no experience with iscsi before and your guide was pretty comprehensive and easy to follow. As another poster mentioned, the only thing missing was the command to bind it to the network:

# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

 

I am up and running with iscsi on a Linux Mint Debian Edition host sharing a ZFS zvol to a Devuan VM guest thanks to you! :^)

By: Mike Hosken

Say I have a raid 5 and want to turn 20tb of files into files that can be read by the iscsi serving up the files

By: srividyakothapalli

we can configure this initiator and target in same instance???