df command hanging


 
Thread Tools Search this Thread
Operating Systems Solaris df command hanging
# 1  
Old 01-09-2012
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?.
# 2  
Old 01-09-2012
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
This User Gave Thanks to amitranjansahu For This Post:
# 3  
Old 01-09-2012
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?
This User Gave Thanks to zaxxon For This Post:
# 4  
Old 01-09-2012
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.
This User Gave Thanks to jim mcnamara For This Post:
# 5  
Old 01-09-2012
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.
# 6  
Old 01-09-2012
Quote:
Originally Posted by Ex-SUN
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?
# 7  
Old 01-09-2012
How to do it?


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

That should work even for Solaris 10.

Cheers.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk hanging from running command

awk -v youth=1599 -v d="$(/bin/ps -ef)" 'd ~/ 1599 / && d !~/ awk / && (($2 == youth) || ($3 == youth)) {print $2" "$3}' i feel like i'm very close here. what am i doing wrong? (1 Reply)
Discussion started by: SkySmart
1 Replies

2. UNIX for Dummies Questions & Answers

Sz command hanging and outputting ZNAK’s

Currently I am using the following sz and rz commands to run file transfer using ZMODEM within a perl script. sz -b -m1 -M2 -k -e -r -u -t10 rz -b -m 1 -M 120 -y Is there any flag setting that will allow me to terminate when a retry 0 error is outputted as this is constantly filling up my... (0 Replies)
Discussion started by: M1keSt4r
0 Replies

3. Shell Programming and Scripting

How to skip command if it is hanging while waiting for response

Hello, I have a script that contains the command "whois 1.2.3.4" Sometimes this command takes far too long to produce any output and as a result the rest of the script is not executed. Can anyone suggest a method so that if no output is produced after say 2 seconds the script skips that... (2 Replies)
Discussion started by: colinireland
2 Replies

4. Shell Programming and Scripting

script hanging???

ok... this is where i am at... i need a script to call another script as a wrapper because the first script creates a sub-shell. here is what i got... i kick off the first script "CCBDEMO-threadpoolworker.sh" #!/bin/bash clear #clearing screen directory="/data1/spl/cis/CCBDEMO/bin"... (1 Reply)
Discussion started by: Dagaswolf
1 Replies

5. Shell Programming and Scripting

Script is hanging

Hello, I have the following shell script and when i execute, it keeps hanging and nothing happens Please let me know. Requirement is to read data from file and pass it to the sql and create files as shown. code /******** #!/bin/sh while read user.dat do echo "user = $1 email =... (1 Reply)
Discussion started by: rakeshsr12
1 Replies

6. UNIX for Dummies Questions & Answers

Hanging port?

Ok, this question my be different. I can ping our unix box, but when we I to access the webpage I cant. To access the webpage I type http://ipaddress:some port. How do I check if a port is hanging and how would I un hang it. Sorry if question doesnt make sense. (1 Reply)
Discussion started by: NycUnxer
1 Replies

7. SuSE

ssh command on remote linux system hanging

Hi, Our systems: system1: amd 64 running suse linux 9 enterprize system2: amd 64 running esx vmware 3 with suse linux 9 enterprize. The problem is: when we ssh into system2 and execute the command: ls -al the session hangs. Infact session hangs when we execute any... (3 Replies)
Discussion started by: rajranibl
3 Replies

8. UNIX for Dummies Questions & Answers

ps command is hanging

Hi All, I am unable to figure out why my ps command is haning. Is some one else is running a process which is hanged. But in that case also if i do ps it should show only the processes running by me only. Thanks & Regards Gauri Agrawal (2 Replies)
Discussion started by: gauri
2 Replies

9. UNIX for Dummies Questions & Answers

how to tell if process is hanging

On Solaris 8.. 28166 user 3693M 2736M sleep 5 0 0:05.38 0.0% PROCESS/4 How can I tell if this process is doing anything or just hanging? (2 Replies)
Discussion started by: dangral
2 Replies

10. Programming

mq_open Hanging

One of my program which uses posix message queues was hanging in mq_open() system call, and after some time, it threw an error "Interrupted system call". I couldnt even unlink that message queue using mq_unlink(), as I have to use mq_open() prior to mq_unlink(). I use SunOS 5.7 Generic_106541-22... (0 Replies)
Discussion started by: Deepa
0 Replies
Login or Register to Ask a Question