ubuntu / zsys

ZSys daemon and client for zfs systems
GNU General Public License v3.0
301 stars 43 forks source link

User dataset in a parent dataset #222

Open jarrodsfarrell opened 2 years ago

jarrodsfarrell commented 2 years ago

I'm planing to have a few users with a shared quota so I created a dataset to hold them. Name's aren't actual, mind. storage/USERDATA/group-of-friends Create my user with adduser and get a dataset storage/USERDATA/friend_xxx Move them

# zfs rename storage/USERDATA/friend_xxx storage/USERDATA/group-of-friends/friend_xxx

But I can't create a user snapshot for that user

# zsysctl state save -u friend test-state
ERROR couldn't save state for user "friend": user "friend" doesn't exist 

zsysd seems to recognize the group and user dataset as unmanaged (Under UnmanagedDatasets in zsysctl service dump) so correct it by setting the correct bootfs-datasets for the group-of-friends dataset zfs set com.ubuntu.zsys:bootfs-datasets=os/ROOT/this-machine storage/USERDATA/group-of-friends But group-of-friends is now considered a "User" in zsysctl service dump, however it does list the friend_xxx dataset below it. Okay I suppose, lets try creating a snapshot.

# zsysctl state save -u friend test-snapshot
ERROR couldn't save state for user "friend": user "friend" doesn't exist

The parent dataset?

# zsysctl state save -u group-of-friends test-snapshot
ERROR Permission denied: Couldn't retrieve user for "group-of-friends": user: unknown user group-of-friends 

Oh. Is there any way to make a parent dataset work in zsys or is it just not supported?