How to disable a specific mount, when using automount over LDAP
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
.
Related videos on Youtube
Anurag Uniyal
Updated on September 18, 2022Comments
-
Anurag Uniyal over 1 year
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 thishome.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 entryMount 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? -
ThinLinc about 11 yearsI'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.