4

I feel like I am missing something very simple / basic here, but I wasn't able to figure out how to mount a ZFS dataset such that the mount point (root directory) has a given uid/gid ownership? Something along the lines of:

root# zfs mount -o uid=[uid] -o gid=[gid] ....
Saurabh Nanda
  • 489
  • 1
  • 8
  • 20
  • 2
    I doubt that `uid` and `gid` are valid mount options for ZFS and you rather have to `chown` the mounted filesystem root. – Thomas Mar 09 '19 at 17:17

1 Answers1

8

The ownership of the (root) directory is a property of that directory. If you want to change it, you have todo this once the filesystem is mounted. This has nothing todo with zfs. Only filesystems drivers for filesystems like FAT or VFAT which do not have file ownership as a built-in property allow you to set the user/group at mount-time.

So to answer your question

# zfs mount mypool/myzfs
# chown myuser:mygroup /mypool/myzfs

is all it takes.

Tobi Oetiker
  • 1,842
  • 13
  • 12