# [SOLVED] nfs and systemd

## AchilleTalon

Which services are needed on each side (client/server) for NFS V4 to work properly?

The old openrc scripts were handling the dependancies what about systemd? I am trying to configure my NFS V4 environment without success so far.

Here is my kernel configuration on both client and server:

```
CONFIG_NFS_FS=y

# CONFIG_NFS_V2 is not set

# CONFIG_NFS_V3 is not set

CONFIG_NFS_V4=y

CONFIG_NFS_SWAP=y

CONFIG_NFS_V4_1=y

CONFIG_NFS_V4_2=y

CONFIG_PNFS_FILE_LAYOUT=m

CONFIG_PNFS_BLOCK=m

CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"

CONFIG_ROOT_NFS=y

CONFIG_NFS_FSCACHE=y

# CONFIG_NFS_USE_LEGACY_DNS is not set

CONFIG_NFS_USE_KERNEL_DNS=y

CONFIG_NFSD=m

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

CONFIG_NFSD_V4=y

# CONFIG_NFSD_FAULT_INJECTION is not set

CONFIG_NFS_COMMON=y

```

net-fs/nfs-utils-1.2.9-r3 is installed on both client and server.

----------

## eccerr0r

both sides:

rpcbind/portmap  

Server needs (to be useful and stable):

nfsd

mountd 

statd

"optional server"

idmapd

rquotad

I think the nfs server service should automatically pull in the needed dependencies.  Both the openrc and systemd versions of the startup scripts on Gentoo appear to work for me without changes...

I use nfsv3 when I can... v4 is a bit more tricky - it has a bit different authentication than the older NFS, I haven't had the time to study its dependencies.

----------

## AchilleTalon

There is even many errors on this Wiki HOWTO NFSv4 page: http://wiki.gentoo.org/wiki/NFSv4

rpc.mountd and rpc.statd are NFSv2 and v3 daemons. Hence, the modification to /etc/conf.d/nfs file to add options for rpc.mountd are not needed for a v4 only environment, the daemon should not be started in fact.

There is really no one out there with experience with NFSv4 that would share some tips on how to make this working?

----------

## depontius

 *AchilleTalon wrote:*   

> 
> 
> There is really no one out there with experience with NFSv4 that would share some tips on how to make this working?

 

I've been running nfsv4 for several years on my home LAN, but with OpenRC, not systemd.  I've also "harmonized" my passwd files, even though I'm running idmapd.  I can take a closer look at server and clients tonight at home.

----------

## AchilleTalon

Great! Thanks.

From this thread (comment by Kompi) started before systemd official implementation of startup files it seems the services required by NFSv4 are:

On the server:

var-lib-nfs-rpc_pipefs.mount

proc-fs-nfsd.mount

rpcbind.service

rpc-idmapd.service

nfsd.service

rpc-svcgssd.service

On the client:

va-lib-nfs-rpc_pipefs.mount

rpcbind.service

rpc-idmapd.service

rpc-gssd.service

The mounts are performed by one of the required services.

I did that, but it still not working. So, I guess there is a problem with the authorization/authentication somewhere.

----------

## AchilleTalon

I managed to make this working with NFSv4 sec=sys. The identified components in the previous post are correct. There is no need for the rpc.mountd, rpc.statd, etc. These are related to earlier versions of NFS.

The only thing I wasn't able to make working yet is the Kerberos mode with sec=krb5 or another variant and it seems the problem is related to a missing module in my kernel: rpcsec_gss_krb5

My distro is running on a Raspberry Pi and so far I haven't seen any option in the configuration script of the kernel to build such a module. The only available option for the Raspberry Pi related to the above is CONFIG_SUNRPC_GSS=y, the one of for Kerberos is missing and should be:CONFIG_RPCSEC_GSS_KRB5=m

My conclusion is then the NFSv4 implementation is incomplete on the Raspberry Pi since the Kerberos mandatory modules are missing from the kernel.

Anyone knows why?

----------

## AchilleTalon

Solved, there was missing crypto options to make the option visible in the menu.

So far, seems to work with Kerberos as expected.

----------

