From: Michael Schuerig <michael.lists@schuerig.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: Copying a disk containing a btrfs filesystem
Date: Thu, 10 Apr 2014 16:53:40 +0200 [thread overview]
Message-ID: <2372099.9RZW56XdBN@fuchsia> (raw)
In-Reply-To: <pan$90756$dc7a7f84$91c0b585$f9cdfc6f@cox.net>
On Thursday 10 April 2014 13:58:45 Duncan wrote:
> Michael Schuerig posted on Thu, 10 Apr 2014 15:21:01 +0200 as
excerpted:
> > SMART indicates that my notebook disk may soon be failing (an
> > unreadable/uncorrectable sector), therefore I intend to exchange it.
> > The disk contains a single btrfs filesystem with several nested(!)
> > subvolumes, each with several read-only snapshots in a .snapshots
> > subdirectory.
> >
> > As far as I can tell, btrfs currently does not offer a sensible way
> > to duplicate the entire contents of the old disk onto a new one. I
> > can use cp, rsync, or send/receive to copy the "main" subvolumes.
> > But unless I'm missing something obvious, the snapshots are
> > effectively lost. btrfs send optionally takes multiple clone
> > sources, but I've never seen an example of its usage.
> >
> > If that's what "experimental" means, I'm willing to accept it.
> > However, I'd like to emphasize that there's still something
> > missing. Of course, most of all I'd like to be proved wrong.
>
> It's not a btrfs tool, but several of the tools you mentioned aren't,
> and you didn't mention dd (or ddrescue, if your source device starts
> giving you issues while you're cloning). Using it you'd clone the
> entire raw device, including any not yet allocated areas, in a
> straight-across bit- perfect copy. Of course you'd need a target of
> either the same size or larger in ordered to do so...
>
> That should give you a bit-perfect copy including the filesystem
> UUIDs, etc, which will confuse btrfs if you try to mount anything
> btrfs with both devices attached, so don't. Do your clone, then
> umount and disconnect the old device before trying to mount the new
> one.
Thanks for pointing out dd and especially ddrescue, which I didn't know.
I regularly use dd to copy images onto USB thumb drives, but I'm a bit
wary regarding its use on hard disks. I've always been concerned that if
I get another disk, not necessarily of the same make, that has nominally
the same capacity, it still might be a few blocks smaller. Well, I just
found one that has the right size, apparently.
Thanks again,
Michael
--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/
next prev parent reply other threads:[~2014-04-10 14:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 13:21 Copying a disk containing a btrfs filesystem Michael Schuerig
2014-04-10 13:58 ` Duncan
2014-04-10 14:53 ` Michael Schuerig [this message]
2014-04-10 14:00 ` George Eleftheriou
2014-04-10 15:15 ` Duncan
2014-04-10 15:51 ` Michael Schuerig
2014-04-10 16:01 ` George Eleftheriou
2014-04-10 16:24 ` Michael Schuerig
2014-04-11 0:35 ` Duncan
2014-04-10 18:15 ` Martin Steigerwald
2014-04-10 17:17 ` Jan Kouba
2014-04-10 18:36 ` Michael Schuerig
2014-04-10 22:25 ` Jan Kouba
2014-04-11 10:39 ` Brendan Hide
2014-04-16 11:12 ` Michael Schuerig
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=2372099.9RZW56XdBN@fuchsia \
--to=michael.lists@schuerig.de \
--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;
as well as URLs for NNTP newsgroup(s).