* Strange file sizes
@ 1996-11-27 5:00 gomezel
1996-11-27 5:00 ` Roland Kruse
1996-11-27 5:00 ` Phil Farrell
0 siblings, 2 replies; 3+ messages in thread
From: gomezel @ 1996-11-27 5:00 UTC (permalink / raw)
Hi everybody,
here is what happens:
# ls -l
total 72836
-rw-r--r-- 1 root system 2 Apr 3 1996 bounds
-rw-r--r-- 1 root system 0 Mar 25 1996 crash-data.0
-rw-r--r-- 1 root system 602 Mar 25 1996 crash-data.1
-rw-r--r-- 1 root system 29978 Apr 1 1996 crash-data.2
-rw-r--r-- 1 root system 28504 Apr 3 1996 crash-data.3
-rw-r----- 1 root system 134209536 Apr 1 1996 vmcore.2
-rw-r----- 1 root system 134209536 Apr 3 1996 vmcore.3
-rw-r----- 1 root system 133398528 Apr 30 1996 vmcore.4
-rw-r----- 1 root system 9027168 Apr 1 1996 vmunix.2
-rw-r----- 1 root system 9027168 Apr 3 1996 vmunix.3
# du .
145688 .
# du -k .
72844 .
What about this? The sum of files sizes is LARGER than the du result.
Any hint?
Roberto
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange file sizes
1996-11-27 5:00 Strange file sizes gomezel
@ 1996-11-27 5:00 ` Roland Kruse
1996-11-27 5:00 ` Phil Farrell
1 sibling, 0 replies; 3+ messages in thread
From: Roland Kruse @ 1996-11-27 5:00 UTC (permalink / raw)
gomezel@vsts03.ts.infn.it wrote:
>
> Hi everybody,
> here is what happens:
>
> # ls -l
> total 72836
> -rw-r--r-- 1 root system 2 Apr 3 1996 bounds
> -rw-r--r-- 1 root system 0 Mar 25 1996 crash-data.0
> -rw-r--r-- 1 root system 602 Mar 25 1996 crash-data.1
> -rw-r--r-- 1 root system 29978 Apr 1 1996 crash-data.2
> -rw-r--r-- 1 root system 28504 Apr 3 1996 crash-data.3
> -rw-r----- 1 root system 134209536 Apr 1 1996 vmcore.2
> -rw-r----- 1 root system 134209536 Apr 3 1996 vmcore.3
> -rw-r----- 1 root system 133398528 Apr 30 1996 vmcore.4
> -rw-r----- 1 root system 9027168 Apr 1 1996 vmunix.2
> -rw-r----- 1 root system 9027168 Apr 3 1996 vmunix.3
> # du .
> 145688 .
> # du -k .
> 72844 .
>
> What about this? The sum of files sizes is LARGER than the du result.
> Any hint?
The "vmcore" files probably have holes. Type `ls -s' to
see how many disk blocks these files actually have alloceated,
you'll probably find this number much smaller than indicated
by the file sizes.
Roland Kruse
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange file sizes
1996-11-27 5:00 Strange file sizes gomezel
1996-11-27 5:00 ` Roland Kruse
@ 1996-11-27 5:00 ` Phil Farrell
1 sibling, 0 replies; 3+ messages in thread
From: Phil Farrell @ 1996-11-27 5:00 UTC (permalink / raw)
To: gomezel
Crash dump files are "sparse" files. That is, they have many
blocks in them that are all zeroes, because not every page in
memory was in use. UNIX file systems (at least those derived
from BSD, in my experience) can store sparse files so that no
actual disk space is used for those blocks that are all zeroes.
Instead, some flag in the inode indicates that x number of zeroed
blocks belong at this point, and the kernel generates them as
needed when the file is read.
Be careful if you try to copy or move such a sparse file. The
ordinary "cp" command will not maintain the "sparseness" in the
copy; instead, it will actually write the zeroed blocks to disk,
thus causing the sparse file to balloon in size. The "dd" command
has an option to correctly copy sparse files while maintaining
their "sparseness".
--
Phil Farrell, Computer Systems Manager
Stanford University School of Earth Sciences
farrell@pangea.stanford.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-11-27 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-11-27 5:00 Strange file sizes gomezel
1996-11-27 5:00 ` Roland Kruse
1996-11-27 5:00 ` Phil Farrell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox