[linux-lvm] Snapshots and disk re-use
Jonathan Tripathy
jonnyt at abpni.co.uk
Wed Apr 6 00:00:38 UTC 2011
On 06/04/2011 00:39, James Hawtin wrote:
> 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.
Ok now things are really getting interesting!
Actually, when I create new customer LVs, I always specify which volume
group I want to add it to. E.g:
lvcreate -nNewCustomerLV -L20G vg0
where vg0 is /dev/vg0
and vg0 is a volume group which uses an entire physical partition (Which
I guess is called a PV).
Now, if I were to create my snapshots on a seperate vg, eg:
lvcreate -L 20G -s -n data_snap /dev/vg0/NewCustomerLV /dev/vg1
does that mean I never need to use pvchange to "switch off" vg1? And I
never need to zero or create a "hog"? And no leakage will ever occur?
>
>
> Do I get cake now?
Only if it's not a lie.... :)
(Just incase you didn't get the referance
http://en.wikipedia.org/wiki/The_cake_is_a_lie)
More information about the linux-lvm
mailing list