Operating System - HP-UX
1758605 Members
2658 Online
108873 Solutions
New Discussion юеВ

bdf or du ? which is wrong?

 
SOLVED
Go to solution
Igor Sovin
Super Advisor

bdf or du ? which is wrong?

Hi!

In my HP-UX 11.23 bdf command gives me the following

# pwd
/usr/sap/NW1
# bdf .
Filesystem kbytes used avail %used Mounted on
/dev/vgNW1/lvusrsapNW1
1245184 1223161 20930 98% /usr/sap/NW1

but du gives other result:

# du -sk *
231329 DVEBMGS72
0 SYS
0 lost+found
#

Where is the rest 1Gb?
4 REPLIES 4
Alex Lavrov.
Honored Contributor
Solution

Re: bdf or du ? which is wrong?

There were probably some files that their inodes were removed.

bdf command "looks" on the filesystem and don't care much about inodes and du command goes over inodes in the filesystem and sums the sizes. When process hold file descriptor to space on disk and you remove the inode with "rm" command, the space is not released untill the process that holds the space is dead. The fact that bdf "looks" on the fs itself and du goes over the inodes, explains the difference.

You should check wich programs use this filesystem (lsof and fuser will give you the info) and try to figure out wich program "holds" the space and stop it and then you'll see the same values.

Anyway, it's not adviced to remove large files with rm, because rm removes only the inode so the space if it's in use, will remain. Before using rm on the inode, consider "cat /dev/null > /some/file" and only then use rm.

I don't give a damn for a man that can only spell a word one way. (M. Twain)
Naveej.K.A
Honored Contributor

Re: bdf or du ? which is wrong?

Hi,

This is caused because of processes which are still using the "deleted" files.

fuser -u /usr/sap/NW1

should give you some info.

or else use lsof to see open files.

Best wishes,
--Naveej
practice makes a man perfect!!!
Igor Sovin
Super Advisor

Re: bdf or du ? which is wrong?

thank you guys!

but how to use lsof?
I get
# lsof /usr/sap/NW1
sh: lsof: not found.
Naveej.K.A
Honored Contributor

Re: bdf or du ? which is wrong?

Hi,

lsof might not be installed, get it from here.

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

Regards,
Naveej
practice makes a man perfect!!!