LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 09: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, 09:54 PM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.
 
1 members found this post helpful.
Old 12-14-2012, 09:47 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
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, 10:24 AM   #4
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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, 03: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 03:20 AM. Reason: add some more info
 
Old 12-17-2012, 04:04 AM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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, 10: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, 01:32 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 12:05 PM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
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, 08:54 PM   #10
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196

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



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 05:36 PM
RHEL 5.4, "crontab" command not found borfgordon Linux - Software 1 11-20-2009 11:30 AM
Question about "ls -f -l" command output in RHEL 5.2 and Red Hat 6 eaerhard Linux - Newbie 2 06-11-2009 06:48 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
RHEL 3 system hang when invoke "ps" pxsnet Linux - Enterprise 11 06-02-2007 08:33 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:21 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
Open Source Consulting | Domain Registration