Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Sparse files and df
Date: Sun, 24 May 2009 07:13:35
Message-Id: gvas1l$mlp$1@ger.gmane.org
In Reply to: [gentoo-user] Sparse files and df by Mike Kazantsev
1 Mike Kazantsev wrote:
2 > Hi,
3 >
4 > Here's a bit of a puzzle for me...
5 >
6 > I've got an 40G LVM partition with empty reiserfs on it.
7 > Then I've started rtorrent using this fs as a storage and added two 50G
8 > torrents to it.
9 > Rtorrent had no problems with the fact that partition is smaller than
10 > either of them and created all the downloaded files as sparse, so that
11 > "du -s --apparent-size" showed 100G.
12 > df reported that fs is still empty.
13 >
14 > Few days passed and some data actually hit the file system.
15 > Knowing that it can't handle that much of data I've downloaded files
16 > selectively, pushing completed ones to another fs, leaving a symlink in
17 > their place.
18 >
19 > df now shows that only 5G is free but "du -s" says that files occupy
20 > 15G and apparent size is 65G.
21
22 I might be wrong, but here's my take on it:
23
24 The files you moved won't be deleted until they are closed. That means
25 quiting the torrent client. "du" shows space occupied by files that
26 actually have a filename. The files you deleted are still there if the
27 torrent client still has handles on them; they just lack an entry in the
28 directory and therefore "du" doesn't pick them up, but of course "df"
29 does since it's not looking at files individually but asks the
30 filesystem directly.
31
32 So I suppose simply quitting the torrent client will result in no more
33 handles pointing at those files and therefore they will finally be
34 deleted by the filesystem. If you don't quit the client, new data will
35 be stored in the "invisible" deleted files rather than in the ones
36 pointed to by the symlinks, resulting in "df" showing less and less free
37 space even though "du" won't agree (and losing the downloaded data too
38 since its stored in the deleted files.)

Replies

Subject Author
Re: [gentoo-user] Re: Sparse files and df Mike Kazantsev <mk.fraggod@×××××.com>