Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

different free space result by "ls -a" and "df -k"

7 views
Skip to first unread message

wavelet

unread,
Nov 1, 2002, 12:53:43 AM11/1/02
to
Hi,
I get differenct result for used space by "df -k" and "ls -al".
eg: /app2

what's the reason?

[flx06]-> df -k
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 2390732 928840 1414078 40% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
/dev/md/dsk/d3 3555796 591638 2928601 17% /var
swap 2944552 40 2944512 1% /var/run
swap 2944704 192 2944512 1% /tmp
/dev/md/dsk/d7 15160757 15049 14994101 1% /app2
/dev/md/dsk/d6 4806072 469196 4288816 10% /flx
/dev/md/dsk/d4 2390732 2401 2340517 1% /secroot
/dev/md/dsk/d2 8726 1434 6420 19% /app1
[flx06]-> cd /app2
[flx06]-> ls -a


Jimmo

unread,
Nov 1, 2002, 3:51:46 AM11/1/02
to

"wavelet" <li...@lucent.com> :

> Hi,
> I get differenct result for used space by "df -k" and "ls -al".
> ...

>
> [flx06]-> df -k
> Filesystem kbytes used avail capacity Mounted on
> /...

> /dev/md/dsk/d7 15160757 15049 14994101 1% /app2
> ...

> [flx06]-> cd /app2
> [flx06]-> ls -a

ls and df are different commands that do different things.

Your ls command above may not have listed any files because there
are no files to list.

df -k is showing you total, used and free kilobytes of filesystem
space.

Nothing appears wrong with this based on the info you supplied.

-Jimmo


Scott Howard

unread,
Nov 1, 2002, 5:44:13 AM11/1/02
to
wavelet <li...@lucent.com> wrote:
> Hi,
> I get differenct result for used space by "df -k" and "ls -al".
> eg: /app2
>
> what's the reason?

At a guess I'd say you've got logging enabled on that filesystem.

man mount_ufs includes :

The log is allocated from free blocks on
the file system, and is sized approximately
1 Mbyte per 1 Gbyte of file system, up to a
maximum of 64 Mbytes.


> Filesystem kbytes used avail capacity Mounted on

> /dev/md/dsk/d7 15160757 15049 14994101 1% /app2

Your FS is about 15Gb. The used space is around 15Mb, or 1Mb/Gb.

Scott.

Chris Thompson

unread,
Nov 1, 2002, 12:46:18 PM11/1/02
to
In article <apt4v8$b...@netnews.proxy.lucent.com>,

wavelet <li...@lucent.com> wrote:
>Hi,
>I get differenct result for used space by "df -k" and "ls -al".
>eg: /app2
>
>what's the reason?
>
>[flx06]-> df -k
>Filesystem kbytes used avail capacity Mounted on
[...]

>/dev/md/dsk/d7 15160757 15049 14994101 1% /app2
[...]

>[flx06]-> cd /app2
>[flx06]-> ls -a
>

What, "ls -a" doesn't even show "." and ".." ? I don't think I believe
you. One would usually expect to see "lost+found" in a ufs filing system
as well.

In any case, the "df -k" output is not inconsistent with /app2 being
effectively empty. I would guess that you have ufs logging turned on
for it, and most of the usage you are seeing is the log area:

! The log is allocated from free blocks on the file system, and is
! sized approximately 1 Mbyte per 1 Gbyte of file system, up to a
! maximum of 64 Mbytes. [...]

[from the mount_ufs(1m) man page]

Chris Thompson
Email: cet1 [at] cam.ac.uk

0 new messages