7

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

Nir
  • 173
  • 1
  • 3

1 Answers1

5

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.

geekosaur
  • 7,025
  • 1
  • 19
  • 19
  • 1
    It worked. I didn't have a auto.home/auto_home. so I just put your suggestion in auto.master before +auto.master. I still wonder if there's a general way to prevent autofs from mounting over existing local directories though. Thanks! – Nir Mar 09 '11 at 13:39
  • 1
    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. – geekosaur Mar 09 '11 at 18:50
  • I see. Well, I'll remember that next time. Thanks a million. You saved me a lot of time :) – Nir Mar 10 '11 at 07:42