I cd
to a directory that has a large number of files, 40,948 to be exact. When I issue ls
it takes a long time and before the command finally prints the results to the screen it tells me "ls: cannot access : No such file or directory" for a few files.
It's not the same file names every time. When I do ls -l
some files have no posix permissions just "???????" preceding the file name.
I tried to chown -R
the directory because I wanted to change the group and I get a mixture of "chown: cannot access" or "chown: changing ownership of" + ": No such file or directory" on even more files than when I use ls
.
This highlighted for me that I don't even know if a directory in Linux has a table of contents, I thought that maybe the toc was corrupted. But the fact that the results are always different suggests otherwise.
Could this be a "nofile" issue in /etc/security/limits.conf ?
stat
on such a file says? And what is the output (for those files) if you run thefind
command on that directory?ls
andchmod
don't open individual files. It's probably a corrupted disk (if this is a local filesystem) or a network error (if this is a remote filesystem). You need to tell us what kind of filesystem this is, and whether the errors are consistent forls
. Do you have errors when you run/bin/ls
(exactly that command)? Post the output ofstrace ls -l SOMEFILE
for one of the problematic files. Does anything appear in the system logs when you runls
?