Another Filesystem over ZFS with iSCSI?

thomas-hn

Explorer
Joined
Aug 2, 2020
Messages
82
Hello,

maybe I have some misunderstandings with iSCSI, but if TrueNAs provides some storage as iSCSI Target this will be seen by the iSCSI Initiator as a block device. So the initiator will format it using a filesystem like Ext4, NTFS, ZFS, etc.
However, I assume that TrueNAS will locate the iSCSI Target on a ZFS pool (otherwise the data would not be protected). Does this mean that at the end we will have a filesystem (Initiator Filesystem) on top of ZFS (TrueNAS)? Does this not make any problems?

Thanks,

Thomas
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
No, because TrueNAS can only provide a zvol, not a dataset as the iSCSI target. A zvol is like a virtual disk image, and can't be mounted within TrueNAS as a file system. It only appears as a block device within TrueNAS, although the Storage->Pools view shows them within your zpool hierarchy. See https://www.truenas.com/docs/core/storage/pools/zvols/.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
As far as the iSCSI consumer goes, it's just blocks... whatever filesystem is put on those blocks matters not to ZFS/TrueNAS. It will look after the integrity of those blocks and will store and retrieve them reliably according to the rules of ZFS (ZVOLs).

TrueNAS doesn't get involved in looking inside the blocks or trying to understand the filesystem structure for ZVOLs, so no harm will come to it as a result of being on TrueNAS, but you do need to think about ZFS pool layout and the fact that it's a copy on write system when you're designing your system to support other systems.
 

thomas-hn

Explorer
Joined
Aug 2, 2020
Messages
82
Thanks so much for your help.
If I understand correctly, this means that I have all "ZFS data protection" features like RAIDZ, Snapshots, etc. available when using ZVOLs for ISCSI, right?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
If I understand correctly, this means that I have all "ZFS data protection" features like RAIDZ, Snapshots, etc. available when using ZVOLs for ISCSI, right?

Yes, exactly.
 

thomas-hn

Explorer
Joined
Aug 2, 2020
Messages
82
One last question:
Is it possible (without any problems) that the iSCSI Initiator uses the provided block device for ZFS or is it better to stay with some other filesystem like Ext3?
Is there a chance that the underlying ZFS part (the RAIDZ configuration for example) on the iSCSI Target (TrueNAS) will negatively interact with the ZFS which will be "on top" by the iSCSI Initiator?

Thanks.
 

Herr_Merlin

Patron
Joined
Oct 25, 2019
Messages
200
it's a block and thats it.
ZFS below will not notice whats inside.
The only questions would be why you want to use ZFS over iSCSI? Meaning running ZFS insided the ZVOL, which is exposed by the iSCSI
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
You need to consider the overhead...

ZFS stores parity to allow it to check each block for errors.

If you store ZFS on ZFS, you calculate parity for the real blocks and for the parity blocks again on top of the originals.

If you don't mind the overhead, there's nothing technically wrong with doing that, but it will cost you both capacity and performance to do it.
 

thomas-hn

Explorer
Joined
Aug 2, 2020
Messages
82
The only questions would be why you want to use ZFS over iSCSI?

Thanks for your reply.
It is not about that I really want to do it, it is more about if it makes sense or which other filesystems is better to use inside a ZVOL.
My thoughts are about: On ZVOL level I only have snapshots of the whole block device, right? So having a ZFS inside the ZVOL would allow for easier snapshot handling on file level. Any further experiences on this? Which filesystems would you use inside a ZVOL and why?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Thanks for your reply.
It is not about that I really want to do it, it is more about if it makes sense or which other filesystems is better to use inside a ZVOL.
My thoughts are about: On ZVOL level I only have snapshots of the whole block device, right? So having a ZFS inside the ZVOL would allow for easier snapshot handling on file level. Any further experiences on this? Which filesystems would you use inside a ZVOL and why?

Yes, snapshots of a zvol apply to the whole zvol virtual block device. Running ZFS inside the zvol allows for snapshots on datasets within the pool inside the zvol. There aren't any file-level snapshots.

The typical use case for zvols is remote iSCSI disks for VMs, so typically it would be NTFS for Windows VMs or ext2/3/4 for Linux VMs.
 
Top