From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078705511320.tru64-unix-managers.marc@archive.invalid> From: Charles Vachon Date: Fri, 03 Apr 1998 21:23:19 +0000 To: tru64-unix-managers Subject: ls -l and du -k report very different size for same file X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078705511320 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