From: Russell Coker <russell@coker.com.au>
To: BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: snapshot space use
Date: Fri, 10 Apr 2015 07:55:10 +0000 [thread overview]
Message-ID: <201504100755.10240.russell@coker.com.au> (raw)
In-Reply-To: <201504091039.33442.russell@coker.com.au>
On Thu, 9 Apr 2015 12:39:33 AM Russell Coker wrote:
> # zfs list -t snapshot
> NAME USED AVAIL REFER MOUNTPOINT
> hetz0/be0-mail@2015-03-10 2.88G - 387G -
> hetz0/be0-mail@2015-03-11 1.12G - 388G -
> hetz0/be0-mail@2015-03-12 1.11G - 388G -
> hetz0/be0-mail@2015-03-13 1.19G - 388G -
> hetz0/be0-mail@2015-03-14 1.02G - 388G -
> hetz0/be0-mail@2015-03-15 989M - 386G -
>
> Is there any way to do something similar to the above ZFS command? It's
> handy to know which snapshots are taking up the most space, especially
> when multiple subvols are being snapshotted.
Quota isn't really what I want. What I don't want is to go to all the effort
of creating quotas on snapshots (and the risk of using such features) just for
the ability to see disk usage IF I want it. What I want is to have it just
work as it does in ZFS. In the above example I can see that I can free 2.88G
of disk space by removing the oldest snapshot, this is useful.
btrfs sub find-new $SNAPSHOT $LASTGEN |
awk '{total = total + $7}END{print total}'
The above command gives a total of the lengths of extents that changed in a
snapshot. Of course the total length isn't going to be the total space used
(it doesn't count metadata used or space saved through compression), but it
does give an idea. Thanks Hugo for the tip in another thread.
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
prev parent reply other threads:[~2015-04-10 7:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 0:39 snapshot space use Russell Coker
2015-04-09 0:45 ` Qu Wenruo
2015-04-09 9:02 ` Piotr Szymaniak
2015-04-09 9:26 ` Qu Wenruo
2015-04-09 22:01 ` Justin Maggard
2015-04-09 22:24 ` Hugo Mills
2015-04-09 23:27 ` Justin Maggard
2015-04-09 23:39 ` Hugo Mills
2015-04-10 0:32 ` Dongsheng Yang
2015-04-10 0:40 ` Justin Maggard
2015-04-10 0:48 ` Qu Wenruo
2015-04-10 7:55 ` Russell Coker [this message]
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=201504100755.10240.russell@coker.com.au \
--to=russell@coker.com.au \
--cc=linux-btrfs@vger.kernel.org \
/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