You are not logged in.

#1 2012-12-14 07:04:56

made_in_nz
Member
From: Wellington, New Zealand
Registered: 2010-01-04
Posts: 53

x-systemd.automount nfs drive

Hi,
I can't seem to get systemd.automount to behave.  I have an nfs share available on machine 'kombi' and am trying to access it from machine 'forrest':

[root@forrest ~]# showmount -e kombi
Export list for kombi:
/mnt/nfs4/georgia 192.168.1.202
/mnt/nfs4         192.168.1.202

It is set up to automount in /etc/fstab:

kombi:/georgia  /mnt/georgia nfs4  rw,suid,dev,exec,noauto,nouser,async,clientaddr=192.168.1.202,_netdev,x-systemd.automount,x-systemd.device-timeout=8   0   0

Logging output from journalctl indicates it timed out but then mounted:

Dec 14 17:45:11 forrest systemd[1]: mnt-georgia.mount mounting timed out. Stopping.
Dec 14 17:45:11 forrest systemd[1]: Mounted /mnt/georgia.
Dec 14 17:45:11 forrest systemd[1]: Mounted /mnt/georgia.

However it is not mounted. Any process trying to access /mnt/georgia hangs.

Any ideas where I have gone wrong?  I don't care if it automounts at boot or at first access.  What I'd like is for it to gracefully handle mounting when 'kombi' is up, and unmounting when 'kombi' is down.

Offline

#2 2012-12-14 11:03:36

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: x-systemd.automount nfs drive

made_in_nz wrote:

What I'd like is for it to gracefully handle mounting when 'kombi' is up, and unmounting when 'kombi' is down.

systemd's automounting isn't suitable for your requirements then. It doesn't handle a timeout packet, and it certainly doesn't handle a host being down (i'm not even sure autofs does this). have you enabled/started rpcbind?

Offline

#3 2012-12-14 18:34:33

made_in_nz
Member
From: Wellington, New Zealand
Registered: 2010-01-04
Posts: 53

Re: x-systemd.automount nfs drive

Thanks, I guess I have misread other advice on the forums.  Even systemd.mount man page states:

If x-systemd.device-timeout= is specified it may be used to configure how long systemd should wait for a device to show up before giving up on an entry from /etc/fstab.

From this statement I would expect the remote filesystem to not be mounted if the other machine is down, but not to cause a local process to hang trying to access the unmounted directory.

It looks like autofs may be the way to go - from the NFS wiki:

Using autofs is useful when multiple machines want to connect via NFS; they could both be clients as well as servers. The reason this method is preferable over the earlier one is that if the server is switched off, the client will not throw errors about being unable to find NFS shares.

Offline

Board footer

Powered by FluxBB