NFS change ownership issue

9,643

This is resolved. The issue was that we changed the uid of contentmanager user on all client machines so that uid is unique.

The issue looks like was idmapd had cached the earlier uids . Clearing the NFS cache on all client machines resolved the issue.

sudo nfsidmap -c
Share:
9,643

Related videos on Youtube

user3744406
Author by

user3744406

Updated on September 18, 2022

Comments

  • user3744406
    user3744406 almost 2 years

    We are accessing NFS mounts across three hosts. The issue for us is that when we change the ownership of a directory on NFS mount on the server, the ownership changes are not taking place on the client. It is getting changed to nobody on the client. The issue can be seen for a particular user , for other users it is working fine. The user in question is the following user.

    $ id contentmanager
    uid=506(contentmanager) gid=500(admin) groups=500(admin)
    

    UID is same on both client and server machines.

    Also, if we change the ownership to contentmanager manually on the client, it is getting changed to nobody user. But if changed to some other user, it works fine.

    Please find /etc/exports for the particular directory on the server.

    /shareddata/share       *(rw,no_root_squash,sync)
    

    On the client machine, it is mounted as follows

    lnxq-004:/shareddata/share  /data/share  nfs   vers=3,rw   0  0    
    

    Example on the Server:

    $ sudo chown contentmanager test
    $ ls -l
    -rw-rw-r--  1 contentmanager admin    0 Aug 20 23:08 test
    
    $ ls -ln test
     -rw-rw-r-- 1 506 500 0 Aug 20 23:08 test
    

    Example on the Client:

    $ ls -l
    -rw-rw-r--  1 nobody admin    0 Aug 20 23:08 test
    
    $ ls -ln test
    -rw-rw-r-- 1 99 500 0 Aug 20 23:08 test
    

    This is the issue where the ownership is not getting changed to contentmanager

    • thrig
      thrig almost 9 years
      What does id nobody show on the client?
    • user3744406
      user3744406 almost 9 years
      ]$ id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody)
    • user3744406
      user3744406 almost 9 years
      from the server: $ id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody)
    • Mark Plotnick
      Mark Plotnick almost 9 years
      Can you run ls -ln on the client and server?
    • Mark Plotnick
      Mark Plotnick almost 9 years
      Can you run ls -ln test on the client and server ? I'd like to see the numeric uid of the file the client thinks I'd owned by nobody.
    • user3744406
      user3744406 almost 9 years
      server$$ ls -ln test -rw-rw-r-- 1 506 500 0 Aug 20 23:08 test client$$ ls -ln test -rw-rw-r-- 1 99 500 0 Aug 20 23:08 test
  • anthony
    anthony over 7 years
    I did this... and now the uid's and gid's of the files on the client are nobody. and I see a logged errors name 'user@localdomain' does not map into domain 'nisdomain'. Arrrgghhhhh! 'hostdomain' is the domain of the machine