NIS + automount fiddling

Bob Edwards Robert.Edwards at
Wed Sep 5 09:42:10 EST 2001

Actually, automount is great stuff and does exactly what you expect: mounts
directories automatically.

This is what we do here at DCS, ANU: each machine with user files on local
disk has them in (eg.) /data0. We then have an automount map that has entries

bob tux:/data0/bob
sjh saiph:/data0/sjh

When I log onto "tux" (as bob), here is what shows up:

/dev/hda1              3099260   1251680   1690148  43% /
/dev/hdc3             16578216  11909708   4497352  73% /data0
/dev/hda3               774040    617300    117384  85% /tmp
/dev/hda4              5581824   3629600   1668680  69% /usr/local
/data0/bob            16578216  11909708   4497352  73% /home/bob

As you can see, automount has remounted /data0/bob onto /home/bob. When I
log onto "saiph", here is the result:

/dev/hda1              4134900   1913764   2011088  49% /
/dev/hda4              9938284   1679232   7754212  18% /data0
/dev/hda3              4134932    258864   3666020   7% /tmp
linux:/usr/local       5581824   4511884    786396  86% /usr/local
tux:/data0/bob        16578216  11909712   4497352  73% /home/bob

As you can see, automount on "saiph" has mounted my home directory from
"tux" as ... you guessed it! /home/bob.


Note that in both cases, /home is simply a mount point. If you had
anything on local disk in /home, it is still there, but inaccessible
whilst automount (or anything else, for that matter) is using /home as
a mount point. Ie. if you:

mount /dev/cdrom /home

all your files in /home will "disappear" until you unmount /dev/cdrom,
at which point the underlying directory will magically reappear. (I don't
know what would happen if you tried this whilst automount was managing
the /home mount point, though!)


Bob Edwards.

Richard Cottrill wrote:
> Thanks peoples.
> After some animated cursing I've come to the conclusion that I can't do
> everything I'd like. I can't mix types of mount at one mount point; in fact
> it seems to be a mutually exclusive thing. Scary.
> Actually the scary bit was when automount grabbed /home and decided it
> hadn't yet mounted anything there, ergo, it was empty. I'm not the only
> person who uses this machine and the prospect of having wiped out everyone
> else's files made me more than a little concerned. Fortunately everything
> returned to normal when I stopped autofs/mount. Then I did what I should
> have before starting this Jihad on local files - I backed them up.
> So the conclusion that I've come to is that it's not possible to have:
> /home                           <--- a real directory
>         /richard                <--- normal, local account, normal directory
>         /david          <--- as above
>         /jeremy         <--- some NIS user with automatically mounted NFS $HOME
>         /somebody-else  <--- another NIS user
> Automount will let me have one type of mount or another (I believe).
> I did figure out why my home directories aren't being mounted though - the
> map name wasn't correct (should have had 'auto.home', instead of
> 'auto_home', as the map name; it resolves to '<nfs server>:/u01/home/&').
> Through fiddling with the lookup types in /etc/auto.master and the niscat
> and ypcat Solaris tools I've figured out that it's an old-style NIS system.
> The solution I've come up with is to move all of the local $HOME directories
> to some other directory and fiddle all of the references (passwd, etc) I can
> find. I expect that the local logins aren't long for this world anyway.
> All that leaves is fixing up my trashed Apache install...
> Thanks for your help guys,
> Richard

More information about the linux mailing list