Change uid gid when doing mount command

Viewed 2819

In /etc/exports, I configured like that
/var/vols/tzhong *(rw,sync,anonuid=1999,anongid=1999,root_squash)
If I mount the nfs folder /var/vols/tzhong to my local folder /mnt/tzhong. I use root user to create a file under /mnt/tzhong, the file ownership will be 1999:1999. Is that possible to change the uid and gid when doing the mount command? Something like below.

mount -t nfs4 -o uid=2000 -o gid=2000 192.168.1.123:/var/vols/tzhong /mnt/tzhong

So the ownership of folder /mnt/tzhong will be 2000:2000. Also, all the files created under /mnt/tzhong will be 2000:2000.
But, actually, the command is failed with mount.nfs4: an incorrect mount option was specified.

0 Answers
Related