ISCSI export external Harddrives

vzsze

Cadet
Joined
Jan 28, 2022
Messages
3
Hi,

I've been able to share external (USB) HDDs via ISCSI in FreeNAS. That way I could use non native file systems and was able to unplug them and use them directly in a different computer if needed. Extents with external HDDs that were created with FreeNAS keep working in TrueNAS, but I can't seem to create extends with newly added external HDDs. They are not listed as device on the ISCSI add extends configuration dialog. Only a lot of unrelated snapshots are listed there.

How can I export a disk directly via ISCSI in TrueNAS (Version: TrueNAS-12.0-U7)?

Regards, Rolf
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That hasn't been supported for a very long time, as far as I know.

It used to be that in the days of pre-all-ZFS FreeNAS, you could directly export a device using iSCSI. I could imagine that such configurations might still work, but the GUI support for managing this is probably long gone.
 

vzsze

Cadet
Joined
Jan 28, 2022
Messages
3
I think I started using it with FreeNAS 11-something and ZFS as the main FS. I used the GUI to set it up and it is still working. Is there a command line guide of how to setup ISCSI?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Those features may still be available in Xigmanas (which forked from FreeNAS as Nas4Free before the rename).

Their UI sucks (and it's really hard to follow the logic of how to get a disk/pool formatted), but the features are a specific subset and the OS is still very light.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I think I started using it with FreeNAS 11-something and ZFS as the main FS. I used the GUI to set it up and it is still working. Is there a command line guide of how to setup ISCSI?

No, TrueNAS is an appliance OS that is managed via the GUI, or, alternatively, via the API. The GUI does not just edit system files to implement services; it actually stores the data and uses it to build the system files to implement services. Editing the files directly will just result in them being wiped out eventually, because the system isn't aware of -- and isn't expecting you to make -- any changes made to the files.

The possible option here would be some "database hacking". It's totally within the realm of possibility that old device-oriented iSCSI still works, though I suspect that you're wrong about this being supported in FreeNAS 11. FreeNAS upgrades have always been handled as database migrations, so an iSCSI setup that previously included a physical device reference instead of a zvol or file would probably have survived unchanged. Might even be displayed in the current GUI.

What's probably gone away is the option to PICK a physical device instead of a zvol. I think if I was really desperate to do this, I'd look at the database contents describing an existing physical device iSCSI export, then create a new zvol, and overwrite whatever bits would be appropriate with the physical device.

This is potentially hazardous to your device, your data, your health, your sanity, etc., and is in no way supported, advisable, clever, or sane. But I would not be shocked if it could be done.
 

vzsze

Cadet
Joined
Jan 28, 2022
Messages
3
No, TrueNAS is an appliance OS that is managed via the GUI, or, alternatively, via the API. The GUI does not just edit system files to implement services; it actually stores the data and uses it to build the system files to implement services. Editing the files directly will just result in them being wiped out eventually, because the system isn't aware of -- and isn't expecting you to make -- any changes made to the files.
Thank you for this clarification. I guess it's not possible to do it via the API then?
The possible option here would be some "database hacking". It's totally within the realm of possibility that old device-oriented iSCSI still works, though I suspect that you're wrong about this being supported in FreeNAS 11. FreeNAS upgrades have always been handled as database migrations, so an iSCSI setup that previously included a physical device reference instead of a zvol or file would probably have survived unchanged. Might even be displayed in the current GUI.

What's probably gone away is the option to PICK a physical device instead of a zvol.
The last disk that I configured that way is from March 2020 and I kept my system up to date. It must have been FreeNAS 11.x. That device is referenced via a serial_lunid, but I was able to pick the device in the GUI. An older disk ist referenced as da1, which I find not suboptimal since device names can change.

The help text says "Only appears if Device is selected. Select the unformatted disk, controller, or zvol snapshot."
I think if I was really desperate to do this, I'd look at the database contents describing an existing physical device iSCSI export, then create a new zvol, and overwrite whatever bits would be appropriate with the physical device.

This is potentially hazardous to your device, your data, your health, your sanity, etc., and is in no way supported, advisable, clever, or sane. But I would not be shocked if it could be done.
Thanks for describing the hack. I'm still hoping that there is a safer way to do this.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I guess it's not possible to do it via the API then?

I cannot say because I haven't tried. Generally speaking, it is unusual, but not unheard-of, for that possibility. API's are often just exposing the same capabilities a GUI offers, often because the GUI is just calling the API...

An older disk ist referenced as da1, which I find not suboptimal since device names can change.

That would be among the reasons I suspect this would have been difficult to support.

It must have been FreeNAS 11.x.

Well, I'm not callin' you a liar. ;-) It just stopped being "a thing" I saw on the forum a really long time ago, and all of this stuff was reorganized with the transition to ZFS-only. Since you've actually used this for something more than trite experimentation, you actually know more than I do. I do have fuzzy recollection of hearing that it was "going away" which is why I stepped in with an answer. I expect the underlying bits still work fine.
 
Top