Operating System - HP-UX
1834714 Members
2383 Online
110069 Solutions
New Discussion

Re: bdf and du -sk differ - can I correct it without a reboot

 
SOLVED
Go to solution
Roland Rebstock_1
Frequent Advisor

bdf and du -sk differ - can I correct it without a reboot

All, a bdf shows a filesystem at 352321536 KB, 335468848 used with 16724584 Available. A 52GB file was deleted and bdf did not change but a du -sk shows 278863624 used which seems to coorelate with what was deleted. How do you correct bdf? In the past we have had to reboot. The server is a N4000-440 running HPUX11.0
4 REPLIES 4
Thierry Poels_1
Honored Contributor
Solution

Re: bdf and du -sk differ - can I correct it without a reboot

hi,

the file deleted was still in use by a process. Killing/stopping that process will release the free space.

"fuser /filesystem" might show the process, or else use "lsof".

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Sanjay_6
Honored Contributor

Re: bdf and du -sk differ - can I correct it without a reboot

Hi,

Was there a process using the file that was deleted. If the process was still running, the space will not be released even though the file was deleted. you have to shutdown the process to get the space back. A reboot would shutdown and restart the process, thus releasing the space.

Do you have lsof on the system. It would help you identify the process that has a file open (if any).

If you don't have lsof downlaod from this link,

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

If you have lsof, try this link from itrc which might help you in identifying the process that may have a deleted file open.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072657091

The itrc doc id is KBRC00008039.

Hope this helps.

Regds
A. Clay Stephenson
Acclaimed Contributor

Re: bdf and du -sk differ - can I correct it without a reboot

When you removed the file (presumably via the rm command) you actually unlink()'ed it. The unlink system call reduces the link count of a filename by one and if the link count is now 0, the directory entry is removed; however, the space occupied by the file is only returned to the filesystem's free list when all the processes which had the file open either close the file or terminate. You now need to kill a process or two to free the space. Lsof (list open files) can be used to find these processes.

Man 2 unlink for a good explanation of what you are seeing.
If it ain't broke, I can fix that.
Roland Rebstock_1
Frequent Advisor

Re: bdf and du -sk differ - can I correct it without a reboot

Thanks, found backups running on the filesystem in question, just finished and bdf now speaks the same as du, used fuser to identify.. Thanks