linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Pala <gotar@polanet.pl>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: exclusive subvolume space missing
Date: Sat, 2 Dec 2017 02:23:24 +0100	[thread overview]
Message-ID: <20171202012324.GB20205@polanet.pl> (raw)
In-Reply-To: <55036341-2e8e-41dc-535f-f68d8e74d43f@gmx.com>

On Sat, Dec 02, 2017 at 08:27:56 +0800, Qu Wenruo wrote:

> I assume there is program eating up the space.
> Not btrfs itself.

Very doubtful. I've encountered ext3 "eating" problem once, that couldn't be
find by lsof on 3.4.75 kernel, but the space was returning after killing
Xorg. The system I'm having problem now is very recent, the space
doesn't return after reboot/emergency and doesn't sum up with files.

>> Now, the weird part for me is exclusive data count:
>> 
>> # btrfs sub sh ./snapshot-171125
>> [...]
>>         Subvolume ID:           388
>> # btrfs fi du -s ./snapshot-171125 
>>      Total   Exclusive  Set shared  Filename
>>   21.50GiB    63.35MiB    20.77GiB  snapshot-171125
> 
> That's the difference between how sub show and quota works.
> 
> For quota, it's per-root owner check.

Just to be clear: I've enabled quota _only_ to see subvolume usage on
spot. And exclusive data - the more detailed approach I've described in
e-mail I've send a minute ago.

> Means even a file extent is shared between different inodes, if all
> inodes are inside the same subvolume, it's counted as exclusive.
> And if any of the file extent belongs to other subvolume, then it's
> counted as shared.

Good to know, but this is almost UID0-only system. There are system
users (vendor provided) and 2 ssh accounts for su, but nobody uses this
machine for daily work. The quota values were the last tool I could find
to debug.

> For fi du, it's per-inode owner check. (The exact behavior is a little
> more complex, I'll skip such corner case to make it a little easier to
> understand).
> 
> That's to say, if one file extent is shared by different inodes, then
> it's counted as shared, no matter if these inodes belong to different or
> the same subvolume.
> 
> That's to say, "fi du" has a looser condition for "shared" calculation,
> and that should explain why you have 20+G shared.

There shouldn't be many multi-inode extents inside single subvolume, as this is mostly fresh
system, with no containers, no deduplication, snapshots are taken from
the same running system before or after some more important change is
done. By 'change' I mean altering text config files mostly (plus
etckeeper's git metadata), so the volume of difference is extremelly
low. Actually most of the difs between subvolumes come from updating
distro packages. There were not much reflink copies made on this
partition, only one kernel source compiled (.ccache files removed
today). So this partition is as clean, as it could be after almost
5 months in use.

Actually I should rephrase the problem:

"snapshot has taken 8 GB of space despite nothing has altered source subvolume"

-- 
Tomasz Pala <gotar@pld-linux.org>

  reply	other threads:[~2017-12-02  1:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 16:15 exclusive subvolume space missing Tomasz Pala
2017-12-01 21:27 ` Duncan
2017-12-01 21:36 ` Hugo Mills
2017-12-02  0:53   ` Tomasz Pala
2017-12-02  1:05     ` Qu Wenruo
2017-12-02  1:43       ` Tomasz Pala
2017-12-02  2:17         ` Qu Wenruo
2017-12-02  2:56     ` Duncan
2017-12-02 16:28     ` Tomasz Pala
2017-12-02 17:18       ` Tomasz Pala
2017-12-03  1:45         ` Duncan
2017-12-03 10:47           ` Adam Borowski
2017-12-04  5:11             ` Chris Murphy
2017-12-10 10:49           ` Tomasz Pala
2017-12-04  4:58     ` Chris Murphy
2017-12-02  0:27 ` Qu Wenruo
2017-12-02  1:23   ` Tomasz Pala [this message]
2017-12-02  1:47     ` Qu Wenruo
2017-12-02  2:21       ` Tomasz Pala
2017-12-02  2:35         ` Qu Wenruo
2017-12-02  9:33           ` Tomasz Pala
2017-12-04  0:34             ` Qu Wenruo
2017-12-10 11:27               ` Tomasz Pala
2017-12-10 15:49                 ` Tomasz Pala
2017-12-10 23:44                 ` Qu Wenruo
2017-12-11  0:24                   ` Qu Wenruo
2017-12-11 11:40                   ` Tomasz Pala
2017-12-12  0:50                     ` Qu Wenruo
2017-12-15  8:22                       ` Tomasz Pala
2017-12-16  3:21                         ` Duncan
2017-12-05 18:47   ` How exclusive in parent qgroup is computed? (was: Re: exclusive subvolume space missing) Andrei Borzenkov
2017-12-05 23:57     ` How exclusive in parent qgroup is computed? Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202012324.GB20205@polanet.pl \
    --to=gotar@polanet.pl \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).