# systemd automount – access to parent mount directory hangs!

## Atha

Hello!

I’ve done the switch to systemd quite a while ago and I’m very happy with it. The system now boots tangibly faster and also the shutdown is almost instant compared to as it was with openrc. But that is not the point.

The point is, I’ve gotten myself a NAS. I configured it to provide NFS shares. I wanted to automount those on my system in a newly created folder /nfs.

```
DiskStation:/volume1/music              /nfs/music                      nfs     users,noauto,nofail,x-systemd.automount,x-systemd.device-timeout=10s,timeo=30,intr,noatime,nolock,posix,user    0 0
```

So, the problem is, that with the NAS up and running everything is fine. /nfs/music and all other /nfs/… will mount and the system functions as desired (automount).

BUT… with the NAS being unreachable (for example when the laptop is away from the home network) plasma-desktop will be the first application to crash. I can then only manually unmount every /nfs/… folder AND kill plasma-desktop and restart it (or stop/start kdm.service) for the system to be usable again.

So, to make it short:

I cannot use net-fs/autofs as it is for non-systemd only (like openrc).

While all NFS shares from my /etc/fstab are reachable, everything works.

When only one single NFS share from /etc/fstab is not reachable, any application trying to access /nfs will hang forever. This includes a simple "ls" in /nfs as well as bash completion when hitting "umount -l /nfs/[tab]" as well as important software like KDE itself (plasma-desktop) which completely hangs forever or a save file dialog from firefox or… presumably anything accessing /nfs!

I already tried mount option "soft" with no effect.

I followed this guide: ArchWiki: NFS, Mount using /etc/fstab with systemd

My question now is, how to use the systemd automount feature as intended without having every application hang when the shares are not available.

Thanks in advance,

Atha

----------

## Atha

When KDE starts, at first there are mounts as follows:

```
systemd-1 on /nfs/music type autofs (rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
```

During the process of the desktop being loaded however, addtional mounts appear:

```
DiskStation:/volume1/music on /nfs/music type nfs (rw,nosuid,nodev,noexec,noatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,posix,nolock,proto=tcp,timeo=30,retrans=2,sec=sys,mountaddr=192.168.1.2,mountvers=3,mountport=892,mountproto=udp,local_lock=all,addr=192.168.1.2)
```

And this also happens if one or all of these shares are not reachable.

I don't seem to understand the way systemd does this, but it makes no sense to me to mount it when it actually is unreachable.

----------

