find - stat() fails on a dir

find - stat() fails on a dir

Post by Mike Suz » Fri, 19 Nov 1993 03:16:18

OK, this is kind of a strange one.  We run a backup program every day
to put new files onto tape.  The backup script is just a find command piped
to cpio.  Anyway, lately the script has been failing with an error like:

"find: stat() failed: /chm2/dicicco: No such file or directory"

The permissions on the directory are 777; the dir does exist, I can
chdir to it and ls to my heart's content.  However, any attempts to use
find on the directory fail with the stat() error.
Now the strange part: I wrote a little c program that calls stat, and
tried it to see what the exact error was that I was getting (wasn't sure
what find was trying to tell me).  It didn't fail!  I can run it on that
entry without a problem - I get the stat struct back, and can access the
information within it...
Any new directory I create within that file system has the same
problem... I tried to unmount it and run fsck, but that didn't
help (no errors generated, remounted and still had the problem).

FYI - Titan 3000 running Titan OS 4.2 (pretty much SVR4ish)
The file-system is NFS-mounted by a Sun and HP system, and the problems
started after I added the HP to the list.  I have no idea how
this could actually affect things, but I mention it as another data point.

Thanks in advance - this is certainly one of the stranger things I've
had to deal with on this piece of junk...


|  Marketing Director - Friday Knight Games                 |
|  aka "That F*K*G company!"                                |


1. find: stat() failed: xxxx: no such file or directory

We just cleared up an interesting problem that I don't believe I've
seen mentioned in this group over the last couple of years, so I
thought I would pass it on.

The symptoms.  We run /etc/cleanup out of root crontab every Sunday
morning.  This script contains the following line:

        find / -name core -atime +7 -exec rm -f {} \;

About 4 weeks ago, this began failing, generating a page full of
error messages like:

        find: stat() failed: /usr/ldbin/wp5/standard.prs: no such file or directory

An examination of the named files showed they were perfectly normal.  To make
a long story short, the file name just befre this one, "spell.exe", supposed
to be a Merge386 executable, was showing in an ls -l as a directory!  Looking
at the directory, we recognized it as a log directory for our database, and
in fact, cd'ing into spell.exe, then 'cd ..'ing left you in what was obviously
the database directory, but pwd had you back in /usr/ldbin/wp5!

Anyways, it was clear that the entry for spell.exe in the wp5 directory
somehow got hosed, and now was a second link to the log directory.  A
quick /etc/unlink cleared up the problem.  Anybody have any ideas how this
could have happened in the first place?  In fact we had two such bogus
file/directory mixups in the wp5 directory!

Hope this helps somebody someday!


2. Linux newbie has problem with ftp/networking

3. stat(2) fails when calling find(1)

4. mgetty and seyon

5. find without the "find: cannot read dir /usr/lost+found: Permission denied"

6. 2.4.22-pre1 X screen blank problem

7. find a dir under a dir

8. How do i log sessions?

9. Apache MultiViews: /dir returns /dir/, not dir.html

10. weird... can't put a cd \dir\dir\dir\ in a .csh file...

11. Is there a ksh method find find out who accessed you dirs?

12. du can't stat dir

13. how to print st_mtim; how to use stat() in a user given dir printout