alex bodnaru wrote:
> ls -l and df miscalculate the total file size. see the sample output below.

I don't see anything wrong with that output.

> output of: ls -lh /smb-server/uml-net/
> total 1.6G
> -rw-r--r--  1 alex uml-net  23M Feb 26  2005 Debian-3.0r0.ext2.bz2
> -rw-r--r--  1 alex uml-net 162M Jul 13 04:50 Debian-3.0r2.ext2
> drwxr-xr-x  2 alex uml-net 4.0K Sep  1 18:43 modules
> -rwxr-xr-x  1 alex uml-net  177 Aug  6 22:52 myrootstrap
> -rw-r--r--  1 alex uml-net  565 Aug  7 03:50 rootstrap.conf
> -rw-r--r--  1 alex uml-net  567 Aug  7 04:13 rootstrap.conf.etch
> -rw-r--r--  1 alex uml-net  569 Aug  7 04:13 rootstrap.conf.sarge
> -rw-r--r--  1 alex uml-net  543 Aug  7 04:13 rootstrap.conf.sid
> -rw-r--r--  1 alex uml-net  569 Aug  7 04:14 rootstrap.conf.woody
> -rwxr-xr-x  1 alex uml-net  740 Sep 11 00:08 uml-run
> -rw-r--r--  1 alex uml-net 512M Sep 16 06:25 uml.etch.ext3
> -rw-r--r--  1 alex uml-net 512M Aug 28 05:30 uml.sarge.ext3
> -rw-r--r--  1 alex uml-net 512M Sep 10 23:55 uml.sid.ext3
> -rw-r--r--  1 alex uml-net 512M Sep  7 05:50 uml.woody.ext3

Okay.

> output of: df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/hda9              6886260   2172600   4363848  34% /
> tmpfs                   124164        16    124148   1% /dev/shm
> /dev/hda11             6989084   2859244   3774808  44% /common
> /dev/hda7              4917648   1656728   3011112  36% /smb-server

Okay.

That all looks okay to me.  What is the problem?  Please be specific.

In order for the above to be correlated you would need to have ls
report the file size in blocks with the -s option and to have du
report the amount of disk space used in that directory.

I think you might be confusing the these commands.  'ls -l' lists the
size of the file.  'df' lists the free disk space available by using
statfs() which deals with blocks of a fixed size.  'du' (not
mentioned) reports the amount of disk blocks used.  All three of
those are subly different.

Try this example:

  dd bs=1 count=1 of=foo if=/dev/zero seek=500M
  ls -slh foo
  512K -rw-r--r--  1 bob bob 501M 2005-11-08 00:30 foo
  du -sh foo
  512K    foo

Bob


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to