archive mirror
 help / color / mirror / Atom feed
From: "Davis, Matthew" <>
To: Zdenek Kabelac <>,
	LVM general discussion and development <>
Subject: Re: [linux-lvm] how to copy a snapshot, or restore snapshot without deleting it
Date: Fri, 18 Jan 2019 00:53:25 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Zdenek,

I assumed that LVM thin snapshots would work like git branches. 
Since git also uses diffs on the backend, and git is popular with developers, the same kind of behaviour seems reasonable to me.


git checkout master
git branch branchA # equivalent to creating snapshotA
echo "modify" > file.txt # modify origin
git checkout branchA ; git branch branchB # copy snapshotA to snapshotB
git checkout master ; git merge branchA # restore snapshotA
git branch # snapshotB still exists
echo "modify2" > file.txt # modify origin
git checkout branchB # restoring snapshot to root

Oh well. It doesn't matter too much, since I've figured out how to get it to work. I just need to restore the oldest snapshot each time. Then LVM updates the origin accordingly.


-----Original Message-----
From: Zdenek Kabelac [] 
Sent: Thursday, 17 January 2019 8:22 PM
To: Davis, Matthew <>; LVM general discussion and development <>
Subject: Re: how to copy a snapshot, or restore snapshot without deleting it

Dne 17. 01. 19 v 2:12 Davis, Matthew napsal(a):
> Hi Zdenek,
> What do you mean "it's origin is already gone"?


Your field 'Origin' in your 'lvs -a' was empty - so the actual origin used for taking 'fresh' LV snapshot is simply no longer existing.

lvm2 is (ATM) not a database tool trying to resolve/guess what can or cannot be still considered as the origin -  so i.e. if you take multiple snapshots of a single origin and then you merge one snapshot back to origin -  'the original origin' used for all other snapshots is 'gone' -  as lvm2 is not resolving here the history and relation of data content whether the meaning of origin still applies.

What can make sense in your case is to extend probably  'lvconvert' logic and provide  operation  i.e. --replace - which would be working mostly like merge
- but with thins you would be able to specify  which thinLV should replace some other thinLV so basically specifying replace LV1 with LV2 - which you can do by lvremove + lvrename ATM - but I can see usefulness for supporting this for i.e. root LV which is typically in-use all the time.

I'm not seeing possible to extended the internal logic in lvm2 that would be deciding which NEW origin should be replacing removed/merged origin in all related snapshots - I'm pretty sure every user would expect a different one...


  reply	other threads:[~2019-01-18  0:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  4:46 [linux-lvm] how to copy a snapshot, or restore snapshot without deleting it Davis, Matthew
2019-01-03  9:32 ` Tomas Dalebjörk
2019-01-03 14:09 ` Marian Csontos
2019-01-10  6:23   ` Davis, Matthew
2019-01-10  9:45     ` Zdenek Kabelac
2019-01-14 22:44       ` Davis, Matthew
2019-01-15 10:49         ` Zdenek Kabelac
2019-01-15 23:03           ` Davis, Matthew
2019-01-16 13:55             ` Zdenek Kabelac
2019-01-17  1:12               ` Davis, Matthew
2019-01-17  9:21                 ` Zdenek Kabelac
2019-01-18  0:53                   ` Davis, Matthew [this message]
2019-01-18  9:34                     ` Zdenek Kabelac
2019-01-21 10:32                     ` Zdenek Kabelac
2019-01-28 11:49                       ` Zdenek Kabelac
2019-01-30 23:58                         ` Davis, Matthew
2019-01-10 14:34     ` Tomas Dalebjörk
2019-01-11 19:29       ` Sarah Newman

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 \ \ \ \ \

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