[linux-lvm] Snapshots and disk re-use

James Hawtin oolon at ankh.org
Tue Apr 5 23:39:49 UTC 2011


On 05/04/2011 23:19, Jonathan Tripathy wrote:
> Excellent point! As long as I use the same PEs for making the snapshot 
> everytime, I don't need to ever erase it (And it can be a nice big 
> size like 50GB, so even my largest customers won't outgrow the 
> snapshot). However though, wouldn't I need to keep the "hog" around 
> just to make sure that the snapshot PEs don't get assigned to a new 
> customer LV in the future (Currently, we don't specify PEs to use when 
> creating normal LVs)?
>

I think you missed the point of why I suggested using a separate PV, the 
space could be divided using fdisk it does not have to separate physical 
disk (This is ok as you will never use this space for mirroring). If 
snapshots are created on a separate PV you can use pvchange - x n and 
pvchange -x y to change if it is allocatable and only when you are 
creating snaps do you make in allocatable that will prevent accidental 
reuse in customer lvs without lots of hassle.  If you don't use pvchange 
you will need to specify the PVs when ever you create a customer LV.

# an lvcreate with specifing the PEs to use.
lvcreate -l 20 -s -n data_snap /dev/test_vg/data_lv /dev/cciss/c0d1p2


Also this allows you to use 50 GB area or 4 x 10 GB ones, depending on 
what you are backing up without having to worry about creating a hog 
over the top of anything you haven't used. This allows you more 
flexibility with simultaneous backups.

> An even better question: Does the snapshot have to be on the same 
> physical disk as the LV its mirroring?
>
No it does not.

Do I get cake now?

James




More information about the linux-lvm mailing list