All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wido den Hollander <wido@widodh.nl>
To: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: RBD Backup
Date: Wed, 21 Nov 2012 21:47:49 +0800	[thread overview]
Message-ID: <50ACDB85.4020006@widodh.nl> (raw)
In-Reply-To: <50ACD936.8060907@profihost.ag>

Hi,

On 11/21/2012 09:37 PM, Stefan Priebe - Profihost AG wrote:
> Hello list,
>
> is there a recommanded way to backup rbd images / disks?
>
> Or is it just
> rbd snap create BACKUP
> rbd export BACKUP

You should use:

rbd export --snap BACKUP <img> <dest>

> rbd snap rm BACKUP
>
> Is the snap needed at all? Or is an export save? Is there a way to make
> sure the image is consistent?
>

While reading rbd.cc it doesn't seem like running export on a running VM 
is safe, so you should snapshot before.

The snapshot isn't consistent since it has no way of telling the VM to 
flush it's buffers.

To make it consistent you have to run "sync" (In the VM) just prior to 
creating the snapshot.

> Is it possible to use the BACKUP file as a loop device or something else
> so that i'm able to mount the partitions from the backup file?
>

You can do something like:

rbd export --snap BACKUP image1 /mnt/backup/image1.img
losetup /mnt/backup/image1.img
kpartx -a /dev/loop0

Now you will have the partitions from the RBD image available in 
/dev/mapper/loop0pX

Wido

> Thanks!
>
> Greets Stefan
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-11-21 13:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 13:37 RBD Backup Stefan Priebe - Profihost AG
2012-11-21 13:47 ` Wido den Hollander [this message]
2012-11-21 13:56   ` Stefan Priebe - Profihost AG
2012-11-21 14:29     ` Wido den Hollander
2012-11-22 10:57   ` Stefan Priebe - Profihost AG
2012-11-22 13:13     ` Wido den Hollander
2012-11-22 21:08       ` Josh Durgin
2012-11-22 21:23         ` Stefan Priebe - Profihost AG

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=50ACDB85.4020006@widodh.nl \
    --to=wido@widodh.nl \
    --cc=ceph-devel@vger.kernel.org \
    --cc=s.priebe@profihost.ag \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.