I am using Ubuntu 11.04, on which NFS paths are automounted using AutoFS/LDAP. For example, /path1
and /path2
are auto mounted, but I want to disable automount for /path1
, because I want to use a local folder instead, so I added this to /etc/auto.master
:
/path1 -null
But it doesn't seem to have any effect. So what is the proper way of overriding/disabling such specific mounts on client side for a automount map loaded via LDAP?
I don't have control over the LDAP server, and it automounts 10 or so paths out of which I want one disabled.
Edit:
When I run mount
command I see something like this
home.xxx.com:/home1 on /mnt/home1 type nfs
git.xxx.com:/git on /mnt/git type nfs
I thought /mnt/home1 and /mnt/git are loaded separately from ldap, but automount -m
shows only one entry
Mount point: /mnt
source(s):
type: ldap
map: ldap:ou=auto.mnt,ou=automount,dc=xxx,dc=com
That said wouldn't /mnt/git -null' in
/etc/auto.master` work, or I will have to make whole /mnt null?
Have you configured the key MASTER_MAP_NAME in
/etc/default/autofs
to point out your ldap directory master map ?If so this will override and not use your local auto.master map, see auto.master man page.
You can also verify which maps are in use with
automount -m
.One way to prevent an LDAP map from being automounted is to move /path1 and replace it with a symbolic link. e.g.
There may be side effects to doing this (like more messages in the log, if enabled), but it will enable you to access your local folder of the same name while using LDAP automounts (i.e. MASTER_MAP_NAME = "ou=..." as noted by ThinLinc). I have successfully tested this on Ubuntu 12.04 with libnss-ldapd, but I don't see why it wouldn't work with sssd.
If you choose to do this, then /path1 will become a logical path and /localpath1 will be the physical path. The default will be the logical path; hence, from the user's perspective, /path1 is still the local /path1, but sudo will default to the physical path. There are -L and -P options to pwd and cd which may assist you in displaying or changing between the logical and physical paths in cases where the logical path creates problems.