3

Is it ok to have nested directories managed by autofs?

e.g.

  • /nfs/zfs
  • /nfs

On my Debian 8 machine, I have /etc/auto.zfs like this:

repo -fstype=nfs,rw 192.168.0.2:/repo

and /etc/auto.nfs like this:

foo -fstype=nfs,rw 192.168.0.3:/foo

My /etc/auto.master.d/nfs.autofs then references these files like this:

/nfs/zfs /etc/auto.zfs
/nfs     /etc/auto.nfs

Is this supposed to work? Any caveat?

My main fear is that autofs somehow completely remove /nfs/zfs automatically at some point.

1 Answer 1

3

Answering my own question.

So apparently the correct way of doing this is through something called "multi-map" or "multiple-mount map", according to man 5 autofs.

<sarcasm>Oh such clear and predictable name.</sarcasm>

It's amazing that the words "nested" or "sub(-)director(y/ies)" do not appear at all in man 5 autofs.

1
  • Hi can you list the config you ended up using to actually do this? I'm trying to do the exact same thing and following the manpage's syntax for a multimap, but the "offset" (subdir? nested dir?) mount fails.
    – ffledgling
    Mar 13, 2020 at 2:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .