How to prevent autofs from mounting over specific directories?

6,663

You may be able to add something like

foo      /-

to /etc/auto_home to prevent /home/foo from being mounted over the network. Make sure it comes before the +auto_home line (which asks Directory Services for mappings), so it will take precedence.

If that doesn't work, the only way to do it is to move your actual home directory somewhere else (by convention, /export/home) and configure auto_home to "mount" it from there.

Share:
6,663

Related videos on Youtube

Nir
Author by

Nir

Updated on September 17, 2022

Comments

  • Nir
    Nir over 1 year

    I have a workstation, on which I have a local user account with a local home directory. I'm also a part of an organization, in which I have a NIS user/home directory. I would like to setup autofs in order to access some shared NFS directories.

    The problem is, that after I do that, it automounts over my local home directory when I try to access it, which is not desirable for me.

    Is there a way to prevent autofs from mounting to this mountpoint?

    In a more general manner, is there a way to prevent autofs from mounting over existing directories?

    Thanks

  • geekosaur
    geekosaur about 13 years
    No; the intended use is that you give autofs control of entire directories, and some implementations will hide any existing local directories when the autofs is mounted. That's why the /export/home convention I mentioned exists.
  • Nir
    Nir about 13 years
    I see. Well, I'll remember that next time. Thanks a million. You saved me a lot of time :)