[mylvmbackup] Re: snapshot size should be given in extents, not megabytes
- From: Thorben Thuermer <t.thuermer@xxxxxxxxxxxxxxxx>
- To: mylvmbackup@xxxxxxxxxxxxx
- Date: Fri, 10 Oct 2008 09:54:20 +0200
On Thu, 9 Oct 2008 10:33:58 -0500 "Boehm, Matthew" <mboehm@xxxxxxxxxxxxx> wrote:
> Hey Thorben,
Hi,
thanks for the quick response!
> I can understand what you're looking for. However, may I ask why you
> need to use "all available space" to create the snapshot? We have 1TB
> LV partitions assigned to /var/lib/mysql/ and when we do snaps, we only
> use 5G even though more extents exist.
the problem is that some %$#$!# put lvm on a 1tb storage system i took over
from him, but created a single huge logical volume on it, and changing that
is rather complicated in a production system.
my script creates an image file (on another disk), adds it to the volume
group via loopback, and then creates a snapshot on that...
and it would be kinda silly not to use all of the available space then.
(silliness of the whole concept notwithstanding)
> Or is "all available space" your way of saying "100%"? :)
yes...
> I think someone posted a branch to support percentages.
any idea where that might be found?
(no mention of "extents" on the list archives)
> I figure the
> script can be smart enough to determine the difference between these
> three:
> snapsize=10% (10 percent)
> snapsize=2G (2 gigabytes)
> snapsize=511X (511 eXtents, 'E' is the prefix for Exabyte)
"could", you mean? ;)
more recent versions of lvm (2.02.39 in debian testing) actually support
percentages already, but only with -l (extents), not -L (bytes).
(another fine argument for supporting -l :) )
> -Matthew
- Thorben
> -----Original Message-----
> From: mylvmbackup-bounce@xxxxxxxxxxxxx
> [mailto:mylvmbackup-bounce@xxxxxxxxxxxxx] On Behalf Of Thorben Thuermer
> Sent: Thursday, October 09, 2008 10:23 AM
> To: mylvmbackup@xxxxxxxxxxxxx
> Subject: [mylvmbackup] snapshot size should be given in extents, not
> megabytes
>
> Hello,
>
> i am writing a wrapper around mylvmbackup that has it create the
> snapshot
> using all available space in the volume group (among other things).
> the problem here is that when passing the size in units of bytes, this
> is
> subject to rounding errors:
>
> db01:~# lvm vgdisplay VG | grep Free
> Free PE / Size 511 / 2.00 GB
> db01:~# lvm lvcreate -s VG/LV -n LV-snap -L 2.00G
> Insufficient free extents (511) in volume group VG: 512 required
>
> (the same happens when passing to mylvmbackup with --lvsize, obviously)
>
> the correct way to specify logical volume sizes for lvm is in extents,
> which
> allows passing exact values without rounding errors:
>
> db01:~# lvm vgdisplay VG | grep Free
> Free PE / Size 511 / 2.00 GB
> db01:~# lvm lvcreate -s VG/LV -n LV-snap -l 511
> Logical volume "LV-snap" created
>
> => it would be nice if mylvmbackup at least had an option to pass the
> snapshot size in extents. instead of bytes
> (note that newer versions of lvm also accept percentages of free
> space)
>
> (i'm not a perl programmer really, but i might write/submit a patch if
> there's
> interest in it.)
>
> - Thorben Thuermer
- References:
- [mylvmbackup] snapshot size should be given in extents, not megabytes
- From: Thorben Thuermer
- [mylvmbackup] Re: snapshot size should be given in extents, not megabytes
- From: Boehm, Matthew
Other related posts:
- » [mylvmbackup] snapshot size should be given in extents, not megabytes
- » [mylvmbackup] Re: snapshot size should be given in extents, not megabytes
- » [mylvmbackup] Re: snapshot size should be given in extents, not megabytes
- [mylvmbackup] snapshot size should be given in extents, not megabytes
- From: Thorben Thuermer
- [mylvmbackup] Re: snapshot size should be given in extents, not megabytes
- From: Boehm, Matthew