Operating System - HP-UX
1819870 Members
2493 Online
109607 Solutions
New Discussion юеВ

Deleting files is not recovering disk space

 
SOLVED
Go to solution
Dermot Beirne
Frequent Advisor

Deleting files is not recovering disk space

Hi All,
I have a worrying problem that I havent' seen before. I am removing and moving very large amounts of disk space from a filesystem which is running very low on space. I have just moved over 4GB of files from this filesystem to another, but on doing a bdf or dfspace command, it is showing NO extra space being available in the filesystem that I just moved the 4GB of files from. Has anyone seen this before, and any advice on what to do?
Thanks
Dermot
Happy is harder than money. Anyone who thinks money will make them happy, doesn't have money.
11 REPLIES 11
Robin Wakefield
Honored Contributor

Re: Deleting files is not recovering disk space

Hi Dermot,

Are you sure the files you removed were not hard-linked, and they were *definitely* on the filesystem in question?

Rgds, Robin
Mark van Hassel
Respected Contributor

Re: Deleting files is not recovering disk space

Dermot,

Try to umount and mount the FS again.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Praveen Bezawada
Respected Contributor
Solution

Re: Deleting files is not recovering disk space

HI
We had a similar situation where filesystem was being shown 100% full even after we deleted files over 2 GB.
It turned out that some processes which were writing into those files were still alive, so even though the space was freed by rm , it was still not available. Once we killed those processes, the space was freed.
Also it could be that the files you moved were just softlinks to the actual files so even after moving them you have created no extra space. Check if the space on filesystem where you moved the files has increased.

Hope this helps....
...BPK...

harry d brown jr
Honored Contributor

Re: Deleting files is not recovering disk space

Praveen is probably 99% correct. Some process has these files open, and even though you "delete" the filename from the directory, the inodes are still in use, so until the process that has them open dies, they will still consume the disk space. If you don't already have the command "lsof", try downloading it and using it. Look for the file names that you deleted and you will find the process(es) that have them open.

"lsof" can be found here:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.55/



Live Free or Die
Magdi KAMAL
Respected Contributor

Re: Deleting files is not recovering disk space

Hi Dermot,

Confirming what had been posted till know, try also the command :

#du -k /dir ? more

This will scan all directories expressed in kilobytes. And you can really verify the problem where it comes from.

Magdi
Joseph Chakkery
Valued Contributor

Re: Deleting files is not recovering disk space

Hello,

Probably the files u moved might be opened by some process. Even if u move that file Since it is opened it won't release the space.
So when ever u delete or move a file fine out the file is been used by any process by fuser command. fuser then full path name of the file will give u the process id holding the file.
eg: $fuser /application/qapro/abcd.dat

ucan kill the process using fuser -k and proc id before moving the file.

Hope this may help U.
Regards
Joe.
For more details man fuser.
Knowledge is wealth
Darrell Allen
Honored Contributor

Re: Deleting files is not recovering disk space

Dead on about open files being deleted or moved by another process. bdf will show the space still used.

du on the other hand will not show that space (because the file is already gone as far as the du command is concerned) so it probably won't help identify the culprit.

If du and bdf report nearly the same amount of space used then "deleted while open" files is not the issue.
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Dermot Beirne
Frequent Advisor

Re: Deleting files is not recovering disk space

Thanks to you all for all the information.
The problem was to do with the files being accessed at time of move/delete. When I traced and killed the processes that were attached to the files the 4GB "appeared".

Regards,
Dermot.
Happy is harder than money. Anyone who thinks money will make them happy, doesn't have money.
nancy rippey
Trusted Contributor

Re: Deleting files is not recovering disk space

I had the same problem earlier this week with my root filesystems. By running lsof I was able to locate the problem.
Run lsof and redirect the output > /tmp/lsof.out
Look for entries that have /dev/dsk/vg## in the last column these are processes that can still be writing even though space has been cleared up. In my case it was a glance process. An example of the lsof is
emsagent 1502 root 0w VREG 64,0x2 47387 1884 / (/dev/vg00/l
vol3)
where=emsagent is the process name
1502= is the process number
/ = the filesystem that is being written to
/dev/vg00/lvol3=gives an inidication that the problem could be there.

By killing the process giving me problems I went from 97% full to 65%.

Hope this helps.
nancy
nrip
CHRIS_ANORUO
Honored Contributor

Re: Deleting files is not recovering disk space

Hi,

It is good to know the solution to your problem, there is a hint in one of the answers, pls give due points.

Regards
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
PVNV  PRASAD
Occasional Contributor

Re: Deleting files is not recovering disk space

here is lanscan o/p. lan1 is the active i/f.