LVM Snapshots

5 views
Skip to first unread message

James

unread,
Aug 12, 2009, 7:38:33 AM8/12/09
to vmsb...@googlegroups.com
Hi,

I have just read the README for backup_vmware3.12a and it states the following:

- if the LVM option is enabled (LVM="true") the linux host must have LVM2 active and the directory
    where the VMs reside *must* be mounted on a LVM2 logical volume snapshot-enabled
    ( = it must be part of a volume group which has some free space to create the snapshots )

I have a couple of questions:

- How much space does a LVM snapshot actually take up?

- The LVM partition where my VM images resides is /home which  obviously contains more than just my virtual machine images, so is there another option for backing up the images? I guess tar'ing them up??

- Can I backup the LVM snapshots to a non LVM partition? I have a USB disk mounted on the server.


Many Thanks

James

10nico

unread,
Aug 12, 2009, 9:43:16 AM8/12/09
to vmsbackup
Please allow me to better explain the LVM snapshot thing.
An LVM volume is like a partition, you format it and you mount it.
Your VMs reside on it and work as usual.
When you create a snapshot, you actually create a "virtual clone" of
the partition, which does not occupy any physical space, and can be
mounted just like the real partition.
Of course it is read-only.
The "free physical extents" are needed by LVM itself to store all the
changes that occur on the real data for as long as the LVM snapshot
exists.
How many of these are needed depends on how much time the snapshot
will exist; in fact, the more time the snapshot exists, the more the
changes to the real volume will have to store.

So, to answer your questions:

- How much space does a LVM snapshot actually take up?
Depends; I, for example, leave between 1GB and 4GB free space, and
never filled it, so I guess it should be enough.

- The LVM partition where my VM images resides is /home which
obviously
contains more than just my virtual machine images, so is there another
option for backing up the images? I guess tar'ing them up??

Wrong question!
The right one is: do you have enough (if any) free phyisical extents
in this LVM volume?
You can see how many there are with this command:

vgdisplay "your Volume Group name" | grep "Free PE"
If the number is 0 , and it most certainly will, you can't use this
LVM volume to create LVM snapshots.
Why am I so sure? Because the default when creating an LVM volume is
to NOT leave any free physical extents.

- Can I backup the LVM snapshots to a non LVM partition? I have a USB
disk
mounted on the server.

You can backup to any path you can mount, just remember to mount it
before running the script and update the BACKPATH variable
accordingly.

Regards,

Michele

James

unread,
Aug 12, 2009, 10:01:07 AM8/12/09
to vmsb...@googlegroups.com
Please see my responses :)

On Wed, Aug 12, 2009 at 2:43 PM, 10nico <gcana...@yahoo.it> wrote:

Please allow me to better explain the LVM snapshot thing.
An LVM volume is like a partition, you format it and you mount it.
Your VMs reside on it and work as usual.
When you create a snapshot, you actually create a "virtual clone" of
the partition, which does not occupy any physical space, and can be
mounted just like the real partition.
Of course it is read-only.
The "free physical extents" are needed by LVM itself to store all the
changes that occur on the real data for as long as the LVM snapshot
exists.
How many of these are needed depends on how much time the snapshot
will exist; in fact, the more time the snapshot exists, the more the
changes to the real volume will have to store.

So, to answer your questions:

- How much space does a LVM snapshot actually take up?
Depends; I, for example, leave between 1GB and 4GB free space, and
never filled it, so I guess it should be enough.

How big are your LVM partitions?
 


- The LVM partition where my VM images resides is /home which
obviously
contains more than just my virtual machine images, so is there another
option for backing up the images? I guess tar'ing them up??

Wrong question!
The right one is: do you have enough (if any) free phyisical extents
in this LVM volume?
You can see how many there are with this command:

vgdisplay "your Volume Group name" | grep "Free  PE"
If the number is 0 , and it most certainly will, you can't use this
LVM volume to create LVM snapshots.
Why am I so sure? Because the default when creating an LVM volume is
to NOT leave any free physical extents.
I did not use the default layout and defiantly left some space ... just checking now...

 Alloc PE / Size       26812 / 837.88 GB
  Free  PE / Size       2960 / 92.50 GB



- Can I backup the LVM snapshots to a non LVM partition? I have a USB
disk
mounted on the server.

You can backup to any path you can mount, just remember to mount it
before running the script and update the BACKPATH variable

Ok cool thanks :)

10nico

unread,
Aug 12, 2009, 11:10:59 AM8/12/09
to vmsbackup
Hello again!

- How big are your LVM partitions?

Depends from the host:
the smallest I had was 72GB with 1GB of free PE , but then reinstalled
the OS and decided not to use LVM on such a small hard drive to not to
waste space.

I have two hosts with the following details:

Alloc PE / Size 102055 / 398,65 GB
Free PE / Size 1022 / 3,99 GB

the biggest I have is 784GB with this details:

Alloc PE / Size 200843 / 784.54 GB
Free PE / Size 1024 / 4.00 GB

You definitely have LOTS (92,5 GB) of free space on your VG!
So you most definitely can create snapshots with that VG :-)

Have a nice evening and a nice backup!

Michele

On 12 Ago, 16:01, James <packetsnif...@gmail.com> wrote:
> Please see my responses :)
>
>
>
> On Wed, Aug 12, 2009 at 2:43 PM, 10nico <gcanavra...@yahoo.it> wrote:
>
> > Please allow me to better explain the LVM snapshot thing.
> > An LVM volume is like a partition, you format it and you mount it.
> > Your VMs reside on it and work as usual.
> > When you create a snapshot, you actually create a "virtual clone" of
> > the partition, which does not occupy any physical space, and can be
> > mounted just like the real partition.
> > Of course it is read-only.
> > The "free physical extents" are needed by LVM itself to store all the
> > changes that occur on the real data for as long as the LVM snapshot
> > exists.
> > How many of these are needed depends on how much time the snapshot
> > will exist; in fact, the more time the snapshot exists, the more the
> > changes to the real volume will have to store.
>
> > So, to answer your questions:
>
> > - How much space does a LVM snapshot actually take up?
> > Depends; I, for example, leave between 1GB and 4GB free space, and
> > never filled it, so I guess it should be enough.
>
>
>
>
>
>
>
Reply all
Reply to author
Forward
0 new messages