linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Stephane Chazelas <stephane_chazelas@yahoo.fr>
To: linux-lvm@redhat.com
Subject: [linux-lvm] restoring snapshots
Date: Mon, 20 Sep 2010 12:16:22 +0100	[thread overview]
Message-ID: <chaz20100920111622.GA3547@yahoo.fr> (raw)

Hiya,

I was wondering about how to restore/apply a LVM snapshot to the
original partition. Looking at the archive, I can see it's
advised to dump the snapshot content into a file and then dump
that onto the original device after having removed the snapshot.

What's wrong with:

lvcreate -n lv -L1G vg
...
mount /dev/vg/lv /x
...
lvcreate -s -n lv_snap /dev/vg/lv
...
mount /dev/vg/lv_snap /y

Them to apply the snapshot:

umount /x /y
dd bs=4M < /dev/mapper/vg-lv_snap > /dev/mapper/vg-lv-real
lvremote /dev/vg/lv_snap

It's still not optimal as it writes the whole volume, but at
least, I don't have to find a storage area big enough to hold an
extra copy of the whole volume and it's faster.

It seems to be working on a test on /dev/loop. Is there any
circumstance (as long as there's only one snapshot of the
volume) where it wouldn't work, or what would be the potential
pitfalls (other than if there's a crash in the middle, you're
screwed)?

Is there any plan to add the feature to efficiently
restore/apply/commit a snapshot (that is only dump the cow data
onto the original volume without writing the whole volume) or
does that feature exist already and I missed it?

Thanks,
Stephane

             reply	other threads:[~2010-09-20 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 11:16 Stephane Chazelas [this message]
2010-09-20 13:15 ` [linux-lvm] restoring snapshots Kinzel, David
2010-09-20 13:42   ` Mike Snitzer

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=chaz20100920111622.GA3547@yahoo.fr \
    --to=stephane_chazelas@yahoo.fr \
    --cc=linux-lvm@redhat.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).