NFSv4 on CentOS 5.3 and Fedora 11

To save the Community the trouble of figuring out how to make this work, here are the steps I used to mount nfsv4 shares on Fedora 11 from a CentOS 5.3 server.

When a line starts with “#” or “as root” that means that you have to execute the command as root.

On the *SERVER* side:

1) as root edit /etc/idmapd.conf:

change Nobody-{User,Group} to nfsnobody
change Domain to <your.fully.qualified.domain.name>

2) create directory with exports

# mkdir /nfs4exports/share

3) as root edit /etc/fstab and add nfs4 exports

/somedirectory/youwanttoshare  /nfs4exports/share    none    bind    0 0

4) activate nfsv4 binds

# mount -a

5) as root edit /etc/exports

Replace 192.168.0.0 below with your IP network.

6) reload exported filesystems

# exportfs -rv

7) stop & disable services

# service nfs stop
# service nfslock stop
# service portmap stop

8) disable unnecessary services

# chkconfig –level 345 nfslock off

9) as root edit /etc/sysconfig/nfs

Use the settings below and leave all other settings as they are.

MOUNTD_NFS_V1=”no”
MOUNTD_NFS_V2=”no”
RPCNFSDARGS=”-N 2 -N 3 -U”

10) start required services

# service portmap start
# service rpcidmapd start
# service nfs start

# chkconfig –level 345 portmap on
# chkconfig –level 345 rpcidmapd on
# chkconfig –level 345 nfs on

On the *CLIENT* side (the Fedora 11 box):

1) as root edit /etc/idmapd.conf:

change Nobody-{User,Group} to nfsnobody
change Domain to <your.fully.qualified.domain.name>

2) create share directories

Off course you can choose the location yourself.

# mkdir /mnt/share

3) as root edit /etc/fstab

Replace <host> below with the hostname or IP address of your CentOS box.

<host>:/share   /mnt/share   nfs4    rsize=8192,wsize=8192,timeo=14,intr,user

4) start required services

# service rpcidmapd start
# chkconfig –level 345 rpcidmapd on

5) mount the bunch

# mount -a

The share will also automatically show up in Nautilus where you can click on it to mount it.

Changelog:
Nov 1, 2009: fixed s/rpcbind/rpcidmapd/ typo in client section based on feedback from Mathiaz and Deadpan110 (thanks!)