Problems with "df" and "du" on "/var"

Problems with "df" and "du" on "/var"

Post by Michael Oppe » Sun, 14 Oct 2001 02:32:05



Hello,

I hope you have some help for a "UNIX-Newbie". Here is my problem:

When I start the command "df" on the directory "/var" (on a UNIX-Server with
SunOS 5.6) I get the information, that approximately 113 MB disk space are
occupied. When I use the command "du -k /var" the system says that are about
50 MB (58 MB as root) in use.
By doing the same process on other directories, I have no problems.

Can you help me? I hope so. Thanks.

Greetings
Michael

 
 
 

Problems with "df" and "du" on "/var"

Post by Neil W Ricker » Sun, 14 Oct 2001 02:54:27



>I hope you have some help for a "UNIX-Newbie". Here is my problem:
>When I start the command "df" on the directory "/var" (on a UNIX-Server with
>SunOS 5.6) I get the information, that approximately 113 MB disk space are
>occupied. When I use the command "du -k /var" the system says that are about
>50 MB (58 MB as root) in use.

This is not a problem unless you are short of disk space.  If you
are short of space, try rebooting.

"df" and "du" measure different things.  "du" measures the disk space
in files accessible via directory entries.  "df" measures disk space
used by all files, whether in directories or not.

You presumably have a process that has a large file open (maybe
transaction logging by some program).  You deleted the file.  But that
only deletes the directory entry.  As long as the program still has
the file open, the system cannot delete it.

If you happen to know which process is doing this, then killing the
process will free the space.  Otherwise it will be freed at the next
reboot.

 
 
 

Problems with "df" and "du" on "/var"

Post by Griff Mille » Sun, 14 Oct 2001 04:40:52




> >I hope you have some help for a "UNIX-Newbie". Here is my problem:

> >When I start the command "df" on the directory "/var" (on a UNIX-Server with
> >SunOS 5.6) I get the information, that approximately 113 MB disk space are
> >occupied. When I use the command "du -k /var" the system says that are about
> >50 MB (58 MB as root) in use.

Try "du -skr /var" .

--
Griff Miller II                   |                                           |
Manager of Information Technology | "I need to be the owner of all of         |
Positron Corporation              |  the files in /usr/kvm."                  |