[HPADM] RE: Summary: du/bdf

From: Beerse, Corné (c.beerse@torex-hiscom.nl)
Date: Wed Aug 06 2003 - 03:46:35 EDT


> -----Original Message-----
> From: Sweetser, Joseph P. - PW Fleet
>
> Consensus is that open files are probably the issue. I'd buy this, except

> for the fact that lsof only shows 3 directories being "open" as cwd's.
> One thing I will test is to umount and remount the filesystem, but that
> has to be after hours since I can't readily restart the processes that
> show up in lsof.

I might have missed the origional question but I only like to add that hard
linked files can show a huge difference between df and du. How many
hard-linked files are on the disk? du reads the directory structure and
summarises all file sizes. This can be more than the total disk size if
there are hardlinked files. Then, since du reads the directory structure, if
the account that does the du cannot read a directory, it counts as 0 bytes.

Then there are pipes and pipelines, specially the unnamed ones, can occupy
file system space. (that is to say, generally on any unix system, I don't
know HP-UX details.) The unnamed pipes are sometimes buffered on a
filesystem (the one of the current working direcrory). They are not found by
du but the current buffer size is occupied and hence show in df.

>
> Bill "what the heck does *he* know about HP-UX?" Hassell stated:

Isn't the 'H' in HP-UX from Hassel ;-)

>
> The difference is due to sparse files. These are files that are only
> partially populated with data. bdf shows the directory structure
> info which includes data areas that could be occupied if the areas
> were filled in. du shows the actual space. If you copy the /home
> directory to another location, the sparse files will be filled in
> and then bdf and du will agree.

Someone swapped [b]df and du here: df (and bdf) only check the free-inode
list. That's why they are so fast. It's du that follows the directory
structure, that's what keeps it bussy.

For the sparce files, it depends on the used tools to copy if it shows the
growth in files. With cp, on the same filesystem, it should keep its
discontinuity/sparcity. With cp, on the same machine but over different
filesystems, it can keep its discontinuity/sparcity and it can loose it,
depending on the smartness of the implementation. Most, if not all tools
other than cp will try to read the file from start to end and hence create a
copy that occupies all bytes for its size.

Detail: my detailed experience on this (down to the source of the cp
command) is from a cource on minix I followed around 1990 but I don't think
details differs on HP-UX or have changed since then, my experience now and
then is the same.

CBee

> -----------
> If the umount/mount shows the same results as I am seeing, I
> will try this,
> too.
>
> Many thanks to: Mike.Keighley@lexicon.co.uk,
> Ling C. Ho [lho@comneti.com],
> Johnson, Craig E [Craig.E.Johnson@icn.siemens.com],
> Rita Workman [RWORKMAN@wvbep.org],
> Paul LaMadeleine [plamadeleine@lightbridge.com],
> Steve Bonds [ugvgml902@sneakemail.com],
> rossi.ettore [rossi.ettore@email.it],
> Bill Hassell [blhconsulting@mindspring.com],
> Eef Hartman [hartman@mf.twi.tudelft.nl]
> ------------
> Original Post:
> I have a small /home filesystem that I need to monitor fairly closely.
> I understand the long term solution is to grow/recreate it.
> That said,
> here's my issue. The bdf command shows the following:
>
> sweets:ORCL:/home > bdf .
> Filesystem kbytes used avail %used Mounted on
> /dev/vg00/lvol5 20480 12544 7936 61% /home
>
> And du shows the following:
>
> sweets:ORCL:/home > sudo du -sk .
> Password:
> 9920 .
>
> OR
>
> sweets:ORCL:/home > sudo du -sk *
> 184 STA
> 32 backup
> 608 colemad
> 520 lewisyh
> 0 lost+found
> 328 mohlejc
> 32 operator
> 6008 oracle
> 56 orayhl
> 1968 sweets
> 176 young
>
> Sooo, bdf is telling me that ~12mb are used while du is
> telling me ~10mb.
> Any idea where to look for the missing 2mb. Is this just a "rounding"
> error?
>
>
> --
> ---> Please post QUESTIONS and SUMMARIES only!! <---
> To subscribe/unsubscribe to this list, contact
> majordomo@dutchworks.nl
> Name: hpux-admin@dutchworks.nl Owner:
> owner-hpux-admin@dutchworks.nl
>
> Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin
> (FTP, browse only)
> http://www.dutchworks.nl/htbin/hpsysadmin (Web,
> browse & search)
>

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:32 EDT