new lvm option 'saferemove' to zero-out data when removing LVs

This commit is contained in:
Dietmar Maurer
2012-03-09 09:38:06 +01:00
parent 88c3abaf6e
commit d642361b29
3 changed files with 19 additions and 7 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=libpve-storage-perl
PKGREL=12
PKGREL=13
DESTDIR=
PREFIX=/usr

View File

@ -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";

View 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)