goremachine
Posts: 2
Joined: Thu Feb 05, 2015 8:11 pm

NFS fails to mount RPi4b with 20.04 32/64 on boot due to remote-fs.target never being called.

Sat May 30, 2020 9:01 pm

So, weird stuff. I have a RPI2b installed 20.04-32 early May, NFS mount works flawlessly on boot.
Now I got a RPI4b and tried 20.04-64/32 and the same NFS mount gloriously fails on boot.

I've got a Synology NAS and can mount the share just fine after boot with "sudo mount -a"
I got my entry in fstab and it fails. It seems the network is not available when systemd tries to mount on boot.
I tried it with "_netdevs, x-systemd.after=network-online.target" to no avail.

So I went to just Pi-Image a clean 20.04-32 and started from the top.
Updated apt, upgraded, installed nfs-common, tried to manually mount and it worked. Added the same entry to fstab as on the RPI2b, rebooted and it fails again.

So I dug into the syslog and systemctl.

Code: Select all

ubuntu@ubuntu:~$ cat /var/log/syslog | grep -C 5 "remote-fs.target"
May 30 20:34:55 ubuntu mount[1222]: mount.nfs: Network is unreachable
May 30 20:34:55 ubuntu systemd[1]: media-nas-emulation.mount: Mount process exited, code=exited, status=32/n/a
May 30 20:34:55 ubuntu systemd[1]: media-nas-emulation.mount: Failed with result 'exit-code'.
May 30 20:34:55 ubuntu systemd[1]: Failed to mount /media/nas/emulation.
May 30 20:34:55 ubuntu systemd[1]: Dependency failed for Remote File Systems.
May 30 20:34:55 ubuntu systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
...
So by the looks of it, remote-fs.target failed. It should be called at some point during boot but isn't.
Right after boot:

Code: Select all

ubuntu@ubuntu:~$ sudo systemctl | grep remote-fs
  remote-fs-pre.target		loaded active     active          Remote File Systems (Pre)            
So I do a manual start and check again

Code: Select all

ubuntu@ubuntu:~$ sudo systemctl start remote-fs.target
ubuntu@ubuntu:~$ sudo systemctl | grep remote-fs
  remote-fs-pre.target		loaded active active    Remote File Systems (Pre)
  remote-fs.target		loaded active active    Remote File Systems
So manually starting the target works, and the NFS mount is available automatically right afterwards.

So it seems something's really wrong and remote-fs.target never is called, even after the network is up.
On the RPi2b with 20.04 32b the NFS just mounts during boot with systemd reporting success.

Does anyone have any idea what's wrong, how to fix it? Or is this old Ubuntu bug back? I think to recall that there were similar issues a few years back.

donbrew
Posts: 74
Joined: Sun Sep 04, 2016 2:32 pm

Re: NFS fails to mount RPi4b with 20.04 32/64 on boot due to remote-fs.target never being called.

Tue Jun 23, 2020 4:14 am

I am having the same problem. Client is RPi 4 RaspberryPi OS Buster 32 bit. Trying to auto mount NFS share. My server is Ubuntu 20.04 64bit.
I can manually load the systemd unit with

Code: Select all

systemctl start mnt-tv3.mount
I can manually load fstab with

Code: Select all

mount -a
.
I tried changing the install line to multi-user.target, no help

Neither works on boot.

Turns out the same is true for cifs mounts.

The error returned is "dependency failed for remote file system"
Last edited by donbrew on Tue Jun 23, 2020 9:28 pm, edited 1 time in total.

murraybd
Posts: 15
Joined: Thu Nov 14, 2019 10:56 pm

Re: NFS fails to mount RPi4b with 20.04 32/64 on boot due to remote-fs.target never being called.

Tue Jun 23, 2020 3:13 pm

Could you please report a bug in Launchpad regarding the issue you are encountering? This can easily be done via the command

Code: Select all

ubuntu-bug systemd
on the Raspberry Pi with the issue. This will provide information useful for developers to dig into the matter. Thanks!
Software Engineer at Canonical
Ubuntu Core Developer

donbrew
Posts: 74
Joined: Sun Sep 04, 2016 2:32 pm

Re: NFS fails to mount RPi4b with 20.04 32/64 on boot due to remote-fs.target never being called.

Tue Jun 23, 2020 10:34 pm

murraybd wrote:
Tue Jun 23, 2020 3:13 pm
Could you please report a bug in Launchpad regarding the issue you are encountering? This can easily be done via the command

Code: Select all

ubuntu-bug systemd
on the Raspberry Pi with the issue. This will provide information useful for developers to dig into the matter. Thanks!
My problem is in Raspberrypi OS (New Raspbian) it is identical to the OP whose problem was on Ubuntu on rpi. I am guessing it is a systemic thing with the new kernel 4.19.
I have Ubuntu 20.04 on a PC that is my server. I don't remember trying to mount anything on Ubuntu.

The further I dig into the wants there seems to be something missing: all of the rpc/gssd services that are wanted or after as dependencies in the nfs-client.target file are "condition fail" so that RPC security service for NFS server was skipped.

Seems that these dependencies used to be included in nfs-utils, but that no longer is in APT.

Code: Select all

[Unit]
Description=NFS client services
Before=remote-fs-pre.target
Wants=remote-fs-pre.target
sWants=nfs-blkmap.service

# GSS services dependencies and ordering
Wants=auth-rpcgss-module.service
After=rpc-gssd.service rpc-svcgssd.service gssproxy.service

[Install]
WantedBy=multi-user.target
WantedBy=remote-fs.target

Return to “Ubuntu”