A
A
ashv242018-05-05 17:48:23
ubuntu
ashv24, 2018-05-05 17:48:23

iSCSI target persisting targets after reboot?

Hello.
Can anyone tell me how to save configured targets (iscsi target) in Ubuntu server 18.04 after reboot?
This is how the goal was set up and it can be successfully seen from windows 10 (you can write and read). Setup article https://www.hiroom2.com/2017/07/11/ubuntu-1604-tgt-en/
$ sudo mkdir /var/lib/iscsi
$ sudo dd if=/dev/zero of=/var/ lib/iscsi/ubuntu-1604 bs=1M count=1K
$ sudo tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2017-07.com.hiroom2:ubuntu-1604
$ sudo tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/lib/iscsi/ubuntu-1604
$ sudo tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
But this command in the article does not work. tgtadm has no such --dump option
$ sudo tgtadm --dump | sudo tee /etc/tgt/conf.d/ubuntu-1604.conf
Save configuration for iSCSI target. If you do not save configuration, configuration will be removed after restarting tgtd.
How to save goals after reboot? Do they need to be written down somewhere? But where and how?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2018-05-05
@ashv24

create the targets.conf file in /etc/tgt, write to it include /etc/tgt/conf.d/*.conf, create the conf.d directory in /etc/tgt, create the ubuntu-1604.conf file in it and write in it:

default-driver iscsi
<target iqn.2017-07.com.hiroom2:ubuntu-1604>
        backing-store /var/lib/iscsi/ubuntu-1604
</target>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question