linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: "LVM general discussion and development" <linux-lvm@redhat.com>,
	"Tomas Dalebjörk" <tomas.dalebjork@gmail.com>
Subject: Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
Date: Tue, 21 Dec 2021 14:46:37 +0100	[thread overview]
Message-ID: <0026c26e-a5e0-272d-e5d6-739466cbd6b2@gmail.com> (raw)
In-Reply-To: <CACrcyf+2uz_ngeVdq48WjSg6ZaarRpVXs8TZwzpQ4hnW7D7xGg@mail.gmail.com>

Dne 19. 12. 21 v 17:43 Tomas Dalebjörk napsal(a):
> Hi,
> 
> I am trying to understand how to convert a disk containing snapshot data.
> This is how I tested this:
> 1. locate the snapshot testlv.211218.232255
> root@debian10:/dev/mapper# lvs
>    LV                   VG          Attr       LSize   Pool Origin Data% 
>   Meta%  Move Log Cpy%Sync Convert
>    home                 debian10-vg -wi-ao----   1.00g
>    root                 debian10-vg -wi-ao----  <3.81g
>    swap_1               debian10-vg -wi-ao---- 976.00m
>    testlv               debian10-vg owi-aos--- 100.00m
> testlv.211218.232255 debian10-vg swi-a-s--- 104.00m      testlv 1.44
> root@debian10:/dev/mapper#
> 

Hi

It looks like there is some sort of misunderstanding HOW these snapshots with 
lvm2 do work.

The snapshot LV does NOT contain whole copy of the origin LV (the one you've 
take its snapshot)

So while 'lvs' is presenting you the size of snapshot - it's not a 'regular' 
volume behind the scene. Instead it's a set of differentiating blocks from 
your origin stored in a way the came in use.

So while your snapshot looks it has size 104Mib and origin 100MiB - it means
there is just allocated max possible size of snapshot to store all different 
chunk + some extra metadata.  But ATM only 1.44% of this space is actually 
used to hold all these block (AKA ~1.5MiB or real storage was used so far)

There is basically NO WAY to use this 'COW' storage area without its original 
volume.

If you want to use such 'snapshot' elsewhere you simply need to *dd* such LV - 
which is presented (via magic world of DM targets) to user-space to appear 
like your original LV in the moment of snapshot.

But the actual 'raw' content stored in disk is in 'internal' form - not really 
usable outside (although the format is not really a complicated one)

Note - these so called 'thick' snapshot or 'old' snapshot are now better 
handled via thin-provisioning - giving much better performance - especially if 
you plan to keep snapshot for long term or have it in bigger size.

Hopefully it now makes it way more clear.

Regards

Zdenek

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

  parent reply	other threads:[~2021-12-21 13:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 16:43 [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv? Tomas Dalebjörk
2021-12-20 14:51 ` Phillip Susi
2021-12-21 13:46 ` Zdenek Kabelac [this message]
2021-12-21 14:44   ` Tomas Dalebjörk
2021-12-21 15:30     ` Zdenek Kabelac
2021-12-21 16:12       ` Tomas Dalebjörk
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:
  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=0026c26e-a5e0-272d-e5d6-739466cbd6b2@gmail.com \
    --to=zdenek.kabelac@gmail.com \
    --cc=linux-lvm@redhat.com \
    --cc=tomas.dalebjork@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).