# systemd nfs mount

## mpcww

A few day ago I switched to systemd and now I wonder which service to start to get mount working again

```

mount.nfs: rpc.statd is not running but is required for remote locking.

mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

```

With the nolock option it works, but I think this might be not the preferred solution.

Any hint is greatly appreciated

----------

## gcyoung

This may not be the answer, but I had the same error report and problem after a kernel upgrade. It turned out that there were variations to the entries under "Networking Support" in the new kernel configuration, and the necessary boxes had not been ticked.

I suggest you have a look in your kernel .config to see you have the correct settings.

----------

## mpcww

 *gcyoung wrote:*   

> This may not be the answer, but I had the same error report and problem after a kernel upgrade. It turned out that there were variations to the entries under "Networking Support" in the new kernel configuration, and the necessary boxes had not been ticked.
> 
> I suggest you have a look in your kernel .config to see you have the correct settings.

 

hmmh, looks fine for me:

```

/usr/src/linux$ grep -i nfs .config

CONFIG_NFS_FS=m

CONFIG_NFS_V2=m

CONFIG_NFS_V3=m

# CONFIG_NFS_V3_ACL is not set

# CONFIG_NFS_V4 is not set

# CONFIG_NFS_SWAP is not set

CONFIG_NFSD=m

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

# CONFIG_NFSD_V4 is not set

CONFIG_NFS_COMMON=y

/usr/src/linux$ grep -i rpc .config

CONFIG_AF_RXRPC=m

# CONFIG_AF_RXRPC_DEBUG is not set

CONFIG_SUNRPC=m

CONFIG_SUNRPC_XPRT_RDMA=m

# CONFIG_SUNRPC_DEBUG is not set

```

The nfs server I use provides only NFS3.

----------

## hika

Are you running nfsmount from init.d

----------

## azp

 *mpcww wrote:*   

> A few day ago I switched to systemd and now I wonder which service to start to get mount working again
> 
> ```
> 
> mount.nfs: rpc.statd is not running but is required for remote locking.
> ...

 

I'm seeing the same issue here... There are two services which seems to fit the name in some way, but I can't get them started:

```
# systemctl -a

...

...

remote-fs-pre.target                                   loaded inactive dead      Remote File Systems (Pre)

remote-fs.target                                       loaded inactive dead      Remote File Systems

...

...
```

When I try to run them I get:

```
# systemctl start remote-fs-pre remote-fs

Failed to issue method call: Unit remote-fs-pre.service failed to load: No such file or directory. See system logs and 'systemctl status remote-fs-pre.service' for details.

Failed to issue method call: Unit remote-fs.service failed to load: No such file or directory. See system logs and 'systemctl status remote-fs.service' for details.

```

So I guess there's something that I've missed to install, via use flag or something like it.

----------

## comprookie2000

Maybe rpc-gssd.service

https://wiki.archlinux.org/index.php/NFS#Client

https://github.com/mgorny/gentoo-systemd-units/blob/master/net-fs:nfs-utils/rpc.gssd.service

----------

## azp

 *comprookie2000 wrote:*   

> Maybe rpc-gssd.service
> 
> https://wiki.archlinux.org/index.php/NFS#Client
> 
> https://github.com/mgorny/gentoo-systemd-units/blob/master/net-fs:nfs-utils/rpc.gssd.service

 

I'm not sure how I did it, but now systemd seems to start NFS mount, but the problem seems to be that it doesn't wait for the network card to have an IP address before it tries. So the mounts doesn't get loaded at boot, and the same issue applies to ntp-client. I thought the dependencies were defined in each service (like the one you linked to above).

----------

## gcyoung

I had problems with mounting exports too. I have now discovered rpc-statd.service, rpc-mountd.service and nfsd,service located in "/usr/portage/net-fs/nfs-utils/files/" . I copied them to /etc/systemd/system, and enabled them, and my nfs system seems to work as usual.

I have also found other service files located in the "files" directory of the various portage locations. I t seem odd that these are not installed when "emerging" against systemd, but the iinit.d files are still installed. See my post of Sept 14. "Systemd and NetworkManager with exports".

----------

## azp

 *gcyoung wrote:*   

> I had problems with mounting exports too. I have now discovered rpc-statd.service, rpc-mountd.service and nfsd,service located in "/usr/portage/net-fs/nfs-utils/files/" . I copied them to /etc/systemd/system, and enabled them, and my nfs system seems to work as usual.
> 
> I have also found other service files located in the "files" directory of the various portage locations. I t seem odd that these are not installed when "emerging" against systemd, but the iinit.d files are still installed. See my post of Sept 14. "Systemd and NetworkManager with exports".

 

I agree, that sounds like a bug. I'll copy my files as well, and see if it fixes my problems.

----------

## azp

I don't think this is the issue. When you enable a service, systemd creates a symbolic link in /etc/systemd/system/ to the corresponding service file in /usr/lib64/systemd/system/.

If I list my files in that directory, I can see the nfs-utils files than you were missing:

root@skare$ ll /usr/lib64/systemd/system/rpc*

-rw-r--r-- 1 root root 193 20 jul 23.32 /usr/lib64/systemd/system/rpcbind.service

-rw-r--r-- 1 root root 500 22 sep 19.57 /usr/lib64/systemd/system/rpcbind.target

-rw-r--r-- 1 root root 251  5 sep 23.59 /usr/lib64/systemd/system/rpc-mountd.service

-rw-r--r-- 1 root root 268  5 sep 23.59 /usr/lib64/systemd/system/rpc-statd.service

----------

## gcyoung

I don't mount shared directories at boot-up, but use a script to see the other computer is on at login before mounting, so I haven't had your problem, azp.  But isn't the "NetworkManager-wait-online.service" designed to prevent premature access to networking?

----------

