archive mirror
 help / color / mirror / Atom feed
From: "Tomas Dalebjörk" <>
To: Zdenek Kabelac <>
Cc: LVM general discussion and development <>
Subject: Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
Date: Tue, 21 Dec 2021 17:12:59 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1.1: Type: text/plain, Size: 4422 bytes --]

Thanks for explaining all that details about how a snapshot is formatted on
the COW device.
I already know that part.

I am more interested in how the disk containing the COW data can be merged
back to an LV volume.
The second part only mentioned that it is possible, but not which steps are

As documented in the manual.
To split a snapshot from its origin (our words detach) one can use:
lvconvert --splitsnapshot vg/s1

To reverse that process, according to the manual; one can use:
lvconvert -s vg/s1

But as I mentioned before, this requires that the vg/s1 exists as an object
in the LVM metadata.
What if you are on a new server, that does not have vg/s1?
How to create that object or whatever you like to call this on the server?
The only way I got it is to use the
lvconvert --splitsnapshot

And now reattach it, so that the actual merge can happen.
The object should exist now, so that the command: lvconvert -s vg/s1 can

Or how can the object vg/s1 be created so that it can be referenced to by
the lvconvert command?
The disk is formated as a COW device, and contains all of the data.
So how hard can it be to just reattach that volume to an empty or existing
LV volume on the server?

If it works on same server, why can't it work on any other new servers, as
the COW device contains ALL the data needed (we make sure it contains all
the data)

If you want to give it a try, just create a snapshot on a specific device
And change all the blocks on the origin, there you are, you now have a cow
device containing all data needed.
How to move this snapshot device to another server, reattach it to an empty
lv volume as a snapshot.
lvconvert -s, command requires an argument of an existing snapshot volume
But there is no snapshot on the new server, so it can't re-attach the
So what procedures should be invoked to create just the detached references
in LVM, so that the lvconver -s command can work?

Regards Tomas

Den tis 21 dec. 2021 kl 16:30 skrev Zdenek Kabelac <

> Dne 21. 12. 21 v 15:44 Tomas Dalebjörk napsal(a):
> > hi
> >
> > I think I didn’t explain this clear enough
> > Allthe lvm data is present in the snapshot that I provision from our
> backup system
> > I can guarantee that!
> >
> > If I just mount that snapshot from our backup system, it works perfectly
> well
> >
> > so we don’t need the origin volumes in other way than copying back to it
> > we just need to reanimate it as a cow volume
> > mentioning that all data has been changed
> > the cow is just referencing to the origin location, so no problem there
> > All our data is in the cow volume, not just the changes
> >
> > just to compare
> > if you change just 1 byte on every chunksize in the origin volume, than
> the snapshot will contain all data, plus some meta data etc.
> > That is what I talk about here.
> > So how do I retach this volume to a new server?
> >
> > as the only argument acceptable argument by the lvconvert is vg/s1 ?
> >
> > That assumes that vg/s1 is present
> > so how to make it present?
> Hi
> As said in my previous post - the 'format' of data stored on COW storage
> (which is the 'real' meaning of snapshot LV) does NOT in any way resembles
> the
> 'normal' LV.
> So the COW LV could be really ONLY use together with 'snapshot' target.
> The easiest way how to 'copy' this snapshot to normal LV is like this:
> lvcreate -L size  -n newLV  vg
> dd if=/dev/vg/snapshotLV  of=/dev/vg/newLV  bs=512K
> (so with 'DD' you copy data in 'correct' format)
> You cannot convert snapshot LV to 'normal' LV in any other way then to
> merge
> this snapshot LV into your origin LV  (so origin is gone)
> (lvconvert --merge....)
> You can also  'split' snapshot COW LV and 'reattach' such snapshot to
> other LV
> - but this requires rather good knowledge about whole functioning of this
> snapshotting - so you know what can you do and what can you expect. But
> I'd
> likely recommend  'dd'.
> You cannot use 'splitted' COW LV for i.e. filesystem - as it contains
> 'mixed'
> snapshot metadata and snapshot blocks.
> Old snapshot meaning was - to take 'time consistent' snapshot of LV which
> then
> you can use for i.e. taking backup....
> Regards
> Zdenek

[-- Attachment #1.2: Type: text/html, Size: 5399 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

linux-lvm mailing list
read the LVM HOW-TO at

  reply	other threads:[~2021-12-27 22:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 16:43 Tomas Dalebjörk
2021-12-20 14:51 ` Phillip Susi
2021-12-21 13:46 ` Zdenek Kabelac
2021-12-21 14:44   ` Tomas Dalebjörk
2021-12-21 15:30     ` Zdenek Kabelac
2021-12-21 16:12       ` Tomas Dalebjörk [this message]
2021-12-22 10:40         ` Zdenek Kabelac
2021-12-28  5:04         ` Stuart D Gathman
2021-12-28  6:40           ` Tomas Dalebjörk
2021-12-29 13:35             ` Stuart D Gathman
2021-12-21 19:23     ` Phillip Susi

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).