linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Lubos Kolouch <lubos.kolouch@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Copy/move btrfs volume
Date: Thu, 1 Jul 2010 21:29:33 -0400	[thread overview]
Message-ID: <20100702012933.GB15319@think> (raw)
In-Reply-To: <i0huf7$98a$1@dough.gmane.org>

On Thu, Jul 01, 2010 at 11:33:59AM +0000, Lubos Kolouch wrote:
> Daniel J Blueman, Thu, 01 Jul 2010 12:26:10 +0100:
> >> What is the correct way to do this?
> > 
> > The only way to do this preserving duplication is to use hardlinks
> > between duplicated files (which reference counts the inode), and use
> > 'rsync -H'.
> > 
> > Dan
> 
> But when the files are on different snaphots, does rsync see them as 
> hardlinked?
> 
> A scenario - I have raid5 of say, 1TB HDDs. It contains many snapshots.
> Then, few years later, new machine is bought and there are, say, 5TB 
> discs.
> 
> So I need to transfer the btrfs volume to the new machine. 
> 
> But how to do it so that it looks the *same*, ie. the same snapshots?
> I could of course write a custom script to create the subvolume, rsync 
> the files, create snapshot, rsync files, etc,
> 
> but it would be nice if the btrfs toolset supports this by default...

This is definitely something I'm looking to add.  The btrfs-progs git
tree has some code that allows userland to walk the btrees and detect
the duplicate files.  But this is just a building block needed for the
full backup program.

Instead of hard links, it is possible to use reflinks with cp, which
uses the cloning ioctl.

-chris

      parent reply	other threads:[~2010-07-02  1:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 10:28 Copy/move btrfs volume Lubos Kolouch
2010-07-01 11:26 ` Daniel J Blueman
2010-07-01 11:33   ` Lubos Kolouch
2010-07-01 22:21     ` Matt Brown
2010-07-02  6:15       ` Oystein Viggen
2010-07-03  7:33         ` Lubos Kolouch
2010-07-21 15:00           ` Hubert Kario
2010-07-02  1:29     ` Chris Mason [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=20100702012933.GB15319@think \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lubos.kolouch@gmail.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).