[opensuse] error with the Find command
Hi have an Linux SUSE 10.x installed in my system on AMD 64, Hi, I am facing problem with find command, When I enter find / -name test.sh -print or only find from root command it throws an error as # find / -name test.sh -print find: /etc: No such file or directory find: /proc: No such file or directory find: /sys: No such file or directory find: /dev: No such file or directory find: /var: No such file or directory find: /usr: No such file or directory find: /opt: No such file or directory find: /bin: No such file or directory find: /boot: No such file or directory find: /home: No such file or directory find: /lib: No such file or directory find: /lib64: No such file or directory find: /media: No such file or directory find: /mnt: No such file or directory find: /root: No such file or directory find: /sbin: No such file or directory find: /srv: No such file or directory find: /tmp: No such file or directory But the same works when I specify the full path as Find /root/ (or /usr/) -name test.sh -print Any help would be appreciated on this. and one more example :~ # find / -type f -name "test" -print find: /etc: No such file or directory find: /proc: No such file or directory find: /sys: No such file or directory find: /dev: No such file or directory find: /var: No such file or directory find: /usr: No such file or directory find: /opt: No such file or directory find: /bin: No such file or directory find: /boot: No such file or directory find: /home: No such file or directory find: /lib: No such file or directory find: /lib64: No such file or directory find: /media: No such file or directory find: /mnt: No such file or directory find: /root: No such file or directory find: /sbin: No such file or directory find: /srv: No such file or directory find: /tmp: No such file or directory find: /Source: No such file or directory find: /mysql-data: No such file or directory find: /mysql-logs: No such file or directory :~ # regards Anil -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anil Kalasa wrote:
I am facing problem with find command,
When I enter find / -name test.sh -print or only find from root command it throws an error as
# find / -name test.sh -print find: /etc: No such file or directory find: /proc: No such file or directory
I've only seen such errors when the file system was damaged. (Or when they are dangling symlinks, but I don't expect /etc to be a symlink.) Are there any error messages when you call: ls -l / Output of ls -ld /etc ? stat /etc ? Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
No it just works fine, with ls -ld command, only problem is when I use
the command find.
regarding file system everything else is wokring fine, only locate and
find is not working.
error as ...
# find
.
./lost+found
find: ./etc: No such file or directory
find: ./proc: No such file or directory
find: ./sys: No such file or directory
find: ./dev: No such file or directory
find: ./var: No such file or directory
find: ./usr: No such file or directory
find: ./opt: No such file or directory
find: ./bin: No such file or directory
find: ./boot: No such file or directory
find: ./home: No such file or directory
find: ./lib: No such file or directory
find: ./lib64: No such file or directory
find: ./media: No such file or directory
find: ./mnt: No such file or directory
find: ./root: No such file or directory
find: ./sbin: No such file or directory
find: ./srv: No such file or directory
find: ./tmp: No such file or directory
./altiris-adlagent-2.6-12.x86_64.bin
./adlagent.conf.default
./.hpshm_keyfile
./findutils-locate-4.2.27-14.2.x86_64.rpm
./findutils-4.2.27-14.2.x86_64.rpm
regards
Anil
On 1/22/07, Joachim Schrod
Anil Kalasa wrote:
I am facing problem with find command,
When I enter find / -name test.sh -print or only find from root command it throws an error as
# find / -name test.sh -print find: /etc: No such file or directory find: /proc: No such file or directory
I've only seen such errors when the file system was damaged. (Or when they are dangling symlinks, but I don't expect /etc to be a symlink.)
Are there any error messages when you call: ls -l / Output of ls -ld /etc ? stat /etc ?
Joachim
-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I get the below error as well.
Hard link count is wrong for /proc: this may be a bug in your
filesystem driver. Automatically turning on find's -noleaf option.
Earlier results may have failed to include directories that should
have been searched.
On 1/22/07, Anil Kalasa
No it just works fine, with ls -ld command, only problem is when I use the command find.
regarding file system everything else is wokring fine, only locate and find is not working.
error as ...
# find . ./lost+found find: ./etc: No such file or directory find: ./proc: No such file or directory find: ./sys: No such file or directory find: ./dev: No such file or directory find: ./var: No such file or directory find: ./usr: No such file or directory find: ./opt: No such file or directory find: ./bin: No such file or directory find: ./boot: No such file or directory find: ./home: No such file or directory find: ./lib: No such file or directory find: ./lib64: No such file or directory find: ./media: No such file or directory find: ./mnt: No such file or directory find: ./root: No such file or directory find: ./sbin: No such file or directory find: ./srv: No such file or directory find: ./tmp: No such file or directory ./altiris-adlagent-2.6-12.x86_64.bin ./adlagent.conf.default ./.hpshm_keyfile ./findutils-locate-4.2.27-14.2.x86_64.rpm ./findutils-4.2.27-14.2.x86_64.rpm
regards Anil
On 1/22/07, Joachim Schrod
wrote: Anil Kalasa wrote:
I am facing problem with find command,
When I enter find / -name test.sh -print or only find from root command it throws an error as
# find / -name test.sh -print find: /etc: No such file or directory find: /proc: No such file or directory
I've only seen such errors when the file system was damaged. (Or when they are dangling symlinks, but I don't expect /etc to be a symlink.)
Are there any error messages when you call: ls -l / Output of ls -ld /etc ? stat /etc ?
Joachim
-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
"AK" == Anil Kalasa
writes:
AK> No it just works fine, with ls -ld command, only problem is when I use AK> the command find. AK> regarding file system everything else is wokring fine, only locate and AK> find is not working. AK> error as ... AK> # find AK> . AK> ./lost+found AK> find: ./etc: No such file or directory AK> find: ./proc: No such file or directory You mentioned that already; that doesn't help to identify your problem. It's quite clear WHAT happens, but not WHY it happens. That message appears when there is an entry in the directory list and the inode of that entry could not be opened. The directory list only contains the name and the inode number, so find knows that there should something be there. But when the respective directory (e.g., /etc) shall be opened, the Linux filesystem returns ENOENT (no such file or directory) since it doesn't find that inode. As I wrote, that happens normally only with dangling symlinks or when a file system is damaged. And it's very strange that the lost+found directory could be opened, but etc couldn't. So it's not a general problem with all directory entries. That's the reason why I asked for the output of ls -l / (actually, ls -li / would be even better) and of stat /etc. Maybe one can get a clue from that output. With the currently available information, the probability of help for you is low. Joachim PS: Please answer only to the list. I don't read opensuse by email and I don't want that stuff in my inbox. I also won't react faster when you stuff my inbox, that just makes me loose interest in your problem. Thanks. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi Joachim
please find the below details as you requested,
# ls -li
total 1456
32 -rwx------ 1 root root 0 Nov 1 11:11 .hpshm_keyfile
205 -rw-r--r-- 1 root root 524346 Jan 4 12:50 SAN
8552449 drwxr-xr-x 2 root root 4096 Jan 4 12:49 Source
31 -rw-r--r-- 1 root root 8395 Jul 6 2006 adlagent.conf.default
19 drwxr-xr-x 2 root root 4096 Jul 6 2006 bin
20 drwxr-xr-x 3 root root 4096 Jan 4 17:57 boot
33 -rw-r--r-- 1 root root 121 Jan 4 12:05 config.log
696 drwxr-xr-x 12 root root 6680 Jan 21 15:22 dev
12 drwxr-xr-x 72 root root 8192 Jan 22 14:06 etc
267 -r--r--r-- 1 root root 283110 Jan 21 15:37
findutils-4.2.27-14.2.x86_64.rpm
265 -r--r--r-- 1 root root 84608 Jan 21 15:37
findutils-locate-4.2.27-14.2.x86_64.rpm
21 drwxr-xr-x 3 root root 4096 Jan 9 11:42 home
22 drwxr-xr-x 8 root root 4096 Jul 6 2006 lib
23 drwxr-xr-x 5 root root 4096 Jul 6 2006 lib64
11 drwx------ 2 root root 16384 Jul 6 2006 lost+found
1856 dr-xr-xr-x 6 root root 4096 Jul 6 2006 media
25 drwxr-xr-x 2 root root 4096 Jun 16 2006 mnt
18 drwxr-xr-x 9 root root 4096 Jan 4 17:02 opt
1 dr-xr-xr-x 127 root root 0 Jan 10 09:20 proc
26 drwx------ 21 root root 4096 Jan 22 14:51 root
27 drwxr-xr-x 3 root root 8192 Nov 1 11:10 sbin
28 drwxr-xr-x 4 root root 4096 Jul 6 2006 srv
1 drwxr-xr-x 11 root root 0 Jan 10 09:20 sys
29 drwxrwxrwt 8 root root 4096 Jan 22 15:04 tmp
17 drwxr-xr-x 13 root root 4096 Jan 4 12:59 usr
16 drwxr-xr-x 15 root root 4096 Jan 4 12:59 var
On 1/22/07, Joachim Schrod
"AK" == Anil Kalasa
writes: AK> No it just works fine, with ls -ld command, only problem is when I use AK> the command find.
AK> regarding file system everything else is wokring fine, only locate and AK> find is not working.
AK> error as ...
AK> # find AK> . AK> ./lost+found AK> find: ./etc: No such file or directory AK> find: ./proc: No such file or directory
You mentioned that already; that doesn't help to identify your problem. It's quite clear WHAT happens, but not WHY it happens.
That message appears when there is an entry in the directory list and the inode of that entry could not be opened. The directory list only contains the name and the inode number, so find knows that there should something be there. But when the respective directory (e.g., /etc) shall be opened, the Linux filesystem returns ENOENT (no such file or directory) since it doesn't find that inode.
As I wrote, that happens normally only with dangling symlinks or when a file system is damaged.
And it's very strange that the lost+found directory could be opened, but etc couldn't. So it's not a general problem with all directory entries.
That's the reason why I asked for the output of ls -l / (actually, ls -li / would be even better) and of stat /etc. Maybe one can get a clue from that output. With the currently available information, the probability of help for you is low.
Joachim
PS: Please answer only to the list. I don't read opensuse by email and I don't want that stuff in my inbox. I also won't react faster when you stuff my inbox, that just makes me loose interest in your problem. Thanks.
-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anil Kalasa wrote:
# ls -li total 1456 32 -rwx------ 1 root root 0 Nov 1 11:11 .hpshm_keyfile 205 -rw-r--r-- 1 root root 524346 Jan 4 12:50 SAN 8552449 drwxr-xr-x 2 root root 4096 Jan 4 12:49 Source 31 -rw-r--r-- 1 root root 8395 Jul 6 2006 adlagent.conf.default 19 drwxr-xr-x 2 root root 4096 Jul 6 2006 bin 20 drwxr-xr-x 3 root root 4096 Jan 4 17:57 boot 33 -rw-r--r-- 1 root root 121 Jan 4 12:05 config.log 696 drwxr-xr-x 12 root root 6680 Jan 21 15:22 dev 12 drwxr-xr-x 72 root root 8192 Jan 22 14:06 etc
No duplicate inodes, links seem to be OK, no problem to see. I don't have any other idea short of stracing find. strace find / -maxdepth 2 2>/tmp/find.log >/dev/null must output something like ... open("/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 fstat64(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 getdents64(4, /* 30 entries */, 4096) = 784 getdents64(4, /* 0 entries */, 4096) = 0 close(4) = 0 open("/", O_RDONLY|O_LARGEFILE|O_NOFOLLOW) = 4 fchdir(4) = 0 close(4) = 0 stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat64("lost+found", {st_mode=S_IFDIR|0700, st_size=16384, ...}) = 0 open("lost+found", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 fstat64(4, {st_mode=S_IFDIR|0700, st_size=16384, ...}) = 0 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 getdents64(4, /* 2 entries */, 4096) = 48 getdents64(4, /* 0 entries */, 4096) = 0 close(4) = 0 open("lost+found", O_RDONLY|O_LARGEFILE|O_NOFOLLOW) = 4 fchdir(4) = 0 close(4) = 0 stat64(".", {st_mode=S_IFDIR|0700, st_size=16384, ...}) = 0 open("..", O_RDONLY|O_LARGEFILE|O_NOFOLLOW) = 4 fchdir(4) = 0 close(4) = 0 lstat64("etc", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0 open("etc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 fstat64(4, {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 getdents64(4, /* 129 entries */, 4096) = 4080 getdents64(4, /* 92 entries */, 4096) = 2968 getdents64(4, /* 86 entries */, 4096) = 2936 getdents64(4, /* 0 entries */, 4096) = 0 close(4) = 0 ... This is the place where find reads the / directory entries, reads and recurses into lost+found (which works at your system), and opens and reads etc (which doesn't work). Frankly, I suspect that this won't show your error cause either, but one can only hope to get more information that finally gives a clue to what happens here. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Anil Kalasa
-
Joachim Schrod