[linux-lvm] Snapshots and disk re-use

Jonathan Tripathy jonnyt at abpni.co.uk
Wed Apr 6 00:28:08 UTC 2011


> No you are confused pvs are created on disk partitions, one or more 
> pvs then make you vg.
>
> LVs are created on top of VGs, VGs are created on top of PVs, PVs are 
> created on partitions on block devices or whole block devices.
>
> (Ok we shall stop here however blocks devices could be loop back, meta 
> devices like raid 0/1/5 etc hardware/software or real disks however 
> that is not LVM any more.)

Ok, i think I get it now. At the minute, my vg (vg0) only has on PV in 
it (/dev/md3 which you can tell is a mdadm RAID device). I wasn't aware 
you could add more PVs (that's pretty cool!). So, let's say I had a 
spare partition (/dev/hdb7 as an example). To my vg0 volume group, I 
would firstly:

pvcreate /dev/hdb7
vgextend /dev/hdb7

Then, every time I create a new customer LV, I would do:

lvcreate -nNewCustomerLV -L20G vg0 /dev/md3

Then, every time I wanted to create a snapshot:

lvcreate -L20G -s -n data_snap /dev/vg0/NewCustomerLV /dev/hdb7

Is that correct? No Leakage? And no zeroing needed?

Side note: Since I didn't partition my servers with this in mind, my new 
PV will probably have to be an iSCSI device located on a remote target 
:( Either that or use a loopback device with an image, but I'd be scared 
that the system would not boot properly. Can you give me any tips on how 
to use an image file as a PV just for snapshots?

Thanks




More information about the linux-lvm mailing list