Operating System - HP-UX
1830207 Members
1768 Online
109999 Solutions
New Discussion

using rm, space not freed up when bdf

 
SOLVED
Go to solution
Kevin Medlin
Occasional Contributor

using rm, space not freed up when bdf

Hello,

I'm using 11i. I needed to clear some space to uncompress a large file. I used the rm command on another large file to get the needed space. When I used the bdf command it showed that the space available had not changed. I thought maybe it is just a bdf error in reporting. I started to uncompress the file and it bombed because it ran out of space. This mount point is on an emc disk array.

Any ideas?

Thanks,
Kevin
11 REPLIES 11
Ken Hubnik_2
Honored Contributor
Solution

Re: using rm, space not freed up when bdf

There is a process tied to that file you deleted which means you have to figure out the process to kill before you can actually free up the space.
Steven E. Protter
Exalted Contributor

Re: using rm, space not freed up when bdf

This is a common problem when you delete files that are openned by a process.

fuser -cu on the filesystem to see if there are any open processes.

fuser -cuk /fsname will kill all processes on the filesystem. Don't do that on /var unless you like users to be kicked out.

lsof command will if installed let you track down and kill the offending processes.

If you reboot your box, the space will show free.

If the space is not critical, wait for the processes to fail or a maintenance window to boot.

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
Helen French
Honored Contributor

Re: using rm, space not freed up when bdf

The problem might be a process that still uses the deleted file. Check for any process that was holding the space and killing that process (or end that application) will free that space up. I would always prefer "du -k" command to check space usage instead of bdf.
Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: using rm, space not freed up when bdf

Hi Kevein:

Until the last process using a file terminates, merely removing a file leaves the space in-use.

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: using rm, space not freed up when bdf

Get lsof and run it piping the output to grep for the filename and I bet you have a process with the file still open.

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.67/

live free or die
harry
Live Free or Die
Jeff Schussele
Honored Contributor

Re: using rm, space not freed up when bdf

Hi Kevin,

Even though the rm command completed normally & the file "disappears" from ls listings, something still has it open so the space cannot be freed.
Use fuser or better yet lsof to determine the process that is still accessing it & stop or kill it, then the space will be truly freed.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
RAC_1
Honored Contributor

Re: using rm, space not freed up when bdf

It may be the acase that the file is being used by some process.

You can check it as follows.

fuser -u file_name.

or use lsof(list open files.)

Once process frees the file you will be able to reclaim the space.
There is no substitute to HARDWORK
Sridhar Bhaskarla
Honored Contributor

Re: using rm, space not freed up when bdf

Hi Kevin,

YOu have deleted a file that has been opened by a process. You will need to user 'lsof' to find the opened files on the filesystem. Unless you restart the processes that are accessing that file, the space won't get freed.

Search for lsof in these forums and you should get a site from where you can download it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Enrico P.
Honored Contributor

Re: using rm, space not freed up when bdf

Hi,
before delete a file you need:

fuser -fu

to see if the file is used and

fuser -ku

I think you need reboot your server.

Enrico
twang
Honored Contributor

Re: using rm, space not freed up when bdf

bdf shows the free disk space available.
It cannot see the blocks "occupied" by a still active process, for example an open log file is deleted but the process remains. the space will not been released.
bdf will see the change until the process terminates.

V. Nyga
Honored Contributor

Re: using rm, space not freed up when bdf

Hi cracks,

is there also another solution if:
1. dir isn't mounted
2. workstation is rebooted
3. space still isn't free:
kbytes used avial
4103198 3454239 238639

What's wrong?

Volkmar
*** Say 'Thanks' with Kudos ***