LaCie D2N2 and ISCSI target option ?

Re: LaCie D2N2 and ISCSI target option ?

Postby rudyparis » Mon Feb 20, 2023 7:38 pm

Hi fvdw,

An other question :))

When I put a text file on my new LUN mounted on windows via iscs initiator on the created a volume E: via disk manager.
Everything is fine.
Now, I'd like to erase the file, and there is no option to delete the text file.
weird ! ...

Later on, if I want to delete your target Lun example, I guess space of 1GB or 1.072Go is allocated on the HDD, how can we procede to give back these 1 GB ?

thanks for your answer.

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 » Tue Feb 21, 2023 9:34 pm

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 ?

The file created will still exist after reboot so do not recreate it after reboot (ommit the step were the file is created) and reuse it and your data will still be there.


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

You must make a (bourne or bash) shell command file that contains all commands to be execute and run this command file after reboot using the task manager of the firmware

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 ;)

Not at this moment, there are not enough users requesting this to justify the effort. Maybe we will make a basic script that can be used to setup a simple target, in principle the commands a gave you.
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: LaCie D2N2 and ISCSI target option ?

Postby fvdw » Tue Feb 21, 2023 9:40 pm

To delete the file
At linux prompt give this command after reboot.
Code: Select all
rm -f /share/1000/iscsi-lun0


This command will fail when the file is in use so use it after reboot
when it is not in use.
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 24, 2023 3:44 pm

Dear fvdw,

If you have spare time to answer, I still have questions.
I succeeded in doing a bash file, added to cron-boot directory and everything works perfectly following your steps for creating this LUN of 1GB.

Following your last quotation : "The file created will still exist after reboot so do not recreate it after reboot (ommit the step were the file is created) and reuse it and your data will still be there."

I need some extra explanations about which step(s) I should omit to avoid creating forever the same LUN. I've tried different configurations, without the step 'backfileio', without creating the LUN since it is already created and so on, but without all your steps, the LUN doesn't appear with "Windows initiator"
Could you be more accurate about the steps I should omit to keep my data after a reboot ?

fvdw: to be honest I never use iscsi target, so for me its a also trial.
What happens if you reuse the commands for creating a fileio backstore? is a new empty file created or not ?
I think if the file exists and has the correct size it will not be created again but reused
The commands to create/add the fileio backstore should be repeated to fill configfs file system with the required information, I don't what happens if a file with the mentioned name and size already exists, just try I suggest


Another question : regarding the "iqn" name... :
in the folder : etc/iscsi/ if I use 'cat initiatorname-iscsi" I have : iqn.2012-11.fvdw-sl.nas:e0c73588968d"

which is different from the one you used in your example, as a reminder you put : "iqn.2003-01.org.linux-iscsi.fvdwsl-base.armv5tel:sn.ed2fb2411a65"

And if I use from root the command line :" iscsi-iname", I have iqn.2005-03.org.open-iscsi:4695cfcaa788"

Of course, the 12 last digits change everytime I ask the command, but the beginning is the same :"iqn.2005-03.org.open-iscsi"

Which iqn name should I use to create my own LUN of 32 GB? and how do I give it a easy name (for exemple PI_OS).

fvdw: you can use any name, as long as you follow the iSCSI Qualified Name Format

A quote from vmware website about iscsi target naming.

The iSCSI Qualified Name (IQN) format takes the form iqn.yyyy-mm.naming-authority:unique name, where:

yyyy-mm is the year and month when the naming authority was established.
naming-authority is the reverse syntax of the Internet domain name of the naming authority. For example, the iscsi.vmware.com naming authority can have the iSCSI qualified name form of iqn.1998-01.com.vmware.iscsi. The name indicates that the vmware.com domain name was registered in January of 1998, and iscsi is a subdomain, maintained by vmware.com.
unique name is any name you want to use, for example, the name of your host. The naming authority must make sure that any names assigned following the colon are unique, such as:
iqn.1998-01.com.vmware.iscsi:name1
iqn.1998-01.com.vmware.iscsi:name2
iqn.1998-01.com.vmware.iscsi:name999


.


Hope I won't bother you with my questions, LUN is bit new to me as you may have guessed ;) but the challenge is interesting especially for using my raspberry Pi with retropie using the target LUN.


Moreover, as promised, I make an extra donation today of 20€ for both of you Fvdw & Jock for your kind support. Drink a beer at your sake ;)

Looking forward to reading 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 » Sat Feb 25, 2023 2:57 pm

I have put some answers in your post.

ps an example of a basic command file to create a target can be found here https://android.googlesource.com/kernel/common/+/refs/heads/upstream-f2fs-stable-linux-4.19.y/Documentation/target/target-export-device?autodive=0%2F%2F%2F%2F%2F%2F
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Previous

Return to Lacie D2 network vs2

Who is online

Users browsing this forum: No registered users and 1 guest