diff -u mylvmbackup-0.13/debian/changelog mylvmbackup-0.13/debian/changelog --- mylvmbackup-0.13/debian/changelog +++ mylvmbackup-0.13/debian/changelog @@ -1,3 +1,16 @@ +mylvmbackup (0.13-2ubuntu1~8~precise1) precise; urgency=low + + * Auto build. + + -- Neil Wilson Tue, 04 Dec 2012 17:44:10 +0000 + +mylvmbackup (0.13-2ubuntu1) UNRELEASED; urgency=low + + * debian/patches/1086313-add-thin-support.dpatch: + add support for thin snapshots (LP: #1086313) + + -- Neil Wilson Tue, 04 Dec 2012 10:45:41 +0000 + mylvmbackup (0.13-2) unstable; urgency=medium * Set umask before creating the backup. (closes: #518471) diff -u mylvmbackup-0.13/debian/patches/00list mylvmbackup-0.13/debian/patches/00list --- mylvmbackup-0.13/debian/patches/00list +++ mylvmbackup-0.13/debian/patches/00list @@ -3,0 +4 @@ +1086313-add-thin-support.dpatch only in patch2: unchanged: --- mylvmbackup-0.13.orig/debian/bzr-builder.manifest +++ mylvmbackup-0.13/debian/bzr-builder.manifest @@ -0,0 +1,2 @@ +# bzr-builder format 0.3 deb-version {debupstream}-2ubuntu1~8 +lp:~brightbox/ubuntu/precise/mylvmbackup/fix-for-1086313 revid:neil@aldur.co.uk-20121204104613-ob92r3fb3lg5v3kh only in patch2: unchanged: --- mylvmbackup-0.13.orig/debian/patches/1086313-add-thin-support.dpatch +++ mylvmbackup-0.13/debian/patches/1086313-add-thin-support.dpatch @@ -0,0 +1,83 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +## 1086313-add-thin-support.dpatch by Neil Wilson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mylvmbackup~/man/mylvmbackup.pod mylvmbackup/man/mylvmbackup.pod +--- mylvmbackup~/man/mylvmbackup.pod 2012-12-04 10:44:05.000000000 +0000 ++++ mylvmbackup/man/mylvmbackup.pod 2012-12-04 10:44:57.762590948 +0000 +@@ -305,6 +305,12 @@ + not be useful if the snapshot is removed. You need to manually unmount this + directory before invoking mylvmbackup again. + ++=item B<--thin> ++ ++If this option is given, mylvmbackup will expect that the LVM volume is ++using thin provisioning and that the snapshot will use physical space ++from the existing thin pool. Any size specified with I is ignored. ++ + =item B<--relpath=string> + + Relative path on the logical volume to the MySQL data directory (no leading or +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mylvmbackup~/mylvmbackup.pl.in mylvmbackup/mylvmbackup.pl.in +--- mylvmbackup~/mylvmbackup.pl.in 2012-12-04 10:44:05.000000000 +0000 ++++ mylvmbackup/mylvmbackup.pl.in 2012-12-04 10:44:57.762590948 +0000 +@@ -87,6 +87,7 @@ + my $syslog_socktype; + my $syslog_facility; + my $syslog_remotehost; ++my $use_thin_snapshots; + + # Load defaults into variables + load_defaults(); +@@ -301,6 +302,7 @@ + $keep_snapshot=$cfg->val ('misc', 'keep_snapshot', $keep_snapshot); + $keep_mount=$cfg->val ('misc', 'keep_mount', $keep_mount); + $quiet=$cfg->val ('misc', 'quiet', $quiet); ++ $use_thin_snapshots=$cfg->val ('misc', 'thin', $use_thin_snapshots); + + $mountdir=$cfg->val ('fs', 'mountdir', $mountdir); + $backupdir=$cfg->val ('fs', 'backupdir', $backupdir); +@@ -366,6 +368,7 @@ + "skip_hooks" => \&skip_hooks, + "keep_snapshot" => \&keep_snapshot, + "keep_mount" => \&keep_mount, ++ "thin" => \&use_thin_snapshots, + "quiet" => \&quiet, + + # fs +@@ -435,6 +438,7 @@ + $keep_snapshot=0; + $keep_mount=0; + $quiet=0; ++ $use_thin_snapshots=0; + + # fs + $mountdir='/var/tmp/mylvmbackup/mnt/'; +@@ -628,7 +632,9 @@ + + sub create_lvm_snapshot + { +- my $command= "$lvcreate -s --size=$lvsize --name=$backuplv /dev/$vgname/$lvname"; ++ my $params = ''; ++ $params = "--size=$lvsize" unless $use_thin_snapshots; ++ my $command= "$lvcreate -s $params --name=$backuplv /dev/$vgname/$lvname"; + return run_command("taking LVM snapshot", $command); + } + +@@ -749,6 +755,10 @@ + $keep_mount = 1; + } + ++sub use_thin_snapshots { ++ $use_thin_snapshots = 1; ++} ++ + sub quiet { + $quiet = 1; + }