Centos – size lvm snapshot

centoslvmopenvz

I'm configuring an openvz node and would like to use lvm snapshot for backup (I do remote backup too).

The snapshot size is the same that data in the backuped partition ?

If I have a logical volume with 100G data, the snapshot is 100G size ?

I ask that because I don't know how space use for virtual machines and snapshots in my volume group.

My vg is 450G.

roberto

Best Answer

The size of an LVM snapshot gives the maximum number of blocks you can write in the snapshot or the underlying volume before the snapshot overflows and is broken. So, in your example, having a logical volume of 100G you can create a 1GB snapshot volume it will take 1G in your LVM. Now you can write 1G of data to the snapshot, 1GB of data to the original volume or 500MB to each before the snapshot overflows. A snapshot of 100G would never overflow.

Using snapshots as disks for virtual machines is very nice, as you can provision them quickly, but if you expect the users to write a lot you will have to monitor the size of the snapshots and potentially increase it. The relevant stat is Allocated to snapshot in lvdisplay.