[Bug 1838464] Re: NFS volume not mounting with systemd

Michele Michielin michele.michielin at gmail.com
Sat Aug 17 13:00:31 UTC 2019


Hello, I tried all of your suggestions but nothing changed.

First attempt: I tried to add the following lines to my unit file:

After=network.target network-online.target
Before=umount.target remote-fs.target

No success.

Second attempt: I removed my unit file, I mounted manually the folder (with "sudo mount -t nfs 192.168.1.103:/Multimedia/Music /mnt/nas/music/") and I noticed with "show mnt-nas-music.mount" that the options generated by systemd were different, so I changed my unit file this way:
______________________________________

[Unit]
Description=NAS volume - Music
Wants=network-online.target
WantedBy=multi-user.target
Conflicts=umount.target
Before=remote-fs.target multi-user.target umount.target
After=system.slice remote-fs-pre.target systemd-journald.socket network.target -.mount network-online.target

[Mount]
What=192.168.1.103:/Multimedia/Music
Where=/mnt/nas/music/
Type=nfs
Options=auto,user,nfsvers=3
TimeoutSec=10

[Install]
______________________________________

No success.

The error is always the same: "network is unreachable".

Please tell me if you need some other information.

Thanks for your help.

Michele

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1838464

Title:
  NFS volume not mounting with systemd

Status in systemd package in Ubuntu:
  Incomplete

Bug description:
  Hello,

  I'm unable to mount NFS volume at boot time with systemd. Using Ubuntu 18.04.2 LTS.
  I commented out /etc/fstab entry:
  #192.168.1.103:/Multimedia/Music	/mnt/nas/music/	nfs	_netdev,auto,user,vers=3	0	0

  I created "/etc/systemd/system/mnt-nas-music.mount":
  [Unit]
  Description=NAS volume - Music
  After=network.target

  [Mount]
  What=192.168.1.103:/Multimedia/Music
  Where=/mnt/nas/music/
  Type=nfs
  Options=_netdev,auto,user,nfsvers=3
  TimeoutSec=10

  [Install]
  WantedBy=multi-user.target

  I enabled it with "systemctl enable mnt-nas-music.mount" so that when I run "systemctl is-enabled mnt-nas-music.mount" I obtain:
  enable

  But I keep obtaining this error ("systemctl status mnt-nas-
  music.mount"):

   mnt-nas-music.mount - NAS volume - Music
     Loaded: loaded (/etc/systemd/system/mnt-nas-music.mount; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2019-07-30 21:23:42 CEST; 29min ago
      Where: /mnt/nas/music
       What: 192.168.1.103:/Multimedia/Music
    Process: 1530 ExecMount=/bin/mount 192.168.1.103:/Multimedia/Music /mnt/nas/music -t nfs -o _netdev,user,nfsvers=3 (code=exited, status=32)

  lug 30 21:23:42 ubuntu-desktop systemd[1]: Mounting NAS volume - Music...
  lug 30 21:23:42 ubuntu-desktop mount[1530]: mount.nfs: Network is unreachable
  lug 30 21:23:42 ubuntu-desktop systemd[1]: mnt-nas-music.mount: Mount process exited, code=exited status=32
  lug 30 21:23:42 ubuntu-desktop systemd[1]: mnt-nas-music.mount: Failed with result 'exit-code'.
  lug 30 21:23:42 ubuntu-desktop systemd[1]: Failed to mount NAS volume - Music.

  If I run "journalctl -b" I notice that the attempt to mount NFS volume happens before network is ready:
  lug 30 21:23:42 ubuntu-desktop systemd[1]: Failed to mount NAS volume - Music.
  lug 30 21:23:48 ubuntu-desktop NetworkManager[978]: <info>  [1564514628.2750] device (enp2s0): Activation: successful, device activated.

  I think this is a bug.
  Thanks in advance
  Michele

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1838464/+subscriptions



More information about the foundations-bugs mailing list