From: Roland Paterson-Jones <rolandpj@amazon.com>
To: dm-devel@redhat.com
Subject: Help/Info on basic snapshot for CoW
Date: Tue, 21 Nov 2006 17:56:09 +0200 [thread overview]
Message-ID: <45632199.9000308@amazon.com> (raw)
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
next reply other threads:[~2006-11-21 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 15:56 Roland Paterson-Jones [this message]
2006-11-22 11:47 ` Help/Info on basic snapshot for CoW Roland Paterson-Jones
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45632199.9000308@amazon.com \
--to=rolandpj@amazon.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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 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.