1833796 Members
5159 Online
110063 Solutions
New Discussion

rm hanging

 
GBR
Regular Advisor

rm hanging

Hello,

I was in the middle of transferring a file from a Windows box to an HP-UX server (via ftp) when I decided to cancel the ftp from the windows machine. I then logged onto the HP-UX server to delete the partially transmitted file, but the rm command just hangs. Does anyone have an idea of how this can be resolved?

GBR
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: rm hanging

Shalom,

You need to terminate the ftpd process associated with the file before you can delelte the file. Its got an open file handle and is causing the hang.

If you kill the ftpd process or better yet, stop the ftp process on the windows box, this situation will be resolved.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: rm hanging

Hi:

> You need to terminate the ftpd process associated with the file before you can delelte the file. Its got an open file handle and is causing the hang.

You most certainly can remove (delete) open files. The space allocated to the file is simply not removed until its link count reaches zero.

I would ask, instead, if you are dealing with an NFS mount that has gone stale. Another symptom of such a stale handle would be an unresponsive 'ls' and/or 'bdf'.

Regards!

...JRF...
GBR
Regular Advisor

Re: rm hanging

1. bdf is responding well, and so is ls.
2. I tried kill and kill -9 on the ftpd process that was transferring the file and still nothing. The rm is still hanging.
3. The windows process was terminated as well, or at least I think it was. I killed the ftp client that was making the transfer.

GBR
V. Nyga
Honored Contributor

Re: rm hanging

Hi,

what does fuser says?
'll' (long-list) in the directory works?

Volkmar
*** Say 'Thanks' with Kudos ***
GBR
Regular Advisor

Re: rm hanging

1. ll works in the directory where the file resides.
2. fuser returns:
: 2943o

rm is still hung.

GBR
James R. Ferguson
Acclaimed Contributor

Re: rm hanging

Hi (again):

Let's make sure you are running what you think you should be. What do this return?

# whence -v rm
# whence -p rm

In fact, try using the absolute path:

# /usr/bin/rm file_to_remove

Regards!

...JRF...
john korterman
Honored Contributor

Re: rm hanging

Hi,

have you checked your syslog for a possible disk problem?
It sounds as if the rm command is waiting for an answer - which it apparently does not get - from a disk.

regards,
John K.
it would be nice if you always got a second chance
GBR
Regular Advisor

Re: rm hanging

Yup, I have some disk issues. I checked my syslog and ran a dmesg. I'm recieving async read errors.

What's the best way to check for disk corruption? Would it be the dd command?

GBR
Robert-Jan Goossens_1
Honored Contributor

Re: rm hanging

Hi,

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

Have a look at above doc.

Regards,
Robert-Jan
GBR
Regular Advisor

Re: rm hanging

Robert-Jan, thanks for the document!

Thank you all. I will take it from here.

GBR