Directory invisible until I cd into it

I have a mysterious directory that doesn't list until I cd into it. Then it does just fine. Then it vanishes again periodically.

bash-3.00$ pwd
/sde
bash-3.00$ ls -la
total 16
drwxr-xr-x   4 root root    0 May 18 16:46 .
drwxr-xr-x  29 root root 4096 Mar 23 13:16 ..
drwxrwxrwx  11 root root 4096 Dec  8 16:36 src_rep
drwxr-xrwx   7 root root 4096 Dec  3 11:06 taaats_6
bash-3.00$ cd s_int_r
bash-3.00$ pwd
/sde/s_int_r
bash-3.00$ ls ..
s_int_r  src_rep  taaats_6
bash-3.00$ cd ..
bash-3.00$ ls
s_int_r  src_rep  taaats_6

Some time passes, with no commands entered...

bash-3.00$ pwd
/sde
bash-3.00$ ls
src_rep  taaats_6
bash-3.00$ ls ./s_int_r/..
s_int_r  src_rep  taaats_6

I am SSH'd into this machine with putty. If I open up another connection to the machine, the second connection seems to always be the same as the first. Ie- It initially doesn't show on either, but if I cd into it on one connection, it will then show on the second.

What is going on?


Solution 1:

You're seeing an automounter in operation. Automounter implementations vary, but the basic principle is to mount a directory only when it's accessed. This one is mounting s_int_r on demand when you change into it; other automounters might always list it in the directory entry for /sde but only actually mount it when you try to access a file in it.

cd /sde/s_int_r && df . will tell you where it's mounted from. grep /sde /proc/mounts will tell you what automounter is going on, and from that information you may be able to find out how it's configured.