0

I'm on a CentOS 7 server attempting to list a subdirectory. When I first list the top level directory, it appears empty:

[me@server ~]$ ls -al /misc
total 4
drwxr-xr-x.  3 root root    0 Mar 13 12:49 .
dr-xr-xr-x. 20 root root 4096 Feb  1 09:54 ..

However, there exists a subdirectory that I have read/execute permissions on, and can list:

[me@server ~]$ ls -al /misc/subdir
total 192
drwxr-xr-x. 50 root     root     4096 Feb 25 09:52 .
drwxr-xr-x.  3 root     root        0 Mar 13 12:49 ..
...other files and folders...

And after I list it for the first time it appears in the top level directory:

[me@server ~]$ ls -al /misc
total 8
drwxr-xr-x.  3 root root    0 Mar 13 12:49 .
dr-xr-xr-x. 20 root root 4096 Feb  1 09:54 ..
drwxr-xr-x. 50 root root 4096 Feb 25 09:52 subdir

But if I wait a while (10 minutes?) it disappears again. It's not a symlink, not a dotfile, and may be an NFS mount (not in the fstab but a stat of the folder returns Context: system_u:object_r:nfs_t:s0). What could be causing this directory to be hidden until I attempt to access it?

  • 1
    What filesystem are /misc and /misc/subdir? Does ls /misc/subdir ever fail? Can you share the output of findmnt -T /misc and findmnt -T /misc/subdir? – Attie Mar 13 at 17:17
  • Turned out to be an automounter, though I didn't know about the findmnt command which would have pointed me that direction too. – vityav Mar 13 at 17:30
6

You likely have automounter on top of /misc directory. Have a look at your /etc/auto.master and /etc/auto.misc files to figure out what is (auto)mounted there.

  • That was it, thanks! I'd never heard of an automounter before. – vityav Mar 13 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.