All of lore.kernel.org
 help / color / mirror / Atom feed
* Help/Info on basic snapshot for CoW
@ 2006-11-21 15:56 Roland Paterson-Jones
  2006-11-22 11:47 ` Roland Paterson-Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Paterson-Jones @ 2006-11-21 15:56 UTC (permalink / raw)
  To: dm-devel

Hi all

I am trying to use dm snapshots to provide copy-on-write (CoW) support 
using a static (read-only) origin which is to be shared by several CoW 
overlays.

So, I prepare a (sparse) loop-back image and device with the origin in 
/dev/loop0, and create an overlay onto a 'real' logical volume, using:

echo "0 $((152704*1024*1024/512)) snapshot /dev/loop0 
/dev/mapper/VolGroup_store_3 p 128" | dmsetup create store3_pref

This seems to work OK, and indeed if I recreate the same dm device after 
reboot or power cycle, I seem to recover the overlay changes.

So, where is the overlay mapping stored? I believe that this is known as 
the 'exception store', and I can see some stuff about it in the source, 
but where does a persistent overlay map end up?

Also, how is the overlay (snapshot) device used? Is there a one-to-one 
mapping of (logical device) block offsets onto the overlay (snapshot) 
device? If so, where does the overlay map fit in?

Lastly, how do I flush the overlay mapping? Suppose I have had quite 
enough of the (modified) snapshot and I want to revert to the original 
origin in a snapshot using the same overlay (snapshot) device. I notice 
empirically that if I 'dmsetup remove' then 'dmsetup create ... n ...', 
then 'dmsetup remove ...' once more, and finally 'dmsetup create ... p 
...', then I have a clean snapshot of the origin again. I'm guessing 
there's a better way ;)

Is this a sensible way to implement CoW? I realise that my use case is 
an inversion of the original intention of snapshots, where the origin 
was intended to be modified and the snapshot remained static (for 
back-up purposes). In my CoW usage, the origin remains static and I 
mutate several snapshots of the origin.

Thanks for any pointers
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-22 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 15:56 Help/Info on basic snapshot for CoW Roland Paterson-Jones
2006-11-22 11:47 ` Roland Paterson-Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.