Direct automount points are evil
By user12625760 on Jun 15, 2007
As I have said before, I love the automounter. I love that via executable maps you can get it to do things that you really should not be able to do, like restore files to be a poor mans HSM or archive retrieval solution. I love that automount maps can contain more automount points to form a hiearchy (eg: from our own automounter set up):
: eagain.eu FSS 10 $; nismatch chroot auto_share chroot -fstype=autofs auto_chroot.org_dir.eu.cte.sun.com. : eagain.eu FSS 11 $;
which allows this.
There is however one feature of the automounter that while well intentioned and some times required, is evil.
I speak of direct automount points.
They are evil for many reasons.
They pollute the name space.
They can't be added dynamically
They can't be deleted dynamically
They encourage sloppy administration.
I think it is point 4 that really wins it for me and I have an example I found today. I found it as my lab system had mounted up a load of nfs mount points that it should not. Now if the server goes away my session hangs when I had no need to mount the server in the first place. The reason it had mounted it was due to name space pollution such that “find . -xdev ....” triggers the mount of direct mount points but not indirect mount points1.
What do I mean sloppy administration? I'll take the example from today:
: eagain.eu FSS 8 $; niscat auto_direct.org_dir | grep cdrom /cdroms/jumpstart foohost:/export/jumpstart /cdroms/prefcs -rw foohost:/export/prefcs /cdroms/fcs -rw foohost:/export/fcs : eagain.eu FSS 9 $;
Instead of just one indirect mount point with the entries added to an indirect automount table we have an extra directory that only contains mount points, which is really the definition of an indirect mount point. That in our case the mount points could live under an existing mount point just adds to the irritation. So now to fix this the automount table has to be updated and then every system in the domain needs rebooting or at the very least the automount command run.
It should be the goal of every administrator to have an empty auto_direct table.
1Indirect mounts don't get triggered as they sit below another mount point so the find stops before reading the directory. So even if the mount point is browseable the mounts don't get triggered.