# systemd: nfs drives not mounted during boot

## jody

Hi

I have two nfs drives which previously weremounted during boot without a problem.

Now, with systemd, this fails without giving any clear reason 

```
Dez 12 10:20:00 localhost systemd[1]: Dependency failed for Remote File Systems.

-- Subject: Unit remote-fs.target has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d

-- 

-- Unit remote-fs.target has failed.

-- 

-- The result is dependency.

Dez 12 10:20:00 localhost systemd[1]: morpho.mount mount process exited, code=exited status=32

Dez 12 10:20:00 localhost systemd[1]: Failed to mount /morpho.

-- Subject: Unit morpho.mount has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d

-- 

-- Unit morpho.mount has failed.

-- 

-- The result is failed.

Dez 12 10:20:00 localhost systemd[1]: Unit morpho.mount entered failed state.

```

and a little bit before that 

```
Dez 12 10:19:59 aim-triops rpc.statd[15856]: Version 1.2.7 starting

Dez 12 10:19:59 aim-triops rpc.statd[15857]: Version 1.2.7 starting

Dez 12 10:19:59 aim-triops rpc.statd[15856]: Flags: TI-RPC

Dez 12 10:19:59 aim-triops rpc.statd[15857]: Flags: TI-RPC

Dez 12 10:19:59 aim-triops rpc.statd[15856]: Running as root.  chown /var/lib/nfs to choose different user

Dez 12 10:19:59 aim-triops rpc.statd[15857]: Running as root.  chown /var/lib/nfs to choose different user

Dez 12 10:19:59 aim-triops rpc.statd[15857]: failed to create RPC listeners, exiting

Dez 12 10:19:59 aim-triops rpc.statd[15856]: failed to create RPC listeners, exiting

Dez 12 10:19:59 aim-triops mount[15852]: mount.nfs: rpc.statd is not running but is required for remote locking.

Dez 12 10:19:59 aim-triops mount[15852]: mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

Dez 12 10:19:59 aim-triops mount[15852]: mount.nfs: an incorrect mount option was specified

Dez 12 10:19:59 aim-triops mount[15849]: mount.nfs: rpc.statd is not running but is required for remote locking.

Dez 12 10:19:59 aim-triops mount[15849]: mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

Dez 12 10:19:59 aim-triops mount[15849]: mount.nfs: an incorrect mount option was specified

```

and somewhat later

```
Dez 12 10:20:05 aim-triops kernel: kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL does not work properly. Using workaround

Dez 12 10:20:05 aim-triops /etc/init.d/net.eth0[16675]: net.eth0: not allowed to be hotplugged

Dez 12 10:20:05 aim-triops /etc/init.d/net.eth1[16676]: net.eth1: not allowed to be hotplugged

```

and even later

```
Dez 12 10:20:07 aim-triops systemd[1]: Starting (Re)store the netctl profile state...

-- Subject: Unit netctl.service has begun with start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 

-- Unit netctl.service has begun starting up.

```

and

```
Dez 12 10:20:08 aim-triops systemd[1]: Starting Networking for netctl profile ethernet-main...

-- Subject: Unit netctl@ethernet\x2dmain.service has begun with start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 

-- Unit netctl@ethernet\x2dmain.service has begun starting up.

Dez 12 10:20:08 aim-triops sm-notify[16746]: Version 1.2.7 starting

Dez 12 10:20:08 aim-triops rpc.statd[16745]: Running as root.  chown /var/lib/nfs to choose different user

Dez 12 10:20:08 aim-triops systemd[1]: Started NFSv2/3 Network Status Monitor Daemon.

-- Subject: Unit rpc-statd.service has finished start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 

-- Unit rpc-statd.service has finished starting up.

-- 

-- The start-up result is done.

```

However, after booting and logging in, 'mount -a' mounts all the nfs drives.

In systemctl i have (amongst many others, of course):

```

morpho.mount                                                                  loaded failed failed    /morpho

proc-fs-nfsd.mount                                                            loaded active mounted   /proc/fs/nfsd

nfsd.service                                                                  loaded active exited    NFS server

rpc-mountd.service                                                            loaded active running   NFS Mount Daemon

rpc-statd.service                                                             loaded active running   NFSv2/3 Network Status Monitor Daemon

rpcbind.service                                                               loaded active running   RPC Bind

```

It seems to me the order of things is wrong.

Can i somehow force the nfs mounting to be done later during the boot process, when everything is ready?

Thank You

  Jody

---- edit :additional questions ----

Looking at the output again i saw the line "Dependency failed for Remote File Systems."

Does this mean mount depends on "Remote File Systems" or does Remote File System" depend on something else?

How can this dependency problem be solved?

----------

## jody

(* bump *)

Doesn't anybody mount network drives during boot with systemd?

----------

## jody

(* another bump *)

So really nobody using systemd mounts network filesystems during boot?

----------

## Bollart

I am also having some problems with systemd and nfs. From journalctl I can see the following:

```
Feb 08 11:00:14 mmm systemd[1]: Mounting /media/xxxxx...

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): carrier is OFF

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): new Ethernet device (driver: 'r8169' ifindex: 2)

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): exported as /org/freedesktop/NetworkManager/Devices/0

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): bringing up device.

Feb 08 11:00:14 mmm kernel: r8169 0000:02:00.0 eth0: unable to load firmware patch rtl_nic/rtl8168e-3.fw (-2)

Feb 08 11:00:14 mmm kernel: r8169 0000:02:00.0 eth0: link down

Feb 08 11:00:14 mmm kernel: r8169 0000:02:00.0 eth0: link down

Feb 08 11:00:14 mmm kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): preparing device.

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> (eth0): deactivating device (reason 'managed') [2]

Feb 08 11:00:14 mmm mount[2792]: mount.nfs: mount system call failed

Feb 08 11:00:14 mmm NetworkManager[2764]: <info> Added default wired connection 'Kabelgebundene Verbindung 1' for /sys/devices/pci00

Feb 08 11:00:14 mmm systemd[1]: media-xxxxx.mount mount process exited, code=exited status=32

Feb 08 11:00:14 mmm systemd[1]: Failed to mount /media/xxxxx.
```

```
Feb 08 11:00:16 mmm NetworkManager[2764]: <info> (eth0): carrier now ON (device state 20)

Feb 08 11:00:16 mmm NetworkManager[2764]: <info> (eth0): device state change: unavailable -> disconnected (reason 'carrier-changed')

Feb 08 11:00:16 mmm kernel: r8169 0000:02:00.0 eth0: link up
```

So it tries to initialize the network connection and fails first (maybe the router is not responding fast enough). Therefore, nfs cannot be mounted. Later it detects the network connection successfully.

There is another threat about this as well.

----------

