I want that my client NFS have RW privileges to my shared mounted FS without have to create any user on my client machine that match with the ID user on the NFS server machine.
On my NFS server I export the NFS as below:
/mnt/ugp-repmed *(fsid=1,rw,sync,all_squash,no_subtree_check,anonuid=996,anongid=994)
the uID and gID are:
# id irods
uid=996(irods) gid=994(irods) groups=994(irods)
At my client machine I mounted using this command because there is no option to use uid and gid for NFS mount.
mount.nfs -o resvport 145.117.144.230:/mnt/ugp-repmed/ /mnt/ugp-repmed/
So, when I copy files to the shared NFS directory, on the server it applies the irods user and group. It is what I want. But at my client I do not have the irods user. the user ID 996 and gpID 994 at my client belongs to another user (davfs2). When I mount at the client every files belongs to this group and user.
# ls -ld /mnt/ugp-repmed/landing/
drwxrwxrwx. 4 davfs2 davfs2 144 Feb 28 08:22 /mnt/ugp-repmed/landing/
When I try to copy a directory to the NFS shared FS first I change the owners with chown -R davfs2.davfs2 Overige-Joana-s1-irodsprodvm/
and I copy. It creates the directory and the files. The directory and the files have the irods owner, which is correct. But the files have no privileges of RW. SERVER >>
# ls -l /mnt/ugp-repmed/landing/
total 8
drwxrwxrwx 2 pfdegeest irods 2464 Mar 1 12:22 Overige-Joana-s1
drwxr-xr-x 2 irods irods 2400 Mar 2 04:40 Overige-Joana-s1-irodsprodvm
drwxrwxrwx 2 pfdegeest irods 2432 Mar 1 12:51 Overige-Joana-s2
[root@fedora20 ~]# ls -l /mnt/ugp-repmed/landing/Overige-Joana-s1-irodsprodvm/
total 0
---------- 1 irods irods 0 Dec 26 1972 20161416_S1_L001_R1_001.fastq.gz
---------- 1 irods irods 0 Dec 26 1972 20161416_S1_L001_R2_001.fastq.gz
---------- 1 irods irods 0 Dec 26 1972 20161416_S1_L002_R1_001.fastq.gz
but before copy I checked if on the client I have RW privileges. CLIENT >>
# ls -l
total 8
-rw-------. 1 root root 949 Feb 20 09:28 anaconda-ks.cfg
drwxr-xr-x. 2 root root 36 Feb 20 10:47 Downloads
drwxrwxrwx. 2 davfs2 davfs2 4096 Mar 2 03:18 Overige-Joana-s1-irodsprodvm
[root@irodsprodvm ~]# ls -l Overige-Joana-s1-irodsprodvm/
total 4
-rwxrwxrwx. 1 davfs2 davfs2 0 Mar 2 03:18 20161416_S1_L001_R1_001.fastq.gz
-rwxrwxrwx. 1 davfs2 davfs2 0 Mar 2 03:18 20161416_S1_L001_R2_001.fastq.gz
-rwxrwxrwx. 1 davfs2 davfs2 0 Mar 2 03:18 20161416_S1_L002_R1_001.fastq.gz
I will mount the same NFS sever directory in different machines (linux, Mac, Windows). And all the files that I will copy to this directory has to have at least the irods group. I am trying to figure out some way to not have to create all users and group with same ID on all client machines. Any clue? Thanks!
I solved. I used >>
/mnt/ugp-repmed *(fsid=1,rw,sync,no_root_squash,no_subtree_check)