linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jonathan Tripathy <jonnyt@abpni.co.uk>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Snapshots and disk re-use
Date: Thu, 24 Feb 2011 21:22:15 +0000	[thread overview]
Message-ID: <4D66CC07.7030709@abpni.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.1102241421550.22996@bmsred.bmsi.com>


On 24/02/11 19:45, Stuart D. Gathman wrote:
> On Thu, 24 Feb 2011, Jonathan Tripathy wrote:
>
>>> Yes.  When you make the snapshot, there is only one copy, and the COW table
>>> is empty.  AS YOU WRITE to the origin, each chunk written is saved to
>>> *-cow first before being written to *-real.
>> Got ya. So data that is being written to the origin, while the snapshot
>> exists, is the data that may leak, as it's saved to the COW first, then copied
>> over to real.
>>
>> Hopefully an expert will let me know weather its safe to zero the COW after
>> I've finished with the snapshot.
> What *is* safe is to zero the snapshot.  This will overwrite any blocks
> in the COW copied from the origin.  The problem is that if the snapshot runs
> out of room, it is invalidated, and you may or may not have overwritten
> all blocks copied from the origin.
>
> So if you don't hear from an expert, a safe prodecure is to allocate
> snapshots for backup that are as big as the origin + 1 PP (which should
> be enough for the COW table as well unless we are talking terabytes).  Then you
> can zero the snapshot (not the COW) after making a backup. That will overwrite
> any data copied from the origin.  The only leftover data will just be the COW
> table which is a bunch of block #s, so shouldn't be a security problem.
>
> This procedure is less efficient than zeroing LVs on allocation, and takes
> extra space for worst case snapshot allocation.  But if you want allocation
> to be "instant", and can pay for it when recycling, that should solve your
> problem.  You should still zero all free space (by allocating a huge LV
> with all remaining space and zeroing it) periodically in case anything
> got missed.
Hmm this sounds like it would work. However I would rather zero the LVs 
on allocation than do this, as we would run many backups, and it would 
be highly inefficient to zero out all the snapshots (unless I made the 
snapshot really small, but that would cause other problems, wouldn't it?)


> IDEA, since you are on raid1, reads are faster than writes (twice as fast),
> and your snapshots will be mostly unused (the COW will only have a few blocks
> copied from the origin).  So you can write a "clear" utility that scans
> a block device for non-zero chunks, and only writes over those with zeros.
> This might be a good application for mmap().
This would be a fantastic idea. Since LVM is very commonily used in 
shared tennant environments, if would be a fantastic feature if LVM 
could make sure that snapshots didn't cause data leakage

Hopefully an expert will help me out with my zeroing issues

  reply	other threads:[~2011-02-24 21:22 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 12:36 [linux-lvm] Snapshots and disk re-use Jonathan Tripathy
2011-02-23 13:09 ` Joe Thornber
2011-02-23 13:57   ` Jonathan Tripathy
2011-02-23 14:16     ` Joe Thornber
2011-02-23 14:18       ` Jonathan Tripathy
2011-02-23 16:12         ` Ray Morris
2011-02-23 16:55           ` Jonathan Tripathy
2011-02-23 17:54             ` Stuart D. Gathman
2011-02-23 18:05               ` Jonathan Tripathy
2011-02-23 19:34                 ` Stuart D. Gathman
2011-02-23 18:05               ` Stuart D. Gathman
2011-02-23 18:19                 ` Jonathan Tripathy
2011-02-23 18:39                   ` Les Mikesell
2011-02-23 19:39                     ` Stuart D. Gathman
2011-02-23 20:03                       ` Les Mikesell
2011-02-23 20:37                         ` Stuart D. Gathman
2011-02-23 20:49                           ` Jonathan Tripathy
2011-02-23 23:25                             ` Stuart D. Gathman
2011-02-23 23:42                               ` Stuart D. Gathman
2011-02-24  0:09                               ` Jonathan Tripathy
2011-02-24  0:32                                 ` Stuart D. Gathman
2011-02-24  0:37                                   ` Jonathan Tripathy
2011-02-24  0:40                                     ` Jonathan Tripathy
2011-02-24  2:00                                       ` Stuart D. Gathman
2011-02-24  7:33                                         ` Jonathan Tripathy
2011-02-24 14:50                                           ` Stuart D. Gathman
2011-02-24 14:57                                             ` Jonathan Tripathy
2011-02-24 15:13                                               ` Stuart D. Gathman
2011-02-24 15:20                                                 ` Jonathan Tripathy
2011-02-24 16:41                                                   ` Jonathan Tripathy
2011-02-24 19:15                                                     ` Nataraj
2011-02-24 19:25                                                       ` Les Mikesell
2011-02-24 19:55                                                       ` Stuart D. Gathman
2011-02-24 19:19                                                     ` Stuart D. Gathman
2011-02-24 19:45                                                   ` Stuart D. Gathman
2011-02-24 21:22                                                     ` Jonathan Tripathy [this message]
2011-04-05 20:09                                                   ` Jonathan Tripathy
2011-04-05 20:41                                                     ` Stuart D. Gathman
2011-04-05 20:48                                                       ` Jonathan Tripathy
2011-04-05 20:59                                                         ` James Hawtin
2011-04-05 21:36                                                           ` Jonathan Tripathy
2011-04-05 22:42                                                             ` James Hawtin
2011-04-05 22:52                                                               ` Jonathan Tripathy
2011-04-05 23:11                                                                 ` James Hawtin
2011-04-05 23:19                                                                   ` Jonathan Tripathy
2011-04-05 23:39                                                                     ` James Hawtin
2011-04-06  0:00                                                                       ` Jonathan Tripathy
2011-04-06  0:08                                                                         ` Stuart D. Gathman
2011-04-06  0:14                                                                           ` Jonathan Tripathy
2011-04-06  0:16                                                                         ` James Hawtin
2011-04-06  0:28                                                                           ` Jonathan Tripathy
2011-04-06  0:38                                                                             ` Stuart D. Gathman
2011-04-06  0:43                                                                               ` Stuart D. Gathman
2011-04-06  1:36                                                                                 ` James Hawtin
2011-04-06  1:47                                                                                   ` Jonathan Tripathy
2011-04-06  1:53                                                                                     ` James Hawtin
2011-04-06  0:47                                                                               ` Jonathan Tripathy
2011-04-06  0:42                                                                             ` James Hawtin
2011-04-06  0:50                                                                               ` Jonathan Tripathy
2011-04-06  1:20                                                                                 ` James Hawtin
2011-04-06  1:45                                                                                   ` Jonathan Tripathy
2011-02-23 19:49                     ` Nataraj
2011-02-23 19:24                   ` Stuart D. Gathman
2011-02-23 19:07                 ` [linux-lvm] Problem executing lvm related commands Tinni
2011-02-23 19:33               ` [linux-lvm] Snapshots and disk re-use Phillip Susi
2011-02-23 19:45                 ` Stuart D. Gathman
2011-02-23 19:56                   ` Nataraj
2011-02-23 13:18 ` Sunil_Gupta2

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=4D66CC07.7030709@abpni.co.uk \
    --to=jonnyt@abpni.co.uk \
    --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).