LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 12-13-2012, 10:44 PM   #1
noob189
LQ Newbie
 
Registered: May 2012
Posts: 6

Rep: Reputation: Disabled
RHEL 5.6 "ls -l" command hang


Hi guys,

I having issue on execute command "ls -l" hanging for few minutes, Normally this only happen on folder has many files/folder. but now it happen on small files/folder too.
i hope i can find the solution in this forum before i escalate to red hat support.

Please advise.

Thanks.
 
Old 12-13-2012, 10:54 PM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,220

Rep: Reputation: 231Reputation: 231Reputation: 231
It could probably be that your 'ls' is tied to a circuitous alias; before you detach it you first make a back up (we don't know what the RH people wanted it to), so back it up:
Code:
alias >> my_aliases.txt
then (I am only assuming it is aliased, as usually it is with most distros), remove the alias to run 'ls' in plain vanilla--

Code:
unalias ls
Exit. Launch. (Terminal.) Check use ls.

Hope that helps.

Note: If this doesn't work check your system for "rootkits"! clean and install a fresh copy of bash.

Good luck.
 
Old 12-14-2012, 10:47 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 669

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by noob189 View Post
Hi guys,

I having issue on execute command "ls -l" hanging for few minutes, Normally this only happen on folder has many files/folder. but now it happen on small files/folder too.
i hope i can find the solution in this forum before i escalate to red hat support.

Please advise.

Thanks.
Is just 'ls' command take a long time too?

If 'ls' is quick and 'ls -l' is slow - do you by any chance use NIS/NIS++?
Is your NIS server OK?
 
Old 12-14-2012, 11:24 AM   #4
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 867
Blog Entries: 2

Rep: Reputation: 216Reputation: 216Reputation: 216
Is "ls -f" much faster? That doesn't bother to sort names into order (so saves time).

Putting too many files into one directory is unwise partly for the performance hit. Is it a local filesystem, and what format?
 
Old 12-17-2012, 04:16 AM   #5
noob189
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi all,

Sorry for late reply.

Quote:
Is just 'ls' command take a long time too?

If 'ls' is quick and 'ls -l' is slow - do you by any chance use NIS/NIS++?
Is your NIS server OK?
'ls' command quick print the output. it's has problem with 'ls -l,ls -la & ll' command it's take a couple of minute to print the output.

Quote:
Is "ls -f" much faster? That doesn't bother to sort names into order (so saves time).

Putting too many files into one directory is unwise partly for the performance hit. Is it a local filesystem, and what format?
i try 'ls -f' it fast same as i executing command ls
yes it is a local filesystem format ext3.

@malekmustaq - i tried 'unalias ls' the output
[root@mymcb-nbm02 ~]# unalias ls
-bash: unalias: ls: not found

i'm beginner in linux technical issue.
Please advise

Thanks.

Last edited by noob189; 12-17-2012 at 04:20 AM. Reason: add some more info
 
Old 12-17-2012, 05:04 AM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 867
Blog Entries: 2

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
'ls' command quick print the output. it's has problem with 'ls -l,ls -la & ll' command it's take a couple of minute to print the output.
In that case your problem comes from looking up UIDs to usernames (could involve NIS as suggested by another user).
Do you have full disk in /tmp/ or /var/tmp/ ? This could interfere with caching.
What's in your /etc/nsswitch.conf ?
 
Old 12-17-2012, 11:04 PM   #7
noob189
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linosaurusroot View Post
In that case your problem comes from looking up UIDs to usernames (could involve NIS as suggested by another user).
Do you have full disk in /tmp/ or /var/tmp/ ? This could interfere with caching.
What's in your /etc/nsswitch.conf ?
full disk you mean the capacity for /tmp/ or /var/tmp ?

Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p3    130521568  34179212  89605100  28% /
/dev/cciss/c0d0p1       194442     12172    172231   7% /boot
tmpfs                  3051140         0   3051140   0% /dev/shm
tmpfs                  3051140      1248   3049892   1% /tmp
/dev/cciss/c0d1p1    576674672    218820 547162476   1% /netbackup_restore
this is in my /etc/nsswitch.conf

Code:
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       nis or yp               Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files nisplus
shadow:     files nisplus
group:      files nisplus

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files     

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus
i don't know much about NIS. as i said i'm beginner in linux
 
Old 12-20-2012, 02:32 AM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
This
Code:
passwd:     files nisplus
shadow:     files nisplus
group:      files nisplus
shows you are likely using nisplus, which is a centralised auth system which means all the file ownerships (user+group) have to be looked up on the central server.
http://www.eng.auburn.edu/~rayh/solaris/NIS+_FAQ.html
 
Old 12-20-2012, 01:05 PM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 669

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by chrism01 View Post
This
Code:
passwd:     files nisplus
shadow:     files nisplus
group:      files nisplus
shows you are likely using nisplus, which is a centralised auth system which means all the file ownerships (user+group) have to be looked up on the central server.
http://www.eng.auburn.edu/~rayh/solaris/NIS+_FAQ.html
And likely your nisplus server down/very slow.
 
Old 12-21-2012, 09:54 PM   #10
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 187

Rep: Reputation: 30
autofs, usb, nfs mounted file systems

When this happens to me it is usually because the file system has to be mounted or awakened.

* autofs mounted file systems will have this behavior
* NFS mounted file systems, that are mounted but not attached, will have this same behavior
* file systems accessed via USB will also have this behavior

So ... provide the content of this file: /etc/fstab

And ... what directory are you in when you do the 'ls' command? We can tell from /etc/fstab file if the directory if it is a file system mount issue.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Correlation between "free -m" shared line & "/proc/meminfo" shmem RHEL 6.2 - Anyone? xenner Linux - General 3 11-15-2012 06:36 PM
RHEL 5.4, "crontab" command not found borfgordon Linux - Software 1 11-20-2009 12:30 PM
Question about "ls -f -l" command output in RHEL 5.2 and Red Hat 6 eaerhard Linux - Newbie 2 06-11-2009 07:48 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
RHEL 3 system hang when invoke "ps" pxsnet Linux - Enterprise 11 06-02-2007 09:33 PM


All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration