Gentoo Archives: gentoo-user

From: Paul Colquhoun <paulcol@×××××××××××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] df and du difference
Date: Sat, 16 Aug 2008 23:18:29
Message-Id: 200808170918.21596.paulcol@andor.dropbear.id.au
In Reply to: Re: [gentoo-user] df and du difference by Ward Poelmans
1 On Sat, 16 Aug 2008, Ward Poelmans wrote:
2 > On Sat, Aug 16, 2008 at 07:50, <platoali@×××××.com> wrote:
3 >
4 > > the difference between du and df is about 640 - 188 = 452 MB.
5 > > and "df" is showing that my root is full 2.4 times more than "du".
6 > >
7 > > which one is the correct one? I've another server that this
8 > > difference is about 7 GiG and on that server root is 80% full. The
9 > > type of partition is ext3.
10 >
11 > Next to the difference due journaling etc, there is one important
12 > difference between du en df:
13 > deleted files held open by a running process. du doesn't count these
14 > files, df does.
15 > You can find those files with lsof | grep "deleted". Try closing the
16 > process with deleted files and suddenly your du en df will give the
17 > same free diskspace.
18 > Ofcourse, a reboot does also the trick.
19 >
20 > Ward
21
22
23 Actually, there is one more way to hide a file from du
24
25 If there is a file in the /var directory *BEFORE* the /var partition is
26 mounted onto the directory, then du won't find it, but df will know
27 about the space it is using.
28
29 You will probably need to boot from a live CD of some sort to be able to
30 umount the partitions and check the underlying directory, but it might
31 be worth it there is still space unaccounted for after a reboot.
32
33
34 --
35 Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
36 Asking for technical help in newsgroups? Read this first:
37 http://catb.org/~esr/faqs/smart-questions.html#intro

Replies

Subject Author
Re: [gentoo-user] df and du difference Alan McKinnon <alan.mckinnon@×××××.com>
Re: [gentoo-user] df and du difference Norberto Bensa <nbensa@×××××.com>