linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: cwillu <cwillu@cwillu.com>
To: david grant <dg@david-grant.com>
Cc: C Anthony Risinger <anthony@extof.me>,
	Hugo Mills <hugo-lkml@carfax.org.uk>,
	Wenyi Liu <qingshenlwy@gmail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: btrfs problems and fedora 14
Date: Fri, 26 Nov 2010 11:47:19 -0600	[thread overview]
Message-ID: <AANLkTim1tppydrcBdcGvNyXDGviz2_HOzOY2_OrSsqWM@mail.gmail.com> (raw)
In-Reply-To: <1290764456.4380.20.camel@main-wireless>

On Fri, Nov 26, 2010 at 3:40 AM, david grant <dg@david-grant.com> wrote=
:
> I am totally anal about having backups of a current operating systems
> and using those for testing I thought tat the best way to do this wit=
h
> btrfs was to rsync the file system to another partition but exclude a=
ll
> snapshots. This worked very well as long as I mounted only the root f=
ile
> system of the copy but what I did was add snapshots to the copy and a=
t
> some point (probably at the start) the btree system was corrupted but=
 I
> only saw this on backtracking and checking all messages. Also, I didn=
't
> want to boot from a snapshot of my working operating system for fear =
I
> could screw things up and have to re-install from scratch. =A0In orde=
r to
> try again, I deleted all snapshots from the original system, did an
> rsync and checked the copy. I then made a snapshot of the copy via yu=
m,
> used rootflags and it worked!!
>
> So, cwillu, after your scolding of me and your (perfectly reasonable)
> questioning of my understanding, I did get it together for booting.
>
> BUT I am still left with the problem that caused it for me: how do I
> backup (clone?) a btrfs file system with snapshots to another btrfs
> partition (apart from using dd).

I use rsync myself, and explicitly list the subvolumes and mirrors I
want copied, which sounds pretty much like what you were doing.  The
corruption you saw definitely wasn't supposed to happen, but depending
on which kernel's you've used and (to a lessor extent) whether a few
particular kernel options are set, isn't too surprising.  Things
_have_ been pretty stable for me for the last little while, basically
since 2.6.35+btrfs_git, and I use snapshots quite a bit.

What I use in a nutshell is:

mountpoint "${BACKUP_TO}/${TODAY}" || {
        btrfs subvolume snapshot "${BACKUP_TO}/${YESTERDAY}"
"${BACKUP_TO}/${TODAY}" || exit 1
}
btrfs subvolume snapshot / /backup-snap && {
        rsync -vaxR --inplace --delete --ignore-errors /backup-snap/./
${BACKUP_TO}/${TODAY}/
        btrfs subvolume delete /backup-snap
}

This will give you incremental backups while avoiding the worst of the
duplication.  I haven't verified that rsync actually does anything
useful COW-wise at the file level, but that's the idea behind the
--inplace option (without it, rsync writes to a copy, and replaces the
original, which COW can't help with).

This is a still a little ways from actually making new snapshots to
fully reproduce the existing filesystem, but I'm not certain that's
what you were after.

> I just hope I don't get scolded again and told I am not up to it.

In point of fact, I said that you _were_ up to it (you were), and that
you'd have it running in no time (you did) once you understood things
better (you do).  I win?  (I always win)  =3DD

[Also, please post your replies under the quoted original, not on top.
 Easier to follow the thread that way.]
--
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

      parent reply	other threads:[~2010-11-26 17:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 23:19 btrfs problems and fedora 14 david grant
2010-11-22 23:28 ` Hugo Mills
2010-11-23  4:47 ` Wenyi Liu
2010-11-23  6:45   ` C Anthony Risinger
2010-11-24  7:32     ` david grant
2010-11-24  9:19       ` cwillu
2010-11-26  9:40         ` david grant
2010-11-26 10:11           ` Oystein Viggen
2010-11-26 10:36             ` David Pottage
2010-11-26 17:47           ` cwillu [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=AANLkTim1tppydrcBdcGvNyXDGviz2_HOzOY2_OrSsqWM@mail.gmail.com \
    --to=cwillu@cwillu.com \
    --cc=anthony@extof.me \
    --cc=dg@david-grant.com \
    --cc=hugo-lkml@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=qingshenlwy@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).