tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Charles Vachon <cvachon () mrn ! gouv ! qc ! ca>
To: tru64-unix-managers
Subject: ls -l and du -k report very different size for same file
Date: Fri, 03 Apr 1998 21:23:19 +0000	[thread overview]
Message-ID: <96078705511320.tru64-unix-managers.marc@archive.invalid> (raw)

Hello DU managers,

Doing a little bit of housekeeping on a DU 4.0b server I newly
administrate, I encoutered a few files right off the root directory (an
ADVFS filesystem). These files consist of only binary zeroes (nulls), and
I'm told they are of no use anymore. I was about to delete these when I
found something strange:

ls -l 4* reports files of multi-megabyte size :

-rw-------   1 root     daemon   10469376 Dec 23  1996 41988
-rw-------   1 root     daemon    8806400 Dec 23  1996 44330

but du reports very different sizes for these same files:

du -k 4* gives:

8       41988
8       44330

du reports a consumption of only 8 1024-bytes blocks for the same files!

I did an experiment with one of these files. I did a "cat 44330 one >
44444", where one is a file containing a single byte. This created a 44444
file with characteristics one would expect:

ls -l 44444 gives:
-rw-r--r--   1 root     system    8806401 Apr  3 14:33 44444

and du -k 44444 says:
8608    44444

both commands report a consistent file size, since 8608 1024-byte blocks is
roughly the same size as 8806401 bytes.

I figured that maybe there is a special way to treat files in DU/ADVFS
which are containing all nulls. So I did another experiment:
"dd if=3D/dev/zero of=3D/tmp/test.file bs=3D1024 count=3D50". This creates a=
n
all-nulls files of 51200 bytes:

-rw-r--r--   1 root     system     51200 Apr  3 15:04 test.file

du -k reports a block count consistent with this file size, even though it
contains only nulls:

50      effa.cv1

I'm at a lost trying to explain what I see. Does anyone have an idea of
what could explain this discrepancy?

Thanks in advance!
--
Charles Vachon -- Administrateur de syst=E8me
Fonds de la r=E9forme cadastrale du Qu=E9bec
Minist=E8re des Ressources Naturelles du Qu=E9bec
cvachon@mrn.gouv.qc.ca

                 reply	other threads:[~1998-04-03 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox