linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Odd behavior of subvolume find-new
@ 2012-01-09 16:08 David Brown
  0 siblings, 0 replies; only message in thread
From: David Brown @ 2012-01-09 16:08 UTC (permalink / raw)
  To: linux-btrfs

I've been creating some time-based snapshots, e.g.

      # btrfs subvolume snapshot @root 2012-01-09-@root

After some changes, I wanted to see what had changed, so I tried:

      # btrfs subvolume find-new @root 2012-01-09-@root
      transid marker was 37

which doesn't print anything out.  Curiously, if I make a snapshot of
the snapshot, then I get output from the delta:

      # btrfs subvolume snapshot 2012-01-09-@root tmp
      # btrfs subvolume find-new @root tmp
      ..... lots of output .....

I haven't seen this behavior on other filesystems or subvolumes.

My intent was to filter through the small script below to compute the
size of the delta.

Thanks,
David

#! /usr/bin/perl

# Process the output of btrfs subvolume find-new and print out the
# size used by the new data.  Doesn't show delta in metadata, only the
# data itself.
use strict;

my $bytes = 0;
while (<>) {
	if (/ len (\d+) /) {
		$bytes += $1;
	}
}
printf "%d bytes\n", $bytes;
printf "%.1f MByte\n", $bytes / 1024.0 / 1024.0;
printf "%.1f GByte\n", $bytes / 1024.0 / 1024.0 / 1024.0;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-09 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09 16:08 Odd behavior of subvolume find-new David Brown

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).