[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: autofs config



	Hi.

On Sun, 08 Jan 2017 13:37:32 -0500
Harry Putnam <reader@newsguy.com> wrote:

> I've edited /etc/auto.master by adding this line:
> 
>   /projects-nfs     /etc/auto.master.d/prj-nfs.autofs     --timeout=180

And it gone haywire from here.

Autofs has a concept of master map ( auto.master(5) ) which can contain
lines referring to either direct or indirect maps ( autofs(5) ).

/etc/auto.master.d is intended for extending master map, and the files
inside it should contain master map entries, not indirect ones like you
did below.


> Created the directory `mkdir /etc/auto.master.d'
> 
> created /etc/auto.master.d/prj-nfs.autofs like so (as suggested in
> auto.master):
> 
>   d0     --fstype=nfs4,rw,soft,intr    191.168.1.42:/projects/d0
>   dv     --fstype=nfs4,rw,soft,intr    191.168.1.42:/projects/dv

Note that it be simplified to:

*     --fstype=nfs4,rw,soft,intr    191.168.1.42:/projects/&


Also please note that they give you /etc/auto.net just for your case
(i.e. mounting nfs).


> ***  Jan 08 13:40:45 d0 automount[3676]: syntax error in map near
>     [ d0 --fstype=nfs4,rw,soft,intr        191.168.1.42: ]
> ***  Jan 08 13:40:45 d0 automount[3676]: syntax error in map near
> [ projects ]

So, what you need to do instead is:

# /etc/auto.master

/projects-nfs     /etc/auto.nfs     --timeout=180

# /etc/auto.nfs

d0     --fstype=nfs4,rw,soft,intr    191.168.1.42:/projects/d0
dv     --fstype=nfs4,rw,soft,intr    191.168.1.42:/projects/dv


And since you're using Debian stable you might consider ditch autofs
altogether as well and use systemd automounting as described in [1].

Reco

[1] http://blog.tomecek.net/post/automount-with-systemd/


Reply to: