[linux-lvm] changing protection of lvm2 snapshot origin

Karl Kiniger karl.kiniger at med.ge.com
Thu Mar 12 15:12:38 UTC 2009


I want to do the following:

* lvcreate -m test_lv -L 4G some_vg

* fill test_lv with a qemu disk image

* lvchange -p r some_vg/test_lv  --- I want to make sure that nobody
                                     will ever modify the (future) origin
* lvcreate -s -m test_lv_snap -L 1G some_vg/test_lv

* Use the some_vg/test_lv_snap  playing around with qemu, virtualbox, vmware.

Later I want to apply the snapshot contents to the origin -
preferably using the highly efficient dm-merge program (from this
mailing list) taking contents from the snapshot exception table.
Unfortunately lvchange does not  me to change the permissions if there
is an active snapshot. 
* lvchange -p rw some_vg/test_lv  --- I have to remove the snapshot
            first. For now  I have to copy the exception table contents
            elsewhere, remove test_lv_snap  and then I am able to apply
            the changes. It may be possible with an additional  dmsetup 
            mapping, I would like to avoid that.

So how to avoid the copy of the exception table contents ? 

PS: being able to save and re-apply an cow exception table is really
    convenient when playing around with bad software. I have hacked
    dm-merge to save a whole exception table to a disk file which can
    be also compressed for archiving purposes. A few hours work on
    e.g Windows XP (80 GB "disk") results in about  50..70 MB compressed
    exception table contents (of course depending on what you are doing).

    I am also planning to extend dm-merge to be able to save the 
    contents of a dm snapshot origin which is related to the snapshot
    exception table to a file in order to enable me to roll back the
    origin to a previous version. I have tried xdelta3 but found it to
    be highly inefficient in some cases.


D.I. Karl Kiniger     mailto:karl.kiniger at med.ge.com
Tel: (++43) 7682-3800-710  Voip(GE): 1662 710
Fax: (++43) 7682-3800-47 C: +43 6991 3800 710
GE Medical Systems Kretztechnik GmbH & Co OHG - Tiefenbach 15 – A-4871 Zipf
Landesgericht Wels FN 222387s – UID (VAT-ID): ATU54086108 - DVR: 2111103 – ARA: 12816
Persönlich haftende Gesellschafterin: GE Medical Systems Kretztechnik GmbH
Tiefenbach 15 – A-4871 Zipf  - Landesgericht Wels FN 218689b

More information about the linux-lvm mailing list