[CentOS] Getting started with NFS

John Austin ja at jaa.org.uk
Sat Jul 4 09:28:43 UTC 2009


On Sat, 2009-07-04 at 10:46 +0200, Niki Kovacs wrote:
> JohnS a écrit :
> > 
> > It is in the man page which is astonishing to me.
> > 
> 
> Neither 'man nfs' nor 'man exports' specify any version. But I tried 
> again to mount the NFS share, this time by specifying a filesystem, like 
> this:
> 
> # mount -t nfs4 raymonde:/data /home/shares
> 
> Here's what I got this time:
> 
> Warning: rpc.idmapd appears not to be running.
>           All uids will be mapped to the nobody uid.
> 
> ... and I didn't get a shell prompt back, so something didn't quite work 
> out. I conclude that there's some daemon missing on the client (like I 
> said, I always start out from a minimal configuration and then add 
> packages as needed). Any idea what package rpc.idmapd belongs to, 
> because a search with 'yum provides' and 'yum search' showed nothing.
> 
> Niki
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

Hi

Things that control nfs on the server are

1. /etc/sysconfig/nfs	no modifications required for me
2. /etc/exports		see mine below
3. firewall settings	mine is off
4. /etc/idmapd.conf	if using nfs4 - an nfs4 domain is required
5. /etc/fstab		probably bind mounts needed - if using nfs4

First decision is whether to use nfs4 or not - this exports works for both on mine
The mount command on the client is different in the two case
nfs4
mount -t nfs4 maui:/global /global

nfs3
mount maui:/exports/global /global
---------------------------------------------------
maui.jaa.org.uk sysconfig 3# cat /etc/exports
/exports                148.197.29.0/24(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash,fsid=0)
/exports/global 148.197.29.0/24(rw,insecure,sync,wdelay,no_subtree_check,nohide,no_root_squash)
/exports/home   148.197.29.0/24(rw,insecure,sync,wdelay,no_subtree_check,nohide,no_root_squash)
---------------------------------------------------
bind mounts for nfs4
maui.jaa.org.uk sysconfig 4# cat /etc/fstab
LABEL=home_maui                 /home                           ext3    defaults        1 2
LABEL=global_maui               /global                         ext3    defaults        1 2
/home                                   /exports/home           none     bind    0 0
/global                                 /exports/global         none     bind    0 0
---------------------------------------------------
maui.jaa.org.uk sysconfig 5# cat /etc/idmapd.conf
[General]
Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
#Domain = localdomain
Domain = jaa.org.uk
[Mapping]
Nobody-User = nfsnobody
Nobody-Group = nfsnobody
[Translation]
Method = nsswitch
---------------------------------------------------
maui.jaa.org.uk sysconfig 6# ps -ef|grep -i rpc
root      2380     1  0 Jul02 ?        00:00:00 rpc.idmapd
---------------------------------------------------
[root at maui ~]# service rpcidmapd status
rpc.idmapd (pid 2380) is running...
---------------------------------------------------

On the client (F11 in my case)
The default /etc/idmapd.conf should work if the nfs4 domain is the same
as the DNS domain - if in doubt force them to be the same on both the server and the client
The nfsnobody ownership is probably the result of the server and client domain not being the same
(and/or idmapd not running on both server and client)
/etc/idmapd.conf	
naxos ~ 1# cat /etc/idmapd.conf 
[General]                       
#Verbosity = 0                  
# The following should be set to the local NFSv4 domain name
# The default is the host's DNS domain name.                
#Domain = local.domain.edu                                  
Domain = jaa.org.uk 
...

Hope this helps

John





More information about the CentOS mailing list