Disk Space Requirements

Uli Fahrenberg uli at math.aau.dk
Tue Sep 28 00:08:38 PDT 2004

Randy McMurchy, Sep 27, 17:38 -0500:

> One more question though. It seems
> du -b
> and
> du -h
> result in grossly different numbers.

RTFM :-)  From info du:

      Print apparent sizes, rather than disk usage.  The apparent size
      of a file is the number of bytes reported by `wc -c' on regular
      files, or more generally, `ls -l --block-size=1' or `stat
      --format=%s'.  For example, a file containing the word `zoo' with
      no newline would, of course, have an apparent size of 3.  Such a
      small file may require anywhere from zero to 16 or more kilobytes
      of disk space, depending on the type and configuration of the file
      system on which the file resides.  However, a sparse file created
      with this command
           : | dd bs=1 seek=`echo '2^31'|bc` of=big
      has an apparent size of 2 gigabytes, yet on most modern systems,
      it actually uses almost no disk space.

      Equivalent to `--apparent-size --block-size=1'.

Very good explanation, that.


Uli Fahrenberg -- http://www.math.aau.dk/~uli
GETCO 2004 -- http://www.math.aau.dk/~uli/getco04

More information about the lfs-dev mailing list