Now I want to rsync to a NAS over the network, but I’m not sure how to set the ZFS dataset ACL type. I’ve read the TrueNAS ACL primer.
Two options:
SMB/NFS4 → requires ACL mode passthrough
POSIX → no ACL mode options
Since I’ll only use rsync (not SMB/NFS4), POSIX seems preferable.
However, ChatGPT and Claude recommend passthrough:
zfs set aclmode=passthrough pool/dataset
zfs set aclinherit=passthrough pool/dataset
zfs set xattr=sa pool/dataset # Store xattrs in system attributes for better performance
Which is the better choice? If unclear, I’ll test by restoring to check ACLs, ownership, and extended attributes.
I did an experiment to compare two different acltype: nfsv4 and posix. Two dataset are created:
zfs get all tank/linux-backup | grep acl
tank/linux-backup aclmode discard local
tank/linux-backup aclinherit discard local
tank/linux-backup acltype posix local
zfs get all tank/share | grep acl
tank/share aclmode restricted local
tank/share aclinherit passthrough local
tank/share acltype nfsv4 local
Using rsync to backup from EXT4 through ssh protocol. I found that only posix didn’t complain permission error. I verified that in NAS it preserve my UID/GID from the original EXT4.
ext4 uses POSIX ACLs, ergo if you want to preserve their permissions you need to put them on a POSIX ACL type dataset. This doesn’t impact file ownership (but note that original file ownership may be meaningless on TrueNAS unless you’re taking steps to ensure that IDs match between your servers).
My goal is to restore the exact ACL, UID/GID and extended attributes in case the server that I backup from failed. I don’t really care if TrueNAS can recognize/respect the ownership of files or not.
Have you ever tried restoring from ZFS with posixacltype?
I am aware of no differences between ZFS and EXT4 that would impact the ability to restore over rsync (assuming POSIX acltype is used). Don’t rely on chatgpt or claude. They’re both giving nonsense results. One thing that tends to trip up novices is that they don’t realize certain permissions / ownership related operations basically require you to be root.