Copy ZFS dataset with ACLs, share settings maintained

Status
Not open for further replies.

scurrier

Patron
Joined
Jan 2, 2014
Messages
297
Pretty much what the title says. Is there a way to copy a ZFS dataset that is set to Windows permissions and share type so that the ACLs and important share properties are maintained? I'd like to copy a ZFS dataset w/ snapshots and not have to redo all the permissions. Using a manual send/receive, I cannot get the target to take anything other than UNIX permissions and share type, even though the source is Windows permissions and share type.

Here's the command I'm currently using, if it helps.
zfs send -Rv backupone/bfirstmain/firstmain@auto-20180830.2202-30h | \
zfs recv -F -v \
-o recordsize=1M -x recordsize=1M \
-o compression=lz4 -x compression=lz4 \
-o "org.freenas:permissions_type=ACL" -x "org.freenas:permissions_type=ACL" \
-o readonly=off -x readonly=off \
firstvol/firstmain

I'm also trying to increase the record size and change the compression, but I'd give that up to keep the ACLs/share type if required.
I don't know what the org.freenas:permissions_type property does. I am just taking wild guesses at this point, thinking that since it's freenas-specific, it probably has something to do with what I want.

I'm surprised there is no way to manually "copy" (send/recv w/ FreeNAS special sauce for permissions/share) a dataset in the web GUI.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Since you're doing a block-level copy with zfs send/recv I would expect that windows ACLs would be copied natively together with the data. Are you finding that it isn't? or are you assuming that it isn't and looking to solve a problem that may or may not exist?
 
Joined
Jul 3, 2015
Messages
926
Pretty much what the title says. Is there a way to copy a ZFS dataset that is set to Windows permissions and share type so that the ACLs and important share properties are maintained? I'd like to copy a ZFS dataset w/ snapshots and not have to redo all the permissions. Using a manual send/receive, I cannot get the target to take anything other than UNIX permissions and share type, even though the source is Windows permissions and share type.

Here's the command I'm currently using, if it helps.
zfs send -Rv backupone/bfirstmain/firstmain@auto-20180830.2202-30h | \
zfs recv -F -v \
-o recordsize=1M -x recordsize=1M \
-o compression=lz4 -x compression=lz4 \
-o "org.freenas:permissions_type=ACL" -x "org.freenas:permissions_type=ACL" \
-o readonly=off -x readonly=off \
firstvol/firstmain

I'm also trying to increase the record size and change the compression, but I'd give that up to keep the ACLs/share type if required.
I don't know what the org.freenas:permissions_type property does. I am just taking wild guesses at this point, thinking that since it's freenas-specific, it probably has something to do with what I want.

I'm surprised there is no way to manually "copy" (send/recv w/ FreeNAS special sauce for permissions/share) a dataset in the web GUI.
Yes. This just works for me out of the box using snapshot scheduling with replication. Only things to note is the the replica won't auto create the share itself but the zfs dataset will be there along with the permissions etc. Finally depending on if you are using local users on each box or some directory service like AD the users need to marry up otherwise Bert may be given access to Mary's folder if you get me?
 

scurrier

Patron
Joined
Jan 2, 2014
Messages
297
Since you're doing a block-level copy with zfs send/recv I would expect that windows ACLs would be copied natively together with the data. Are you finding that it isn't? or are you assuming that it isn't and looking to solve a problem that may or may not exist?
The docs say that having UNIX perms/share set will "clobber" (their words) Windows perms/share type. But I admit I'm not sure if those perm/share type settings actually do anything on the filesystem or if they are just flags for FreeNAS to make better decisions with.

Tonight when the replication is finished I will test what happened.
 

scurrier

Patron
Joined
Jan 2, 2014
Messages
297
Yes. This just works for me out of the box using snapshot scheduling with replication.
I'm trying to do a one-time copy via send/receive, not schedule anything. But I suppose I could schedule replication, let it complete, then delete it the schedule. Seems clunky though.
 
Joined
Jul 3, 2015
Messages
926
I'm trying to do a one-time copy via send/receive, not schedule anything. But I suppose I could schedule replication, let it complete, then delete it the schedule. Seems clunky though.
I dont do it myself but on newer versions of FreeNAS I think you can create a single snapshot via the UI and replicate that. This should act the same as the scheduled snapshot I'd guess but without the schedule.
 
Status
Not open for further replies.
Top