1

I am trying to copy from an Ubuntu machine to a OmniOS ZFS pool shared via NFS. When I run the below command, I get:

cp: failed to preserve ownership for `./test.txt': Invalid argument

The thing is that the file copies fine but the permissions look like this at the destination:

-rw-------   1 nobody nogroup   7 Mar  4 21:35 test.txt

I then try:

chown root test.txt
chown: changing ownership of `test.txt': Invalid argument

I found this thread that is similar, but his/her error is more explicit with an "operation not permitted" error, whereas mine is "Invalid argument".

NFS is shared out from the ZFS server via below:

cat /etc/dfs/sharetab
/pool1/backup      -       nfs     sec=sys,rw=@192.168.1.21,root=@192.168.1.21
user785179
  • 131
  • 1
  • 5

2 Answers2

2

The issue is because I am mounting as NFSv4, and version 4 treats root permissions as 'nobody'. Forcing my NFS client to use NFS version 3 resolved my issue.

nfs -t nfs -o nfsvers=3,proto=tcp server:/pool1/backup /backup
user785179
  • 131
  • 1
  • 5
1

You could also change the owner-group through idmap

into /etc/idmapd.conf

[Mapping]

Nobody-User = anyUserYouChoose
Nobody-Group = anyUserYouChoose
Philippe Gachoud
  • 1,517
  • 15
  • 20