Operating System - HP-UX
1828667 Members
1405 Online
109984 Solutions
New Discussion

Disk space not recovered with the rm -i command

 
Donna Price
Occasional Advisor

Disk space not recovered with the rm -i command

I am running hp-ux 11.0. When I use the rm -i command to remove a file, the file is deleted but I do not get the disk space back when I check bdf. If I use rm to remove a file, the file is deleted and bdf shows that the disk space is available.
6 REPLIES 6
Helen French
Honored Contributor

Re: Disk space not recovered with the rm -i command

Hi,

hmmm ..normally it should do the same. rm -i will just give you a prompt for confirmation.

Did you check the disk usage through du -k ?

Check for any alias set for rm and rm -i ?

Sometimes 'bdf' will take time to report the correct file system usage. Use du -k and check.

HTH,
Shiju
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: Disk space not recovered with the rm -i command

Hi Donna:

I assume that you answered 'y'. I suspect that your real problem is that a process still had these files open and that is why the space is not returned. A file is only deleted when all the processes that have a file open have closed it or terminated. The directory entry is removed but the data remains intact and in use until then. You can check this using fuser (or better yet, lsof - available from any of the HP-UX Porting Centre's). Man fuser for details.

Regards, Clay
If it ain't broke, I can fix that.
Donna Price
Occasional Advisor

Re: Disk space not recovered with the rm -i command

Thanks for the information. The du -k command did show that the disk space was available when the bdf command did not. I finally had to shutdown the system and restart it to see the disk space was available in bdf.
Sanjay_6
Honored Contributor

Re: Disk space not recovered with the rm -i command

Hi Donna,

You could have removed the file, tried to sync the info, and then checked the bdf,

rm -i file_name
sync
bdf

Hope this helps.

Regds
harry d brown jr
Honored Contributor

Re: Disk space not recovered with the rm -i command

Donna,

Before deleting files, use "lsof" to determine if they are in use. If they are open, you can "delete" the file, but the space WILL NOT be returned to the filesystem until the user closes the file.

http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/lsof-4.55/


live free or die
harry
Live Free or Die
Ruediger Noack
Valued Contributor

Re: Disk space not recovered with the rm -i command

...or if "lsof" isn't available simply use "fuser" to check if the file is open.
After executing of "rm" it's very difficult to find the processes they hold the deleted files open.

Ruediger