iSCSI data scrubbing & accessibility via console

TrumanHW

Contributor
Joined
Apr 17, 2018
Messages
197
I have limited experience with iSCSI (though I have used it via TrueNAS).

Without creating an iSCSI share & adding an initiator (PITA on MacOS) my recollection is that the data isn't accessible via the TrueNAS Web interface's console. I'm pretty sure TrueNAS can't R/W in HFS+ of APFS, and even assume it can't R/W in NTFS. If TrueNAS can't R/W using many (or even any) of the FS 'languages' required for a system to use iSCSI ... how can TrueNAS scrub them? As in, how would it know what to checksum if it doesn't know the range (like the $MFT or Catalog in MacOS -- the FS's table of contents if you will) short of inferring objects (files+directories) by "carving" to locate a file's header and footer are from which to identify the range of a file to checksum them in the first place ... as the Peer Machine has block level control over the data.

I hope this makes sense and apologize if my diction or question was difficult to decipher. I did look at the TrueNAS iSCSI section but this is more about how TrueNAS works than how to administrate the system ... so thanks in advance to anyone who can A, understand what I'm asking and B, reply with this obscure question's answer. :smile:
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
TrueNAS guarantees the safety (via redundancy, checksums, and scrubbing) of the underlying zvol block device. TrueNAS doesn't see HFS+, NTFS, or even another ZFS filesystem inside of a zvol - it just sees a series of bits that it will faithfully represent the requested state of. Think of it as a disk that will never return a bad sector.

Because you're presenting this block device to the client system, consistency of the filesystem on top of that block device is the client OS's responsibility. If the client does something that results in corruption at the filesystem level, but is otherwise a valid request to a block device - for example, you decide to sudo dd if=/dev/random of=/dev/your_iSCSI_drive from the guest OS - well, as far as TrueNAS knows, it's intentional, and it's going to do just that.

What it will protect you from is a situation where perhaps your local drive would have developed for a bad sector due to mechanical or electrical failure - whereas your local drive might return an error and present a need to repair the filesystem, TrueNAS will use redundancy from the pool where the zvol resides to transparently reconstruct the correct data and return that - with your client OS never knowing anything went wrong.

You can of course present a native ZFS filesystem to your Mac via a file sharing protocol such as SMB or NFS, and at that point ZFS will have awareness of the files themselves.
 

TrumanHW

Contributor
Joined
Apr 17, 2018
Messages
197
TrueNAS guarantees the safety (via redundancy, checksums, and scrubbing) of the underlying zvol block device. TrueNAS doesn't see HFS+, NTFS, or even another ZFS filesystem inside of a zvol - it just sees a series of bits that it will faithfully represent the requested state of. Think of it as a disk that will never return a bad sector.

Because you're presenting this block device to the client system, consistency of the filesystem on top of that block device is the client OS's responsibility. If the client does something that results in corruption at the filesystem level, but is otherwise a valid request to a block device - for example, you decide to sudo dd if=/dev/random of=/dev/your_iSCSI_drive from the guest OS - well, as far as TrueNAS knows, it's intentional, and it's going to do just that.

What it will protect you from is a situation where perhaps your local drive would have developed for a bad sector due to mechanical or electrical failure - whereas your local drive might return an error and present a need to repair the filesystem, TrueNAS will use redundancy from the pool where the zvol resides to transparently reconstruct the correct data and return that - with your client OS never knowing anything went wrong.

You can of course present a native ZFS filesystem to your Mac via a file sharing protocol such as SMB or NFS, and at that point ZFS will have awareness of the files themselves.

Wow, you are freaking smart (and knowledgeable!!). VERY clearly written.
You must be invaluable to whichever company you work with. Thank you!

Perhaps you implied this answer, but just to clarify an outstanding question I have...
Can ZFS / TN can still scrub iSCSI even though it doesn't know what the objects are?
Or is that something that differentiates the level of protection between iSCSI & SMB..?
It wouldn't be unbelievable if it can scrub the data, it'd just be surprising & impressive.

Thanks again
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Can ZFS / TN can still scrub iSCSI even though it doesn't know what the objects are?
Of course. It will guarantee the integrity of the data written to disk. It can't guarantee the consistency of the underlying filesystem, of course, because it doesn't know anything about that.
 
Top