[linux-lvm] Snapshots and disk re-use

James Hawtin oolon at ankh.org
Wed Apr 6 01:36:40 UTC 2011


On 06/04/2011 00:43, Stuart D. Gathman wrote:
> In fact, since you still have to zero an LV before removing, you might 
> as well
> zero an LV when you allocate.  Same overhead.  Then you don't need to 
> mess
> with any of these schemes to deal with snapshots.  Did we already cover
> that obvious solution?  We did discuss a utility to optimize zeroing an
> already mostly zero LV.
>

I think you mean and lv of a virtual machine rather than snap shot, not 
sure how you could zero the cow. Stuart does have a good point here, 
there is another source of leak outside of snapshots (and probably 
worse), if you delete an lv the create a new one over the same PEs the 
data from then old lv will be there, save a few k that is zeroed at the 
front (to help with fs/label creation). This is worse as it is in order 
data that the cow from a snap is not. Geting a while fs back is very 
possible.

Try this test

lvcreate -L 256m -n test_lv osiris_l1_vg
yes | dd of=/dev/osiris_l1_vg/test_lv
pvdisplay --map
lvremove /dev/osiris_l1_vg/test_lv
lvcreate -L 256m -n test_lv osiris_l1_vg
pvdisplay --map
od -ha /dev/osiris_l1_vg/test_lv

James




More information about the linux-lvm mailing list