[linux-lvm] Snapshots and disk re-use
Stuart D. Gathman
stuart at bmsi.com
Thu Feb 24 02:00:08 UTC 2011
On Thu, 24 Feb 2011, Jonathan Tripathy wrote:
> > > > So I'm guessing then, that when a snapshot is created for an origin,
> > > > then
> > > > there are 2 physical copies of the data on disk? (Albeit only one is
> > > > accessible at the regular filesystem level)
> > > NO, NO, NO. There is still only *one* physical copy of the data
> > > after creating a snapshot. You have simply created a "branch point"
> > > which can now diverge as each branch is written to.
> > >
> > Then why was it suggested that I should zero my new customer LVs upon
> > creation? Please remember that my snapshots will not be written to
> However the origin will be written to as it will be in use...
There were 3 cases of what you might be asking. One of the 3 cases was:
If you are taking snapshots for backup, then it was suggested to zero the *-cow
(which will have any blocks written to the origin since the snapshot was taken)
before deleting the snapshot. However, I wasn't sure if this was safe to while
the origin is mounted, since writes to the origin consult the *-cow to see
whether origin blocks need to be copied before begin overwritten.
IDEA - this could be done safely in lvremove by disconnecting snapshot
from origin, then optionally zeroing the *-cow before finally removing it.
The option could be as simple as a --keep option to keep the *-cow around
as a normal LV (under a new name, perhaps) for the admin to run shred or copy
zeros to before finally removing it.
Stuart D. Gathman <stuart at 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.
More information about the linux-lvm