Steps to reproduce
- create a snapshot of a volume using lvm
lvcreate -L 200GB -s -n snapshotname /dev/hostname-vg/root
make changes to the filesystem
restore the filesystem to the state it was in when the snapshot was made
lvconvert --merge /dev/hsotname-vg/snapshottorestore
- reboot (since I'm restoring the root volume)
- show list of snapshots
lvs -a
Desired behaviour
The original snapshot still exists
Actual behaviour
The original snapshot was deleted when the system was restored to the snapshot
Question
Is there an alternative to lvconvert
, or a flag I can add to it, so that the original snapshot is not deleted?
Use case
- I take a snapshot of a working system
- I make changes
- The changes fail
- I restore to the working system
- I want to retry the changes in a slightly different way, leaving open the possibility of restoring to a working system again
Using the lvconvert
command above, I need to remember to manually recreate the same snapshot again after restoring. Since this is a large volume with many changes, I need to wait half an hour before making the snapshot. (You can't take a snapshot of a volume still merging)
The volume is restored immediately. So I have a clean system I could use immediately, but I don't want to proceed without a backup. So I need to twiddle my thumbs for half an hour, then make a backup, then make the changes.