[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] Snapshots and disk re-use



On Wed, 23 Feb 2011, Les Mikesell wrote:

> > > Actually, if you never (or rarely) write to the origin, lots of snapshots
> > > should be fine.
> >
> > > But every write to the origin will first copy the
> > > original origin data to every snapshot.
> > >
> > Why would origin data be copied over to the snapshot after the snapshot
> > has been created? Surely the point of a snapshot is to have "frozen" data?
> 
> Yes, is the way this actually works explained somewhere?  I would have
> expected the 'copy-on-write' blocks to be copied only on the side where the
> write is happening and relocated instead of rewriting all the snapshots that
> might be outstanding with the old data.

It should be obvious when you think about it.  You go to write to the origin, 
to a block you've never written to since creating the snapshot.  Where
are you going to save that original data?  Why in the *-cow LV of course.

The origin and snapshot LVs do not have data of their own.  The
origin data is in *-real, and new writes to the origin first read *-real,
write *-cow, then finally do the new write to *-real.  This read-write-write
cycle is tolerable for a single snapshot, but quickly gets out of hand 
with multiple snapshots.

Writes to the snapshot, on the other hand, simply write to the *-cow with
some mapping, no need to update the origin.

Reads from origin simply read from *-real.  Reads from snapshot, read
from *-cow if mapped, and from *-real otherwise.

-- 
	      Stuart D. Gathman <stuart bmsi com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]