Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
Tomas Dalebjörk writes: > 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 Ok, so you have thrown out the snapshot relationship when you made your backup, and backed up both the origin and the snapshot as two separate backups? Thus your backup requires much more space than the original system did since all of the common data has now been duplicated in both backups. Now it seems you want to restore both backups, but NOT pay the storage penalty for duplicating the common parts. I don't think there is really a good way of doing that. I'd say that you can restore the origin volume, then create a snapshot of that, then run some sort of binary diff between the origin and the backup of the snapshot and write that diff to the new snapshot. ___ 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/
Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
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 ___ 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/
Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
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? Regards Tomas Sent from my iPhone > On 21 Dec 2021, at 14:46, Zdenek Kabelac wrote: > > 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/
Re: [linux-lvm] how to convert a disk containing a snapshot to a snapshot lv?
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/