[linux-lvm] Snapshot of a Snapshot

Lars Ellenberg linux-lvm at linbit.com
Sun Mar 9 23:37:24 UTC 2008


On Mon, Mar 03, 2008 at 09:13:05AM -0000, Karl Wagner wrote:
> Not quite, although this would also be nice. Maybe I should explain my
> current setup better.
> 
> Firstly, I have a Xen DomU machine running several Dom0's. As each Dom0
> is very similar, I started off with a Base install, then created
> snapshots to modify to create each Dom0. This had the advantage of
> allowing me to set up a new Dom0 very easily, while taking less physical
> disk space (and also the side effect that it runs quicker, think that's
> something to do with the block device cache being used for the origin,
> but I'm no expert so it may not...)
> 
> What I would like to be able to do is:
> (a) be able to take a snapshot of one of these snapshots in order to
> make backups, or have a bookmark in time if I am doing something I am
> not sure of (in this instance a 'revert to snapshot' would be nice too)
> (b) if I need to restore a backup, it would be nice to just be able to
> dd the image I took as backup onto the snapshot device, without it
> copying on every write, only copying the sectors (or chunks, whatever
> the allocation unit for the snapshot COW device is) which are different.
> 
> These would also be useful for the SAN I am putting together.
> 
> Both of these I can do manually, the first by creating a snapshot using
> device-mapper, the second by comparing the sector between the current
> and the backup before writing. Snapshot of a snapshot done this way is
> very useful but a pain to set up, although I have written a script to do
> this for me.

just make sure you never ever write to the origin accidentally
while having a snapshot of a snapshot of it.
if it was for an area that needed COW,
it would deadlock kcopyd. hard.
because kcopyd would recurse into itself from the
completion callbacks it was told to call back. :(

> Restoration of a snapshot this way is painfully slow
> (although if functionality of this sort either is not going to be
> implemented or will take a long time I will recode it in C to
> (hopefully) speed things up, currently I am using a hack together of
> bash and perl scripts, just to get it done quickly).

see my other post in that other thread
 "Restore LVM snapshot without creating a full dump"
maybe that script is of some use for you, too?

-- 
: Lars Ellenberg                            Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH      Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna/Europe    http://www.linbit.com :




More information about the linux-lvm mailing list