On Wed, Sep 4, 2019 at 2:20 PM Hugo Mills <h...@carfax.org.uk> wrote:
>
> On Wed, Sep 04, 2019 at 04:04:44PM +0200, Piotr Szymaniak wrote:
> > On Wed, Sep 04, 2019 at 12:03:10PM +0300, Andrei Borzenkov wrote:
> > > On Wed, Sep 4, 2019 at 9:16 AM Swâmi Petaramesh <sw...@petaramesh.org> 
> > > wrote:
> > > >
> > > > Hi list,
> > > >
> > > > Is there an advised way to completely “clone” a complete BTRFS
> > > > filesystem, I mean to get an exact copy of a BTRFS filesystem including
> > > > subvolumes (even readonly snapshots) and complete file attributes
> > > > including extended attributes, ACLs and so, to another storage pool,
> > > > possibly defined with a different RAID geometry or compression ?
> > > >
> > >
> > > As long as you do not use top level subvolume directly (all data is
> > > located in subolumes), send/receive should work.
> > >
> > > > The question boils down to getting an exact backup replica of a given
> > > > BTRFS filesystem that could be restored to something logically
> > > > absolutely identical.
> > > >
> > > > The usual backup tools have no clue about share extents, snapshots and
> > > > the like, and using btrfs send/receive for individual subvols is a real
> > > > pain in a BTRFS filesystem that may contain hundreds of snapshots of
> > > > different BTRFS subvols plus deduplication etc.
> > > >
> > >
> > > Shared extents could be challenging. You can provide this information
> > > to "btrfs send", but for one, there is no direct visibility into which
> > > subvolumes share extents with given subvolume, so no way to build
> > > corresponding list for "btrfs send". I do not even know if this
> > > information can be obtained without exhaustive search over all
> > > extents. Second, btrfs send/receive only allows sharing of full
> > > extents which means there is no guarantee of identical structure on
> > > receiving side.
> >
> > So right now the only answer is: use good old dd?
>
>    If you want an exact copy, including all of the exact UUIDs, yes.
>
>    Be aware of the problems of making block-level copies of btrfs
> filesystems, though:
> https://btrfs.wiki.kernel.org/index.php/Gotchas#Block-level_copies_of_devices


This might be fixed now. Anyone want to test it? With a recent kernel of course.

*runs away fast in case it isn't*


-- 
Chris Murphy

Reply via email to