1

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?

2 Answers 2

1

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.

2
  • I don't have /etc/sysconfig/autofs file , though I think your suggestion leads me to right direction, see edit in question. thanks. Apr 26, 2013 at 18:36
  • I'm sorry for the confusion, the correct file is /etc/default/autofs. And i'm pretty sure that your system have MASTER_MAP_NAME configured directly to your ldap source and that's why automount -m only shows the ldap map. To fix this, remove value of MASTER_MAP_NAME and make sure your /etc/nsswitch.conf have ldap configured as source for automount. Also there must be a +auto.master entry in your /etc/auto.master file to enable the use of nsswitch sources.
    – ThinLinc
    Apr 27, 2013 at 14:03
0

One way to prevent an LDAP map from being automounted is to move /path1 and replace it with a symbolic link. e.g.

# mv /path1 /localpath1
# ln -s /localpath1 /path1

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.

You must log in to answer this question.

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