[SOLVED] File flags compatibility (chflags/chattr) between Core and Scale?


I would like to know if the file flags on OpenZFS are compatible between FreeBSD and Linux.
On FreeBSD, the command is chflags, on Linux the command is chattr

If they are not compatible, it means that I should not use them with dataset replication between heterogeneous operating systems.

What file flags are you specifically concerned about? In SCALE we use the DOS-related flags and manipulate via ioctl.

I am mainly concerned by sappend and schange
Finally I have decided to check myself the file flags interoperability.

Flags that work on FreeBSD and Linux OpenZFS

  • sappend (append)
  • schange (immutable)

Flags that are preserved with zfs-send but without effect on TrueNAS Scale.

  • hidden
  • nodump
  • sparse
  • rdonly
  • sunlnk
  • system

Nevertheless, these flags are still preserved when retrieving back the dataset to FreeBSD.

The other flags are unsupported on OpenZFS


hidden | rdonly | system are preserved and used as-needed in SCALE.

1 Like

To conclude:

I can still use sappend and schange on TrueNAS Scale with their new Linux name (i)mmutable and (a)ppend.
Unfortunately I cannot use anymore sunlnk

According to @awalkerix the DOS attributes hidden, rdonly and system should still work for the Windows clients.

Well, SUNLINK is also exposed via ioctl if you need to use it. Remember these attrs are implemented internally in ZFS.

This is where I’ve plumbed in dosmode handling in middleware:

To give some context on ioctl details.


#define ZFS_NOUNLINK            0x0000002000000000ull

Indeed I would prefer a shell command like on FreeBSD, it is easier for me. :wink:

Fortunately the two most important flags schange and sappend are still configurable from the shell.