Gentoo Archives: gentoo-user

From: Norberto Bensa <nbensa@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] df and du difference
Date: Sun, 17 Aug 2008 14:37:03
Message-Id: 20080817113656.ermgytudgk8880gk@mail.bensa.ar
In Reply to: Re: [gentoo-user] df and du difference by Paul Colquhoun
1 Quoting Paul Colquhoun <paulcol@×××××××××××××××××.au>:
2
3 > On Sat, 16 Aug 2008, Ward Poelmans wrote:
4 >> On Sat, Aug 16, 2008 at 07:50, <platoali@×××××.com> wrote:
5 >>
6 >> > the difference between du and df is about 640 - 188 = 452 MB.
7 >> > and "df" is showing that my root is full 2.4 times more than "du".
8
9 Normal...
10
11 >> Next to the difference due journaling etc, there is one important
12 >> difference between du en df:
13
14 Hm. Yeah... Maybe. Journaling add -in my experience- about 32MB.
15
16 >> deleted files held open by a running process. du doesn't count these
17 >> files, df does.
18
19 Yeap.
20
21 > If there is a file in the /var directory *BEFORE* the /var partition is
22 > mounted onto the directory, then du won't find it, but df will know
23 > about the space it is using.
24
25 Yes
26
27 But you're all missing rounding errors. If you do:
28
29 du -hcs /path/to/some/dir
30
31 You'll end up with a different result if you instead do:
32
33 du -bcs /path/to/some/dir
34
35 Real example:
36
37 zoolook@melnitz ~ $ du -bcs Desktop/
38 1289720534 Desktop/
39 1289720534 total
40
41 zoolook@melnitz ~ $ du -hcs Desktop/
42 1.3G Desktop/
43 1.3G total
44
45 If you do the math, 1.3G is more or less 1395864372 bytes; ~110MB in
46 diference and same tool.
47
48 Regards,
49 Norberto
50
51 ----------------------------------------------------------------
52 This message was sent using IMP, the Internet Messaging Program.