1830508 Members
2489 Online
110006 Solutions
New Discussion

Space not freeing up

 
Jayson Hurd_2
Advisor

Space not freeing up

I have deleted a 2GB file from a full volume. 'du -sk' shows it's gone, but the bdf shows it as still 100% full and I can't copy any files to it.

Why is this space not releasing?
Most things worth having don't come easily.
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: Space not freeing up

There is an open process that thinks it owns the file.

You have to kill it.

The fast way is to boot the box.

The slow way is:

fuser -cu /filesystemname

Identify and delete the appropriate process.

The fast, destructive way is

fuser -cuk /filesystemname

The results can be anywhere from timid to catastrophic.

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
Patrick Wallek
Honored Contributor

Re: Space not freeing up

It is always a good idea to check and see if there is a process using a file before you rm it.

# fuser -u filename

will give the pid(s) and the username(s) that have a file open.

As said above, in order for the space to be released, the process that is accessing that file must be stopped / killed.
kamal_9
Super Advisor

Re: Space not freeing up

Hi
Check for the process using that file .
# fuser -cu filename
and try killingthe process
# fuser -cuk filename
And try dimounting the filesystem and mount again
Bill Hassell
Honored Contributor

Re: Space not freeing up

AS mentioned, one or more processes have the file open. Unix does not really delete a file. The filesystem code marks the link count zero but will not kill any process(es) that still have the file open. Unfortunately, fuser does not always show the process(es) which have file(s) open on the mountpoint. Try:

fuser /mount_point
fuser /dev/vgXX/lvolYY
fuser /dev/vgXX/rlvolYY

where /dev/vgXX/lvolYY is the source for the mountpoint. If nothing is shown, you'll have to reboot, or get a copy of lsof (List Open Files) which will show the processes that are keeping the mountpoint open.


Bill Hassell, sysadmin
T G Manikandan
Honored Contributor

Re: Space not freeing up

The way I would suggest is to check the application files that are on the file system.

check what application accesses that mountpoint.

you can shutdown the application processes to free up the space.

fuser -cu /mountpoint
Elmar P. Kolkman
Honored Contributor

Re: Space not freeing up

If you have lsof on your system, you could try the suggestion I did or Jean-Luc's script from this thread (both do it the same way, but one automatic and one by hand).

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=380187
Every problem has at least one solution. Only some solutions are harder to find.
Fabio Ettore
Honored Contributor

Re: Space not freeing up

Hi,

a lot of responses are right about reasons of bdf is not freeing up the space.
I think that du -sk is more believable than bdf. Then suggestions about use of lsof are the best solution, of course supposing that immediately a reboot is not possible.

Best regards,
Ettore
WISH? IMPROVEMENT!
KapilRaj
Honored Contributor

Re: Space not freeing up

Use "lsof" to find out the process and then kill that process too

Kaps
Nothing is impossible