From: Goffredo Baroncelli <kreijack@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Saving and restoring btrfs snapshots
Date: Fri, 12 Mar 2010 19:30:01 +0100 [thread overview]
Message-ID: <201003121930.01701.kreijack@libero.it> (raw)
In-Reply-To: <18f8b4a81003112300h3be917adgd183bb78719019e2@mail.gmail.com>
On Friday 12 March 2010, Pat Patterson wrote:
> Are there any plans to implement something akin to ZFS send/recv, to
> be able to create a stream representation of a snapshot and restore it
> later/somewhere else? I've spent some time trawling the mailing list
> and wiki, but I don't see anything there.
I spent a bit of time on this argument, in order to find how implement an
efficient method to backup incrementally the data.
AFAICT "zfs send" and "zfs recv" do the same thing that tar does. They
transform a tree (or the difference between a tree and its snapshot) to a
stream, and vice-versa.
To transform a tree to a stream is not very interesting.
The interesting part is how compare a tree and its snapshot. In fact a
snapshot of a tree should a be pointer to the original tree, and when a file
is modified, a branch of the modified part (the extens of the file, the
directories of the path) is performed (yes I know that this a big
simplification of the process).
The key is that the file-system knows which part of a snapshot is still equal
to the source and which not.
If this kind of data is available to the user space, comparing a tree and it
snapshot should be very fast.
Reading the documentation of btrfs, it seems that associated the transaction
there is a "version number". With this "version number" of a directory, we
would be able to verify the equality of two trees comparing only the root of
the trees. This would increase the seed of two trees.
But I was never able to get this "version number". There is the ioctl command
FS_IOC_GETVERSION, which seems to return this number. But when a directory or
an its children is update, this number doesn't change.
I tried to hack the kernel code in order to test different "version" number: I
tried inode->i_generation, or btrfs_inode->generation or btrfs_inode->sequence
or btrfs_inode->{last|last_sub|logged}_trans...
But none of the above was useful for my purpose.
Even tough there is no a clear conclusion, I hope that this note may be useful
to start to discuss on this matter.
Regards
Goffredo
>
> Cheers,
>
> Pat
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
next prev parent reply other threads:[~2010-03-12 18:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-12 7:00 Saving and restoring btrfs snapshots Pat Patterson
2010-03-12 18:30 ` Goffredo Baroncelli [this message]
2010-03-15 13:53 ` Chris Mason
2010-03-16 18:17 ` Goffredo Baroncelli
2010-03-18 19:24 ` Chris Mason
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=201003121930.01701.kreijack@libero.it \
--to=kreijack@gmail.com \
--cc=kreijack@libero.it \
--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