3

I have a ZFS filesystem on an external drive, but the user ID of my accounts don't match between computers. Is there a way to map the UID when mounting (without actually changing it on the filesystem) so that files which are owned by, for example, uid 501, appear as owned by uid 1000? Ideally there's a method that can do this directly, without resorting to bind mounts or overlay filesystems.

I've read that linux supports this functionality natively since 5.12, and that it even should be possible to map IDs in a way that is transparent to the filesystem driver itself, but I can't figure out how to achieve this on the command line.

I'm running Fedora 42 with linux kernel version 6.15.4-200 and zfs release 2.3.3-1 from the zfsonlinux.org fedora repository.


The ID-mapped mount functionality now seems to exist in the mount(8) command as the option --map-users id-mount:id-host:id-range. Using an OpenZSH internal option to ignore errors when using the regular "mount" command (as opposed to zfs mount), I've tried:

sudo mount -tzfs -o zfsutil --map-users 1000:501:1 mypool/myfiles /mnt/mypool/myfiles 

But this did not seem to map anything.

0

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.