Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Axel Burri <axel@tty0.ch>
To: Remi Gauvin <remi@georgianit.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Used disk size of a received subvolume?
Date: Fri, 17 May 2019 16:14:21 +0200
Message-ID: <aed995de-79d4-9932-397d-bd0d12a51b7a@tty0.ch> (raw)
In-Reply-To: <cef97a5e-b19e-fdae-2142-f8757d06c4d4@georgianit.com>

[-- Attachment #1.1: Type: text/plain, Size: 1630 bytes --]

On 16/05/2019 19.09, Remi Gauvin wrote:
> On 2019-05-16 10:54 a.m., Axel Burri wrote:
> 
>>
>> Any thoughts? I'm willing to implement such a feature in btrfs-progs if
>> this sounds reasonable to you.
>>
> 
> 
> BTRFS qgroups are where this is implemented.  You have to enable quotas,
> and leaving quotas enabled has lots of problems, (mostly performance
> related), so I would not suggest leaving them on when there is lots of
> activity, (ie, multiple send/receive, or deletion of many snapshots.)
> 
> But you can enable quotas as any time (btrfs quota enable /path)
> 
> Wait for the rescan to finish
> 
> btrfs quota rescan -s /path  (to view status of scan)
> 
> And then:
> 
> btrfs qgroup show /path to list the space usage, (total, and what you're
> looking for: Exclusive)
> 
> Note that the default groups correspond to subvolume ID, not filename,
> (someone did make a utility somewhere that will display this output with
> corresponding directory names.)
> 
> btrfs sub list /path is used to find the relevant ID's.. (I find the -o
> option useful, so it only displays the subvolumes that are children to
> the /path)
> 
> As stated above, I would suggest disabling quotas when you are finished:
> 
> btrfs quota disable /path


Thanks for the tip, but this does not seem practicable for productive
systems, as it involves enabling quotas, which had many problems in the
past (not sure about the current state, but probably still true if I get
you correctly).

Nevertheless I played around with it and it seems to work, I'll keep it
in mind for the future.


- Axel


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 14:54 Axel Burri
2019-05-16 17:09 ` Remi Gauvin
2019-05-17 14:14   ` Axel Burri [this message]
2019-05-17 16:22     ` Remi Gauvin
2019-05-16 17:12 ` Hugo Mills
2019-05-17 13:57   ` Axel Burri
2019-05-17 15:28     ` Graham Cobb
2019-05-17 16:39       ` Steven Davies
2019-05-17 23:15         ` Graham Cobb
2019-05-23 16:06       ` Axel Burri

Reply instructions:

You may reply publically 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=aed995de-79d4-9932-397d-bd0d12a51b7a@tty0.ch \
    --to=axel@tty0.ch \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=remi@georgianit.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

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox