The UNIX and Linux Forums

The UNIX and Linux Forums (http://www.unix.com/index.php)
-   Solaris (http://www.unix.com/solaris/)
-   -   df command hanging (http://www.unix.com/solaris/174562-df-command-hanging.html)

vivek.goel.piet 01-09-2012 06:52 AM

df command hanging
 
Hi Folks,

When i execute the command
Code:

df -kh
in my system the o/p hangs..
The command runs fine but takes a lot of time before coming back to the # prompt.
Can anyone please suggest the possible cause and solution?.

amitranjansahu 01-09-2012 07:15 AM

Is there any external file system mounted on your machine ? If so may be one of the remote files system is taking time to respond.

whats the out put of the df -kh

zaxxon 01-09-2012 08:01 AM

Maybe you have any NFS mounts in there that take some time to respond? Can you make out which file system/mount point seems to hang, or does it display all of them and hangs afterwards?

jim mcnamara 01-09-2012 08:03 AM

One way to find the slowly responding file system. Suppose your df complets and gives you this meaningless example:

Code:

Filesystem            Size  Used Avail Use% Mounted on
/foo/fah              452G  59G  394G  13% /usr/bin
/                        452G  59G  394G  13% /
/foo/bar              452G  59G  394G  13% /foo

try:
Code:

for mpoint in  /  /foo /usr/bin
do
time df -h $mpoint
done

What you are seeing is probably some overloaded directories, directories that have thousands of files in them. Performance on those is usually slow.

Then try this on the filesystem that is slow
Code:

find [filesystem name goes here] -type d |
while read dir
do
  cnt=$(ls $dir| wc -l)
  echo "$dir has $cnt entries"
done

From there on you need to clean up and sometimes re-create directory files that are
a problem.

Ex-SUN 01-09-2012 02:39 PM

Also, if you have a DNS resolve issue, the df command result will take a long while to return. If your NFS mount points are all current, consider restarting the nscd process manually. Good luck.

vivek.goel.piet 01-09-2012 02:48 PM

Quote:

Originally Posted by Ex-SUN (Post 302588641)
Also, if you have a DNS resolve issue, the df command result will take a long while to return. If your NFS mount points are all current, consider restarting the nscd process manually. Good luck.

Thanks for all the replies... But how to do it?

Ex-SUN 01-09-2012 05:25 PM

How to do it?


sh /etc/init.d/nscd stop
sh /etc/init.d/nscd start

That should work even for Solaris 10.

Cheers.


All times are GMT -4. The time now is 04:41 AM.

Linux and Unix Supported by: vBulletin
Search Engine Optimisation provided by DragonByte SEO v1.1.4 (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
The UNIX and Linux Forums Content Copyright ©1993-2013. All Rights Reserved.
Forum Operations by The UNIX and Linux Forums