[pve-devel] move disk to LVM

Michael Rasmussen mir at datanom.net
Fri Feb 17 01:59:47 CET 2017


On Thu, 16 Feb 2017 07:50:18 +0100 (CET)
Dietmar Maurer <dietmar at proxmox.com> wrote:

> 
> I am not aware of any decision, and wipe_signatures_when_zeroing_new_lvs
> is set to 1. Maybe we need to add the -Z flag?
> 
It seems this has no effect since the lvcreate command is run without
terminal in which case lvcreate will skip waiting for input and
fallback to leave the signature on the disk.

Apparently there is some caching involved which means when you remove a
logical volume the data is not really remove so creating a new volume
using the same name and size of a previously removed volume will
reinstate this previously removed volume with its partition table
intact which is why lvcreate complains about existing signatures. To
solve this issue make certain the partition table is wiped before
removing the volume.

+++ Storage/LVMPlugin.pm	2017-02-17 01:57:53.461188567 +0100
@@ -338,6 +338,8 @@
 	return $zero_out_worker;
     } else {
 	my $tmpvg = $scfg->{vgname};
+	$cmd = ['/bin/dd', 'if=/dev/zero', "of=/dev/$tmpvg/$volname", 'bs=512', 'count=1'];
+	run_command($cmd, errmsg => "dd '$tmpvg/$volname' error");
 	$cmd = ['/sbin/lvremove', '-f', "$tmpvg/$volname"];
 	run_command($cmd, errmsg => "lvremove '$tmpvg/$volname' error");
     }


-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
/usr/games/fortune -es says:
Honi soit la vache qui rit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20170217/7eaaf684/attachment.sig>


More information about the pve-devel mailing list