ls hangs on a directory

Running Red Hat Enterprise Linux Server release 5.1 (Tikanga) 2.6.18-53.el5

Trying to do an 'ls' of a sub-directory and the prompt never returns. Same problem running a find command as well.

I have done an fsck on the file system (no problems) and can view other sub-directories on this file system.

I can run an strace ls or and ltrace ls and get a response.

I suspect there are too many files in the sub-directory but could use some help.

thanks,

Jon

It is possible that you have an NFS mount to a server you no longer have a connection or access to.

Type mount to see the list of mount points.

No this is a local file system - no NFS mounts exist.

what does

ls -ld problem_directory
cd problem_directory
df -i .

show? if df completes in finite time ....

I thought of that....

ls -ld /files/amp
drwxrwxr-x 2 775 oacapp 695459840 Jan 5 13:49 /files/foobar

df -i .
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdb1 26214400 7541112 18673288 29% /files

I think the problem is too many files in this subdirectory. Not sure how it happened but there are about +6 million files. I am using the output from the strace /bin/ls -l to manage the files. Slow but it is working.

Yes - you have WAY to many files to allow for good performance.

That is exactly what this says:

drwxrwxr-x 2 775 oacapp 695459840 Jan 5 13:49 /files/foobar

the directory file itself is enormous.