Operating System - HP-UX
1835545 Members
2972 Online
110078 Solutions
New Discussion

rm on a file that was open: FS remaining at 100% full

 
Romaric Guilloud
Regular Advisor

rm on a file that was open: FS remaining at 100% full

Someone her did a rm on a huge log file that was still being opened by a a process.
Now, despite the file is gone, the FS remains at 100% whereas du -ks /FS displays it's barely used.
I heard about /var/PSS/tools/uli to fix this but can't find the correct syntax to do so.
Thanks in advance for your help.
Rgds.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
7 REPLIES 7
Mark Grant
Honored Contributor

Re: rm on a file that was open: FS remaining at 100% full

It means the file is still open. You need to stop the process that is writing to the log file.

In future, it might be worth doing "> logfile" instead of just removing it.
Never preceed any demonstration with anything more predictive than "watch this"
Robert-Jan Goossens
Honored Contributor

Re: rm on a file that was open: FS remaining at 100% full

Hi,

Track down the process with a tool like lsof or fuser. Kill the process ore restart the application.

Regards,
Robert-Jan
Paula J Frazer-Campbell
Honored Contributor

Re: rm on a file that was open: FS remaining at 100% full

Hi

Kill the process that is holding the file.
Search for and install lsof (list open files).


Paula
If you can spell SysAdmin then you is one - anon
Romaric Guilloud
Regular Advisor

Re: rm on a file that was open: FS remaining at 100% full

Hi there,
I can't stop the Oracle instance that was filling this log file, i need to have the filesystem space to be returned to free pool online.
Once again, uli is documented to be used to do such a thing and I used to use it once in the past for the same thing (somebody erase an opened file the same way).
Unfortunatley I can't remember how.
Any idea?
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
MarkSyder
Honored Contributor

Re: rm on a file that was open: FS remaining at 100% full

Hi,

I've never used uli, but you'll often find that unix utilities come with a manual page. Have you tried man uli?

Have you checked whether or not the file still exists with find? As suggested already, > filename will delete the contents without deleting the file. It is safe for you to do this while the file is open - I know, because I've done it plenty of times in similar circumstances.

Sorry I can't be any help wrt uli - I hope someone else manages to help with this.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Romaric Guilloud
Regular Advisor

Re: rm on a file that was open: FS remaining at 100% full

Found out in the meantime I'll be forced to stop the attached processes.
Thanks anyway all.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
Paula J Frazer-Campbell
Honored Contributor

Re: rm on a file that was open: FS remaining at 100% full

HI

The unlink() system call removes the directory entry named by the path name pointed to by path.
When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, only the directory entry is removed immediately so that processes that do not already have the file open cannot access the file. After all processes close their references to the file, if there are no more links to the file, the space occupied by the file is then freed and the file ceases to exist.



Paula
If you can spell SysAdmin then you is one - anon