I have a zpool from a system with different users than the machine I am working on that I want to copy data from. Therefore, I need to import and mount the zpool with read permissions. However, since the UIDs don't match, I don't have permissions for many files.
I don't want to change the permissions on the zpool, just read from it.
I could read the files as root and transfer ownership of the local copies to the desired local user, but I don't have
sudo cp or
sudo chown permissions on this (multi-user) system.
I do have
sudo mount and
sudo zfs permissions though.
With a non-zfs system, I would
sudo mount -o uid=$UID,gid=$GID,umask=0770[,ro] <device> <mountpoint>or something like that,
cp <mountpoint>/<source> <target>the files I need, and
sudo umount <mountpoint>
How can I achieve the same for a zfs system?
I could not find any similar option for
I already tried to
sudo zpool import -N <pool>,
sudo zfs set mountpoint=legacy <pool>,
sudo mount -t zfs -o uid=$UID,gid=$GID,umask=0770[,ro] <pool> ,<mountpoint>
cp <mountpoint>/<source> <target>the files I need,
sudo umount <mountpoint>,
- `sudo zfs set mountpoint= , and
sudo zpool export <pool>,
mount.zfs does not support these options either.