> After=network.target
you want to use network-online.target, not (only) network.target.
you also may want to use
Before=umount.target
Before=remote-fs.target
systemd will create an automatic mount unit for all mounts, so you can see what
params it uses if you mount the NFS share manually (i.e. remove your mount unit
file and mount from cmdline) and run systemctl show, e.g.:
$ systemctl show mnt-nas-music.mount
it also will dynamically create mount files for everything you have in
/etc/fstab, at /run/systemd/generator/.
Is there a reason you want to replace the fstab entry with a systemd
mount unit file?
** Changed in: systemd (Ubuntu)
Status: New => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, 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
--
Mailing list: https://launchpad.net/~touch-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help : https://help.launchpad.net/ListHelp