linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Vangelis Koukis <vkoukis@grnet.gr>
To: Lars Ellenberg <lars.ellenberg@linbit.com>
Cc: linux-lvm@redhat.com
Subject: Re: [linux-lvm] Sparse LVs, --virtualsize equal to --size
Date: Wed, 6 Feb 2013 18:05:39 +0200	[thread overview]
Message-ID: <20130206160539.GQ27402@daedalus.cslab.ece.ntua.gr> (raw)
In-Reply-To: <20130131162243.GH8837@soda.linbit>

[-- Attachment #1: Type: text/plain, Size: 2975 bytes --]

On Thu, Jan 31, 2013 at 05:22:43pm +0100, Lars Ellenberg wrote:
> > What is old-style snapshots? Old-style compared to what, thin LVs?
> 
> Yes.
> 
> > By "activate", do you refer to the problem of very slow VG activation
> 
> Yes.
> 
> > If yes, then the question still remains:
> > 
> > Can you please comment on the exact on-disk format used when doing LVM
> > snapshots? What is the exact format of the blocks being written to the
> > COW volume?
> 
> I'm pasting parts of an older post to this list
> (from 2008, Restore LVM snapshot without creating a full dump to an "external" device?)
> 
> "old style snapsthots", aka
> dm-snap and dm-exception-store are implemented in a way that
> for a single snapshot, you get
>    (mapping only) snapshot-origin
>    (real storage) origin-real
>    (mapping only) snapshot
>    (real storage) COW (or exception store)
> 
> COW on disk format is pretty simple (as of now).
> its all fixed size chunks.
> it starts with a 4x32bit header,
> [SnAp][valid][version][chunk_size in sectors]
> so any valid snapshot looks
> "SnAp" 1 1 [power of two]
> 
> chunk_size it what you set with the lvcreate "-c" option.
> 
> the rest of the (just as well chunk_size'ed) header block is unused.
> 
> expressed in chunks, the COW storage looks like:
> [header chunk][exception area 0][data chunks][....][exception area 1][...]
> where each exception area is one "chunk" itself.
> each exception area holds a mapping table of
> "logic chunk number" to "in COW storage chunk number", both 64bit.
> "logic number" is called "old", "in COW" address is called "new".
> byte number
> 1                     [old][new]
> 2                     [old][new]
> 3                     ...
> (chunk_size*512/16)   [old][new]
> following are as many data chunks.
> 
> this whole thing is append only.
> 

Dear Lars,

Thank you very much for the detailed explanation!
This is exactly what I needed, thanks for your time to gather everything
into a single answer.

> On activation,
> it needs to scan all those [exception area ...] blocks,
> until it find the "terminating" zeroed one.
> It reads in and stores this mapping in core memory.
> 
> 

Yes, so there is no fixed index or bitmap on disk to determine whether a
block is in an exception list or not. LVM has to scan all blocks, and
build this structure in main memory, on activation time.

This makes old-style snapshots completely unsuitable for our use case.
I guess dm-zeroed is what we should go for, from the available options.

> Hope that helps,
> 

It was great help.

Thanks again,
Vangelis.

-- 
Vangelis Koukis
vkoukis@grnet.gr
OpenPGP public key ID:
pub  1024D/1D038E97 2003-07-13 Vangelis Koukis <vkoukis@cslab.ece.ntua.gr>
     Key fingerprint = C5CD E02E 2C78 7C10 8A00  53D8 FBFC 3799 1D03 8E97

Only those who will risk going too far
can possibly find out how far one can go.
        -- T.S. Eliot

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-02-06 16:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 15:53 [linux-lvm] Sparse LVs, --virtualsize equal to --size Vangelis Koukis
2013-01-24 18:08 ` Alasdair G Kergon
2013-01-24 18:35   ` Stuart D Gathman
2013-01-24 23:42     ` Alasdair G Kergon
2013-01-25  8:44       ` Vangelis Koukis
2013-01-25 12:29         ` Alasdair G Kergon
2013-01-25 16:19           ` Vangelis Koukis
2013-01-28 13:50         ` Marian Csontos
2013-01-29  8:24           ` Vangelis Koukis
2013-01-31 16:22             ` Lars Ellenberg
2013-02-06 16:05               ` Vangelis Koukis [this message]
2013-01-25  8:39     ` Vangelis Koukis

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=20130206160539.GQ27402@daedalus.cslab.ece.ntua.gr \
    --to=vkoukis@grnet.gr \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-lvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).