Ubuntu: File permissions on NFS mount show up as 'nobody' after upgrading to 14.04


I have an Ubuntu 12.04 server that exports a couple of filesystems over NFS.

server$ cat /etc/exports  /home,anonuid=65534,anongid=65534,async,no_subtree_check)  /stuff,anonuid=65534,anongid=65534,async,no_subtree_check)  /stuff,anonuid=65534,anongid=65534,async,no_subtree_check)  

I also have a client that mounts them:

client$ cat /etc/fstab  ...  server:/home    /home       nfs hard,intr,rsize=8192,wsize=8192,_netdev 0 0  server:/stuff   /server/stuff   nfs hard,intr,rsize=8192,wsize=8192,_netdev 0 0  

The client's IP is in the 192.168.42.x range. It was running Ubuntu 10.04 until yesterday. NFS worked fine, more or less (sometimes it wouldn't automount on boot, but I had a cron script to detect and fix that).

I upgraded the client to Ubuntu 12.04 yesterday and rebooted. NFS continued to work fine.

I upgraded the client to Ubuntu 14.04 today and rebooted. Now NFS is mounted but all file ownership information is mapped to nobody:4294967294:

client$ ls -ld /home/weblate  drwxr-xr-x   5 nobody 4294967294     4096 Jan 29  2014 weblate  

Why is that and what do I need to do to make file ownership work again?


The vital clue showed up in /var/log/syslog:

Sep 16 13:11:07 client nfsidmap[7340]: nss_getpwnam: name 'www-data@lan' does not map into domain 'localdomain'  

combined with this excerpt from NFSv4Howto

If all directory listings show just "nobody" and "nogroup" instead of real user and group names, then you might want to check the Domain parameter set in /etc/idmapd.conf. NFSv4 client and server should be in the same domain.

and this comment in /etc/idmap.conf:

# set your own domain here, if id differs from FQDN minus hostname  # Domain = localdomain  

So turns out my server thought its domain was lan:

server$ hostname -f  server.lan    server$ grep server /etc/hosts   server.lan server  

while my client didn't have a domain:

client$ hostname -f  client    client$ grep client /etc/hosts   client  

The fix: edit /etc/hosts on the client to read   client.lan client  

and reboot.


I resolved my issue by this method. Open the file /etc/nfsmount.conf and find Nfsvers=.

Uncomment that line and write the NFS version which is supported by your server. Mine was 3 so I wrote:


The I restarted the NFS server.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »