[CentOS] RESOLVED: NFS Mount: files owned by nobody

Wed Mar 19 23:48:10 UTC 2014
Lists <lists at benjamindsmith.com>

On 03/19/2014 02:44 PM, Ljubomir Ljubojevic wrote:
>> >
> It is very strange that client can mount directory on DIFFERENT SERVER?
> It looks like you have DNS/IP issues on your network?
>
> I used autofs and IP address to point it to desired server, to avoid
> possible DNS problems.

I've resolved this issue, in a way that both uses the server names 
(instead of IP) but avoids DNS problems also and allows you to use 
shares from multiple servers. Every instruction I read indicated that 
the hostname value was important. Careful scrutinizing of the config 
file reveals that there are really two values that are important, so 
here's my rough instruction:

1) /etc/idmapd.conf
# Set domain to the domain name shared by your NFS servers.
Domain: mycompany.com
Set local-realms to the name of the nfs servers you'll be using. THIS 
WASN'T MENTIONED ELSEWHERE.
Local-Realms: nfs1.mycompany.com,nfs2.mycompany.com
# make the above changes on all the servers in question.

2) /etc/hosts: list with all the NFS servers you specified in 
local-realms above. This way DNS errors don't make
your servers get "hung"
1.2.3.4    nfs1.mycompany.com
1.2.3.5    nfs2.mycompany.com

3) Make sure you synchronize your /etc/passwd files so that the account 
IDs match up or you'll get very strange results.

4) Reboot EVERYTHING. Restarting services (in my case) was not enough. 
For documentation's sake, I restarted
rpcidmapd, nfslock, and nfs, but didn't get the correct permissions 
until reboot. It doesn't seem important to run the nfs service on the 
clients.

5) Client mount:
# CLI
/bin/mount -t nfs hume.schoolpathways.com:/path/to/share /local/mount/point

# /etc/fstab
nfs1.mycompany.com:/path/to/share    /local/mount/mount nfs ro,nolock    0 0

# mount -a