LaCie D2N2 and ISCSI target option ?

LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Mon Feb 13, 2023 12:25 pm

Hi FVDW,

As you did a great job on that subjecy for 5big2, I was wondering if there is an option to get " ISCSI target" on the d2 network 2 ?
This option was not available via Lacie firmware (I read that on the manual, only for 5big2).

May be with your console and new kernel, is it possible now ?

I've got the firmware 18.2 and patch installed.


Version du Firmware: fvdw-sl 18.2 patched (d2nw2)
Kernel: Linux 4.14.133 #1 PREEMPT Wed Jul 17 14:46:56 CEST 2019


the kernel is not 4.6.6 only 4.14.133

If you have any idea to grant that, it would be great ;)

anyway, thanks for your answer and advice to do so. :thumbup

greetings
rudyparis
Donator VIP
Donator VIP
 
Posts: 13
Joined: Mon Jan 30, 2023 4:41 pm

Re: LaCie D2N2 and ISCSI target option ?

Postby fvdw » Mon Feb 13, 2023 6:26 pm

Hi, the kernel of d2n2 has support for iscsi target just like 5big2. So the instruction used for 5big2 can also be used for d2n2.
Note, We cannot use the old iscsci enterprise target package anymore as it is no longer maintained and not compatible with kernels 4,x and higher. But the newer kernels have native suport of iscsi target.
It has been a while since I looked at native iscsi target setup. I will look later to see which instructions to be used. However it is not an easy setup.
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Wed Feb 15, 2023 5:08 pm

Hi fvdw,

Thanks for your quick answer.
Looking forward to reading you about this subject ;)

I read something about "targetcli" on new kernel, but this "targetcli" doesn't appear in /bin of your firmware neither elsewhere.

Don't know if it is a road to follow or out of the subject :)

thanks for looking anymay

Regards,
rudyparis
Donator VIP
Donator VIP
 
Posts: 13
Joined: Mon Jan 30, 2023 4:41 pm

Re: LaCie D2N2 and ISCSI target option ?

Postby fvdw » Wed Feb 15, 2023 10:17 pm

Targetcli is indeed an application that can be used to setup a scsi target.This is a python application and requires an adapted python package but also a specific kernel module to be able to work. However there is a way to setup a target without using targetcli. Later this week I have time to look into that.
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Thu Feb 16, 2023 8:24 pm

Hi FVDW,

Thanks for looking into it, that's very kind of you.

regards,
rudyparis
Donator VIP
Donator VIP
 
Posts: 13
Joined: Mon Jan 30, 2023 4:41 pm

Re: LaCie D2N2 and ISCSI target option ?

Postby fvdw » Thu Feb 16, 2023 9:01 pm

Hi, as promised below some basic instructions to set up a iscsi target.

Note you will need to repeat all these commands after each reboot of the nas.
Solution for that is making a task that runs after each boot. The webinterface allows you to set such a task

Load required kernel modules
Code: Select all
modprobe target-core-file
modprobe target-core-iblock
modprobe target-core-pscsi
modprobe iscsi-target-mod

Note following modules will be loaded automatically by loading above mentioned modules
configfs
target-core-mod

You can check if the modules are loaded by using this command
Code: Select all
lsmod

Next mount configfs
Code: Select all
mount -t configfs none /sys/kernel/config

folder /var/run/dbus must be present
Code: Select all
mkdir /var/run/dbus

dbus daemon must be running
Code: Select all
dbus-launch --config-file=/etc/dbus-1/system.conf


Now we configure and start the target here we set up as example a target with size of 1073 MB
It is a file that will be present in folder /share/1000 and has name iscsci-lun0

create a fileio backstore
Code: Select all
cd /sys/kernel/config/target/core
mkdir -p fileio_0/fileio
echo "fd_dev_name=/share/1000/iscsi-lun0,fd_dev_size=1073741824" > fileio_0/fileio/control
echo 1 > fileio_0/fileio/attrib/emulate_write_cache
echo 1 > fileio_0/fileio/enable


create an iscsi target and a target portal group (TPG)
Code: Select all
mkdir /sys/kernel/config/target/iscsi
cd /sys/kernel/config/target/iscsi
mkdir iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65
mkdir iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1


create a LUN
Code: Select all
mkdir iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/lun/lun_0
ln -s ../core/fileio_0/fileio iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/lun/lun_0/data

enable it
Code: Select all
echo 1 > iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/enable

Create a network portal 3260 is port which will be used by the target)
Code: Select all
mkdir iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/np/0.0.0.0:3260

Disable authentication (unless you use an client that can handle authenciation, in that case you need to set it up differently)
Code: Select all
echo 0 > iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/attrib/authentication
echo 1 > iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/attrib/generate_node_acls

Allow write access for non authenticated initiators
Code: Select all
echo 0 > iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65/tpgt_1/attrib/demo_mode_write_protect


ready now you should be to connect with a client initiator and format the new drive and put files on it

Hope everything is clear, success
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Fri Feb 17, 2023 6:06 pm

Hi Fvdw,

What a hob !

I have a problem when using putty to connect my nas (as root and password : giveit2me) of course

these 2 instructions :
modprobe target-core-pscsi
modprobe iscsi-target-mod

they both ended : "-sh: modeprobe not found"


however the 2 first instructions seem ok, no error message for the 2 following instructions :
modprobe target-core-file
modprobe target-core-iblock

"dbus-launch --config-file=/etc/dbus-1/system.conf" ended with the following message:
Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file
-sh: Failed: not found
root@fvdwsl-base:/ # EOF in dbus-launch reading address from bus daemon
-sh: EOF: not found

Should I reinstall fully the firmware 18.2 and batch to get a proper installation,
Thanks for your advice,
rudyparis
Donator VIP
Donator VIP
 
Posts: 13
Joined: Mon Jan 30, 2023 4:41 pm

Re: LaCie D2N2 and ISCSI target option ?

Postby fvdw » Fri Feb 17, 2023 8:51 pm

they both ended : "-sh: modeprobe not found"

You must use modprobe not modeprobe.

About pid file.
I think you have launched the dbus daemon already once.
Reboot the nas and start over again with the procedue.
Rebooting the nas will delete the pid file

Ps I mentioned that it is not an easy setup...
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: LaCie D2N2 and ISCSI target option ?

Postby Jocko » Sat Feb 18, 2023 9:09 am

Hi

fvdw wrote:About pid file.
I think you have launched the dbus daemon already once.
If you have enabled zeroconf/bonjour service (avahi), dbus daemon is already running. So this step is useless.

You can check that by loading the system menu, tab afp/samba server
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Mon Feb 20, 2023 3:18 pm

Dear Fvdw,

I followed this day with more accuracy each steps of your instuctions, and with great pleasure, everything worked perfectly this time ;))

I could see on the Disk Manager windows 10 the target iscsu Lun created of 1GB !

I have 2 or 3 questions about what you wrote :

- you wrote : "Note you will need to repeat all these commands after each reboot of the nas.
Solution for that is making a task that runs after each boot. The webinterface allows you to set such a task"

Indeed when rebooting, everything has gone out. For perfectly understanding, the LUn created before has disappeared, but what about the potential data stored on it ? Is everything erased ?

You're talking about doing a task that runs after each boot, the data will be back when doing that ? I mean, the data are still somewhere on the hdd ? Sorry for my lack of knowledge but it's a bit confusing ;)

- Other question : you're referring of a webinterface allowing me to create such a task, could you tell me more about that ?

- Last question, have you planned or could you plan on the future console a way to create iscsi target (like in DSM for synology nas). ? I'm sure this will take some time for you, the users of your firmware will get a new service ;)

I will make a special donation for you when this subject will be closed for your kind support and all the time you spent for me, really appreciate. thanks

kindest regards
rudyparis
Donator VIP
Donator VIP
 
Posts: 13
Joined: Mon Jan 30, 2023 4:41 pm

Next

Return to Lacie D2 network vs2

Who is online

Users browsing this forum: No registered users and 2 guests

cron