Operating System - HP-UX
1833611 Members
3352 Online
110062 Solutions
New Discussion

Re: du -x diff with bdf on FS /

 
Francisco Díaz
Occasional Advisor

du -x diff with bdf on FS /

Hi all...
I have a strange problem with the / FS on a HPUX 11.23.

When I execute the bdf command, the utilization its a 90%. The size of this FS is 512 MBytes.

When I execute the commando

du -x /

the space utilization its 225 MBytes.

The system lost 280 MBytes aprox. I think that the problem it's the corrupted blocks or damaged blocks of the physical disk.

My Question is: Anybody know a procedure for check the FS / and the Physical Disk ??

Thanks in advanced...


Francisco...
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: du -x diff with bdf on FS /

You are making the assumption that du and bdf report the same thing --- and they sometimes do -- more or less by accident. The problem is that you have unlink()'ed (that rm'ed) to you. What actually happens is that when a file is unlink()'ed, the link count is reduced by one. If the link count is now zero then the directory entry is removed but the actual space is not freed until 1) the file is closed or 2) all processes which have the file open terminate.

Man 2 unlink and then you will never need to ask this question again.
If it ain't broke, I can fix that.
Sandman!
Honored Contributor

Re: du -x diff with bdf on FS /

It could very well be a deleted file that is still held open by a process. If you have lsof then you can check easily with:

# lsof +aL1 /

otherwise get lsof from http://hpux.cs.utah.edu/hppd/cgi-bin/search?package=on&description=on&term=lsof

cheers!
Francisco Díaz
Occasional Advisor

Re: du -x diff with bdf on FS /

This problem appears by a crash of the server. Since this moment (January 2006) I reboot the server for 4 times and nothing change. The utilization of Filesystem / it's 90%.

I review all files of this filesystem and nothing strange appears.

I assume that the association between the open files with a single process it's lost when I reboot the system.

Thanks in advanced...

Francisco.
KapilRaj
Honored Contributor

Re: du -x diff with bdf on FS /

I don't know what du -x does and i don;t hv an hp box to try out. I would , "find / -xdev -depth -ls" and snd sum the file size. if this is still a problem , try fsck on the root filesystem. It is not the best idea though but it may give you some hints !

Regds,

Kaps
Nothing is impossible
Tor-Arne Nostdal
Trusted Contributor

Re: du -x diff with bdf on FS /

Related to your du command, you could try:
find / -type f -xdev -exec du -sk {} \; | awk ' x+=$1,$0 { } END {print x} '

Using xargs would be faster, but if you have a filename with space(s) it will give errors:
find / -type f -xdev -print |xargs du -sk | awk ' x+=$1,$0 { } END {print x} '
--------
During boot the filesystem should be checked with fsck before it is mounted.
--------
Could it be that you have mounted a filesystem on top of a directory which contain data ?

This could explain why the du command don't calculate these files, and report a lower size than bdf.

/Tor-Arne
I'm trying to become President of the state I'm in...
Antonio Cardoso_1
Trusted Contributor

Re: du -x diff with bdf on FS /

Francisco,

If you renbooted the server, the problem with files erased while process is running will not show erroneous information in bdf.

Another possible cause for your trouble is that a mount point is hiding some files...
For example, a file is created in some location - let's say /dir1/dir2/file - and then a filesystem is mounted in a directory of this path - let's say on /dir1.
At this moment, files held in original filesystem under /dir1 are no more visible:
- their used space appears in bdf
- their used space doesn't appear in du

Now how to identify if this is the cause?
- if you cannot move to single user mode, consider using
ff -F vxfs /dev/vg00/lvol3
(assuming that lvol3 is for /)
=> ff command will report all files from physical filesystem, and hidden files if any will appear there.

- if booting in singler user mode, you'll find files by listing contents of each mount point.

hope this helps.
antonio.