The goal of this article is getting
NFSv4 is the new version of NFS with new features like strong authentication and integrity via Kerberos and SPKM-3, improved performance, safe file caching, lock migration, ACLs and better support for Windows file sharing semantics.
Required packages for both client and server (from AUR):
Download the packages, makepkg and install them.
Note: currently pacman doesn't seem to handle replacing when invoked with pacman -U. Therefore, you'll need to remove nfs-utils before installing nfs4-utils (which is a complete drop-in replacement).
First we'll need to edit our exports in /etc/exports. A typical NFSv4 export would look like this:
/export 192.168.0.12(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash) /export/music 192.168.0.12(rw,async)
/export is the first NFS root here. If you want to specify multiple NFS roots, just increment fsid; fsid=1 for the second, etc.
Note: the no_root_squash option means that root on the client is also considered root on the server. This is of course a security risk. Remove it if you don't need it.
Then, /etc/idmapd.conf needs to be edited. You'll need to specify the Domain there on both client and server, so that they are identical. Example:
[General] Verbosity = 1 Pipefs-Directory = /var/lib/nfs/rpc_pipefs Domain = archlinux.org [Mapping] Nobody-User = nobody Nobody-Group = nogroup john = john staff = staff
Starting the server
To start the NFS server, just
/etc/rc.d/nfsd start /etc/rc.d/nfs4-common start
If you want to tweak the configuration, feel free to edit /etc/conf.d/nfs to your needs.
Mounting the partitions on the client
On the client, to mount the NFSv4 partition:
/etc/rc.d/nfs4-common start mount -t nfs4 server:/ /mnt/server/ mount -t nfs4 server:/music /mnt/music/
Note that the root of the path on the server is the NFS root specified; all paths must be specified relative to that.
Take a look at the gentoo wiki for further instructions on configuring the exports.
Some general instructions: http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
On migrating from NFSv3 to NFSv4: http://nfsv4.bullopensource.org/tools/tests/page40.php
For NFSv4 with Kerberos authentication: http://www.itp.uzh.ch/~dpotter/howto/kerberos
For a comparison on networked file systems, see http://wiki.linux-nfs.org/index.php/Comparison_of_NFS_vs._others