]> git.proxmox.com Git - pve-storage.git/commitdiff
new lvm option 'saferemove' to zero-out data when removing LVs
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Mar 2012 08:38:06 +0000 (09:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Mar 2012 08:43:01 +0000 (09:43 +0100)
Makefile
PVE/Storage.pm
changelog.Debian

index c6db2098772c64e1e1a3fba091949025d9fc9b56..e955ddf9637d6befd41348186a1f4672d89c0b30 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.0
 
 VERSION=2.0
 PACKAGE=libpve-storage-perl
-PKGREL=12
+PKGREL=13
 
 DESTDIR=
 PREFIX=/usr
index 29e827bc0f743d4bc4239463bdcca85528cb2584..6209f822a7088425c3bfddc4cea3fe0b4ad4fba0 100755 (executable)
@@ -138,6 +138,7 @@ my $confvars = {
     path => 'path',
     shared => 'bool',
     disable => 'bool',
+    saferemove => 'bool',
     format => 'format',
     content => 'content',
     server => 'server',
@@ -192,6 +193,7 @@ my $default_config = {
         nodes => 0,
        shared => 0,
        disable => 0,
+        saferemove => 0,
        content => [ {images => 1}, { images => 1 }],
         base => 1,
     },
@@ -1341,12 +1343,16 @@ sub vdisk_free {
            }
        } elsif ($scfg->{type} eq 'lvm') {
 
-           $vg = $scfg->{vgname};
-
-           # avoid long running task, so we only rename here
-           my $cmd = ['/sbin/lvrename', $vg, $volname, "del-$volname"];
-           run_command($cmd, errmsg => "lvrename '$vg/$volname' error");
-
+           if ($scfg->{saferemove}) {
+               # avoid long running task, so we only rename here
+               $vg = $scfg->{vgname};
+               my $cmd = ['/sbin/lvrename', $vg, $volname, "del-$volname"];
+               run_command($cmd, errmsg => "lvrename '$vg/$volname' error");
+           } else {
+               my $tmpvg = $scfg->{vgname};
+               my $cmd = ['/sbin/lvremove', '-f', "$tmpvg/$volname"];
+               run_command($cmd, errmsg => "lvremove '$tmpvg/$volname' error");
+           }
 
        } elsif ($scfg->{type} eq 'iscsi') {
            die "can't free space in iscsi storage\n";
index 75b713a2c0d0833007cfb5408ef068289271fb45..0bfa37536b03ba14760a42fcd4571bd33ed79c92 100644 (file)
@@ -1,3 +1,9 @@
+libpve-storage-perl (2.0-13) unstable; urgency=low
+
+  * new lvm option 'saferemove' to zero-out data when removing LVs
+
+ -- Proxmox Support Team <support@proxmox.com>  Fri, 09 Mar 2012 09:37:02 +0100
+
 libpve-storage-perl (2.0-12) unstable; urgency=low
 
   * fix permission checks (delete volume requires Datastore.Allocate)