2

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.

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.